#ifndef QUESTION_ITEM_H
#define QUESTION_ITEM_H
#include "../shared/question.h"
#include "svg_item.h"
class QuestionAnswer
{
public:
QuestionAnswer(Question::Answer = Question::None,
Question::Answer = Question::None,
int = -1,
int = 0,
Question::SelectionType = Question::SingleSelection,
QString = QString());
void setAnswered(Question::Answer); Question::Answer answered();
void setCorrectAnswer(Question::Answer); Question::Answer correctAnswer();
float score(ScoringSystem);
float maximumScore(ScoringSystem);
void setFlag(int); int flag();
void setDifficulty(int); int difficulty();
void setSelectionType(Question::SelectionType); Question::SelectionType selectionType();
void setExplanation(QString); QString explanation();
private:
Question::Answer qa_answered;
Question::Answer qa_correct_answer;
int qa_flag;
int q_difficulty;
Question::SelectionType q_selectiontype;
QString qa_explanation;
};
class QuestionItem : public Question
{
public:
QuestionItem(QString = QString(),
int = -1,
QString = QString(),
int = 0,
QString = QString(),
QStringList = QStringList() << QString() << QString() << QString() << QString(),
Answers = None,
SelectionType = SingleSelection,
QString = QString(),
unsigned int = 0,
unsigned int = 0,
bool = false,
QList<SvgItem *> = QList<SvgItem *>(),
bool = true);
~QuestionItem();
public slots:
bool isHidden(); void setHidden(bool);
unsigned int incorrectAnsCount(); void setIncorrectAnsCount(unsigned int);
unsigned int correctAnsCount(); void setCorrectAnsCount(unsigned int);
void addIncorrectAns(); void addCorrectAns();
void addSvgItem(SvgItem *);
bool removeSvgItem(SvgItem *); SvgItem * removeSvgItem(int);
int numSvgItems(); SvgItem * svgItem(int); QList<SvgItem *> svgItems();
int recommendedDifficulty();
QString allProperties(); QString allPublicProperties();
private:
unsigned int q_incorrectanscount;
unsigned int q_correctanscount;
bool q_hidden;
QList<SvgItem *> q_svgitems;
};
#endif