srand(time(NULL));
QVBoxLayout *vbox = new QVBoxLayout();
- QHBoxLayout *hbox_less = new QHBoxLayout();
- QHBoxLayout *hbox_question_lang = new QHBoxLayout();
- QHBoxLayout *hbox_answer_lang = new QHBoxLayout();
+// QHBoxLayout *hbox_less = new QHBoxLayout();
+// QHBoxLayout *hbox_question_lang = new QHBoxLayout();
+// QHBoxLayout *hbox_answer_lang = new QHBoxLayout();
QVBoxLayout *vbox_label = new QVBoxLayout();
QHBoxLayout *hbox_buttons = new QHBoxLayout();
hbox_buttons->addWidget(button);
connect(button, SIGNAL(clicked(bool)), this, SLOT(slotSettings(bool)));
-
- QComboBox *combox_lesson = new QComboBox();
- QComboBox *combox_question = new QComboBox();
- QComboBox *combox_answer = new QComboBox();
+//
+// QComboBox *combox_lesson = new QComboBox();
+// QComboBox *combox_question = new QComboBox();
+// QComboBox *combox_answer = new QComboBox();
bgroup_choice = new QButtonGroup();
QuestionLabel = new QLabel();
answer1 = new QPushButton;
answer2 = new QPushButton;
answer3 = new QPushButton;
+ answer4 = new QPushButton;
+
vbox_label->addWidget(answer1);
vbox_label->addWidget(answer2);
vbox_label->addWidget(answer3);
+ vbox_label->addWidget(answer4);
+
answerButtonsList.append(answer1);
answerButtonsList.append(answer2);
answerButtonsList.append(answer3);
+ answerButtonsList.append(answer4);
+
bgroup_choice->addButton(answer1);
- bgroup_choice->setId(answer1, 0);
bgroup_choice->addButton(answer2);
- bgroup_choice->setId(answer2, 1);
bgroup_choice->addButton(answer3);
+ bgroup_choice->addButton(answer4);
+
+ bgroup_choice->setId(answer1, 0);
+ bgroup_choice->setId(answer2, 1);
bgroup_choice->setId(answer3, 2);
+ bgroup_choice->setId(answer4, 3);
connect(answer1,SIGNAL(clicked(bool)),this,SLOT(slotAnswer1(bool)));
connect(answer2,SIGNAL(clicked(bool)),this,SLOT(slotAnswer2(bool)));
connect(answer3,SIGNAL(clicked(bool)),this,SLOT(slotAnswer3(bool)));
+ connect(answer4,SIGNAL(clicked(bool)),this,SLOT(slotAnswer4(bool)));
questionID = 0;
answerID = 0;
lessonID = 0;
CorrectID = 0;
- QLabel *label_question = new QLabel("Question:");
- hbox_question_lang->addWidget(label_question);
-
- QLabel *label_answer = new QLabel("Answer:");
- hbox_answer_lang->addWidget(label_answer);
-
- QLabel *label_lesson = new QLabel("Lesson:");
- hbox_less->addWidget(label_lesson);
+// QLabel *label_question = new QLabel("Question:");
+// hbox_question_lang->addWidget(label_question);
+//
+// QLabel *label_answer = new QLabel("Answer:");
+// hbox_answer_lang->addWidget(label_answer);
+//
+// QLabel *label_lesson = new QLabel("Lesson:");
+// hbox_less->addWidget(label_lesson);
QStringList args = QApplication::arguments();
args.removeFirst();
lessons = docRead->lesson()->childContainers();
- for (int i = 0; i < docRead->identifierCount(); ++i)
- {
- combox_question->insertItem(i, docRead->identifier(i).name(), NULL);
- combox_answer->insertItem(i, docRead->identifier(i).name(), NULL);
- }
+// for (int i = 0; i < docRead->identifierCount(); ++i)
+// {
+// combox_question->insertItem(i, docRead->identifier(i).name(), NULL);
+// combox_answer->insertItem(i, docRead->identifier(i).name(), NULL);
+// }
- connect(combox_question,SIGNAL(currentIndexChanged(int)),this,SLOT(reactToToggleQuestion(int)));
- connect(combox_answer,SIGNAL(currentIndexChanged(int)),this,SLOT(reactToToggleAnswer(int)));
- combox_question->setCurrentIndex(0);
- combox_answer->setCurrentIndex(1);
- hbox_question_lang->addWidget(combox_question);
- hbox_answer_lang->addWidget(combox_answer);
+// connect(combox_question,SIGNAL(currentIndexChanged(int)),this,SLOT(reactToToggleQuestion(int)));
+// connect(combox_answer,SIGNAL(currentIndexChanged(int)),this,SLOT(reactToToggleAnswer(int)));
+// combox_question->setCurrentIndex(0);
+// combox_answer->setCurrentIndex(1);
+// hbox_question_lang->addWidget(combox_question);
+// hbox_answer_lang->addWidget(combox_answer);
int lessonId = 0;
foreach(KEduVocContainer * c, lessons) {
m_lesson = lessonsList.last() ;
qDebug () << "Lesson: " << m_lesson->name();
- combox_lesson->insertItem(lessonId, m_lesson->name(), NULL);
+// combox_lesson->insertItem(lessonId, m_lesson->name(), NULL);
}
++lessonId;
}
- connect(combox_lesson,SIGNAL(currentIndexChanged(int)),this,SLOT(reactToToggleLesson(int)));
- combox_lesson->setCurrentIndex(0);
- hbox_less->addWidget(combox_lesson);
+// connect(combox_lesson,SIGNAL(currentIndexChanged(int)),this,SLOT(reactToToggleLesson(int)));
+// combox_lesson->setCurrentIndex(0);
+// hbox_less->addWidget(combox_lesson);
// vbox->addLayout(hbox_less);
// vbox->addLayout(hbox_question_lang);
slotCheck(2);
}
+void TinyVocTrainer::slotAnswer4(bool clicked){
+ Q_UNUSED(clicked);
+ slotCheck(3);
+}
+
void TinyVocTrainer::slotCheck(int buttonID){
qDebug() << "slotCheck(): buton id: " << buttonID << "Correct Id: " << CorrectID;
Q_UNUSED(clicked);
choiceList.clear();
- for (int i=0; i < 3; ++i){
+ for (int i=0; i < 4; ++i){
choiceList.append( getAnyEntryFromLesson(lessonsList.at(lessonID), questionID) );
answerButtonsList.at(i)->setText( choiceList.at(i)->translation(questionID)->text() );
}