diff --git a/src/apps/flashexam.cpp b/src/apps/flashexam.cpp index 0937b0d..089b87e 100644 --- a/src/apps/flashexam.cpp +++ b/src/apps/flashexam.cpp @@ -31,6 +31,7 @@ flashExam::flashExam(QWidget *parent) ui->didNotKnowBtn->setIcon(QIcon(":/resources/close.png")); ui->nextBtn->setIcon(QIcon(":/resources/check.png")); ui->nonRedundantRandomizationCheckBox->setDisabled(true); + ui->saveCardsNotKnownToFileCheckBox->setDisabled(true); ui->randomizeCheckBox->click(); ui->randomizeCheckBox->setDisabled(true); @@ -85,6 +86,7 @@ void flashExam::initCardsList(QString cardsList, QString answersList) { answersStringList = readFile(answersList).split(QRegExp("(\\r\\n)|(\\n\\r)|\\r|\\n"), QString::SkipEmptyParts); randomize = ui->randomizeCheckBox->isChecked(); nonRedundantRandomization = ui->nonRedundantRandomizationCheckBox->isChecked(); + saveCardsNotKnownToFile = ui->saveCardsNotKnownToFileCheckBox->isChecked(); cardsAlreadyShown.clear(); cardsNotKnown.clear(); ui->nonRedundantRandomizationCheckBox->setChecked(false); @@ -95,7 +97,7 @@ void flashExam::initCardsList(QString cardsList, QString answersList) { void flashExam::on_backBtn_clicked() { - if(nonRedundantRandomization) { + if(nonRedundantRandomization && cardsNotKnown.count() > 0 && saveCardsNotKnownToFile) { QString cardsNotKnownQstring; for(int i = 0; i < cardsNotKnown.count(); i++) { cardsNotKnownQstring.append(cardsStringList.at(cardsNotKnown.at(i)) + "\n"); @@ -229,3 +231,14 @@ void flashExam::on_didNotKnowBtn_clicked() on_nextBtn_clicked(); } +void flashExam::on_nonRedundantRandomizationCheckBox_toggled(bool checked) +{ + if(checked) { + ui->saveCardsNotKnownToFileCheckBox->setDisabled(false); + } + else { + ui->saveCardsNotKnownToFileCheckBox->setDisabled(true); + ui->saveCardsNotKnownToFileCheckBox->setChecked(false); + } +} + diff --git a/src/apps/flashexam.h b/src/apps/flashexam.h index c0f444c..059c9b6 100644 --- a/src/apps/flashexam.h +++ b/src/apps/flashexam.h @@ -24,6 +24,7 @@ private: QString listName; bool randomize; bool nonRedundantRandomization; + bool saveCardsNotKnownToFile; QList cardsAlreadyShown; QList cardsNotKnown; bool answerShown = false; @@ -45,6 +46,7 @@ private slots: void on_nextBtn_clicked(); void on_randomizeCheckBox_toggled(bool checked); void on_didNotKnowBtn_clicked(); + void on_nonRedundantRandomizationCheckBox_toggled(bool checked); }; #endif // FLASHEXAM_H diff --git a/src/apps/flashexam.ui b/src/apps/flashexam.ui index 9c0a541..2fd2227 100644 --- a/src/apps/flashexam.ui +++ b/src/apps/flashexam.ui @@ -35,46 +35,6 @@ - - - - QFrame::Shadow::Plain - - - 2 - - - Qt::Orientation::Horizontal - - - - - - - - U001 - - - - Randomized mode - - - - - - - - - - - true - - - - Start - - - @@ -142,7 +102,7 @@ - + QFrame::Shadow::Plain @@ -152,6 +112,19 @@ + + + + QFrame::Shadow::Plain + + + 2 + + + Qt::Orientation::Horizontal + + + @@ -164,6 +137,45 @@ + + + + + U001 + + + + Randomized mode + + + + + + + + true + + + + Start + + + + + + + + + + + U001 + + + + Save forgotten cards list to file + + +