#include "Question.h"
#include <QDomElement>
#include <iostream>


Question::Question(QWidget *parent) : QWidget(parent){
    durationQuestion = 10;
}

Question::Question(const QString& duration,QWidget *parent) : QWidget(parent){
    durationQuestion = duration.toInt();
}

Question::~Question(){

}


//Lectura del XML
bool Question::loadFromNode(const QDomElement& element){
    for ( QDomNode child = element.firstChild(); ! child.isNull(); child = child.nextSibling() )   {
        QDomElement element = child.toElement();
        if ( element.isNull() ) continue;
        if ( element.tagName() == "text" )
            text = element.text();
        else if ( element.tagName() == "answer" )
            answer = element.text();
    }
    return true;
}

//Slot Padre
void Question::check(){
}

//Retorna La Pregunta NO UTILIZADO
//Print Padre
QString Question::print() const{
    return text;
}

//Apply Padre
bool Question::aplicar(int &userScoreE) {
    return true;
}

//Slot Padre
void Question::remainingTimeAnswer(){
}
