From 27d99acbcbdcaa00c12ee762e6db785c61c13809 Mon Sep 17 00:00:00 2001 From: Stanislav Mykhailenko Date: Fri, 2 Aug 2024 22:51:17 +0300 Subject: [PATCH] Fix Lesson 8 Task 1 --- Lesson_8/Task_1/llmmathquiz.cpp | 10 +++++++++- Lesson_8/Task_1/llmmathquiz.ui | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Lesson_8/Task_1/llmmathquiz.cpp b/Lesson_8/Task_1/llmmathquiz.cpp index 49fa3b1..06f47a3 100644 --- a/Lesson_8/Task_1/llmmathquiz.cpp +++ b/Lesson_8/Task_1/llmmathquiz.cpp @@ -32,13 +32,21 @@ void LlmMathQuiz::submit() ui->l_match->setText("False"); ui->b_generate->setEnabled(true); + + if (ui->l_number->text().toInt() == 10) + ui->l_score->setText("Final score:"); } void LlmMathQuiz::generate() { if (m_taskReceived) { - ui->l_number->setText(QString::number(ui->l_number->text().toInt() + 1)); m_taskReceived = false; + if (ui->l_number->text().toInt() == 10) { + ui->l_number->setText(QString::number(0)); + ui->l_matched->setText(QString::number(0)); + ui->l_score->setText("Answers matched:"); + } else + ui->l_number->setText(QString::number(ui->l_number->text().toInt() + 1)); } m_taskReceived = false; ui->b_generate->setEnabled(false); diff --git a/Lesson_8/Task_1/llmmathquiz.ui b/Lesson_8/Task_1/llmmathquiz.ui index b63b715..0cac454 100644 --- a/Lesson_8/Task_1/llmmathquiz.ui +++ b/Lesson_8/Task_1/llmmathquiz.ui @@ -128,7 +128,7 @@ - + Answers matched: