MK
Size: a a a
MK
D
D
t
AS
t
AS
IZ
t
IZ
VS
m
class IQuestion
{
public:
IQuestion()
{
printf("IQuestion Creation\n");
}
virtual bool Answer(shsize) = 0;
virtual void LoadFromJson(const json&) = 0;
virtual void FillJson(json&) = 0;
virtual void DrawBuilder() = 0;
virtual eQuestionType getType() = 0;
virtual std::string getText() = 0;
};
class ChoiseQuestion : public IQuestion
{
private:
std::vector<std::string> m_options;
shsize m_rightOptionID;
std::string m_text;
public:
ChoiseQuestion();
void LoadFromJson(const json&) override;
void FillJson(json&) override;
void DrawBuilder() override;
bool Answer(shsize) override;
eQuestionType getType() override
{
return eQuestionType::Choise;
}
std::string getText() override
{
return m_text;
}
};
class SequenceQuestion : public IQuestion
{
private:
std::vector<std::string> m_options;
std::vector<int> m_rightSequence;
std::string m_text;
public:
SequenceQuestion();
void LoadFromJson(const json&) override;
void FillJson(json&) override;
void DrawBuilder() override;
bool Answer(shsize) override;
eQuestionType getType() override
{
return eQuestionType::Sequence;
}
std::string getText() override
{
return m_text;
}
//bool Answer(const std::vector<int>&)override;
};
class RatioQuestion : public IQuestion
{
private:
std::vector<std::vector<std::string>> m_tables;
std::vector<int> m_rightRatio;
std::string m_text;
public:
RatioQuestion();
void LoadFromJson(const json&) override;
void FillJson(json&) override;
void DrawBuilder() override;
bool Answer(shsize) override;
eQuestionType getType() override
{
return eQuestionType::Ratio;
}
std::string getText() override
{
return m_text;
}
//bool Answer(const std::vector<int>&)override;
};
VS
IG
void SetAll(string _name,
string _information,
int _dateofCreation,
int _numberofPages,
int _numberofCreators,
string _Autors)
{
this->name = _name;
this->information = _information;
this->dateofCreation = _dateofCreation;
this->numberofPages = _numberofPages;
this->numberofCreators = _numberofCreators;
this->Autors = _Autors;
}
void GetAll()
{
cout << "Имя: " << this->name << endl;
cout << "Дата создания: " << this->dateofCreation << endl;
cout << "Имя автора(oв): " << this->Autors << endl;
cout << "Количество создателей: " << this->numberofCreators << endl;
cout << "Количество страниц: " << this->numberofPages << endl;
cout << "Информация про книгу: " << this->information << endl;
}
ID
void SetAll(string _name,
string _information,
int _dateofCreation,
int _numberofPages,
int _numberofCreators,
string _Autors)
{
this->name = _name;
this->information = _information;
this->dateofCreation = _dateofCreation;
this->numberofPages = _numberofPages;
this->numberofCreators = _numberofCreators;
this->Autors = _Autors;
}
void GetAll()
{
cout << "Имя: " << this->name << endl;
cout << "Дата создания: " << this->dateofCreation << endl;
cout << "Имя автора(oв): " << this->Autors << endl;
cout << "Количество создателей: " << this->numberofCreators << endl;
cout << "Количество страниц: " << this->numberofPages << endl;
cout << "Информация про книгу: " << this->information << endl;
}
VS
ID
ID