Fix Lesson 8 Task 1

This commit is contained in:
Stanislav Mykhailenko 2024-08-02 22:51:17 +03:00
parent b78ea4318e
commit 27d99acbcb
GPG key ID: 1E95E66A9C9D6A36
2 changed files with 10 additions and 2 deletions

View file

@ -32,13 +32,21 @@ void LlmMathQuiz::submit()
ui->l_match->setText("False"); ui->l_match->setText("False");
ui->b_generate->setEnabled(true); ui->b_generate->setEnabled(true);
if (ui->l_number->text().toInt() == 10)
ui->l_score->setText("Final score:");
} }
void LlmMathQuiz::generate() void LlmMathQuiz::generate()
{ {
if (m_taskReceived) { if (m_taskReceived) {
ui->l_number->setText(QString::number(ui->l_number->text().toInt() + 1));
m_taskReceived = false; 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; m_taskReceived = false;
ui->b_generate->setEnabled(false); ui->b_generate->setEnabled(false);

View file

@ -128,7 +128,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_6"> <layout class="QHBoxLayout" name="horizontalLayout_6">
<item> <item>
<widget class="QLabel" name="label_5"> <widget class="QLabel" name="l_score">
<property name="text"> <property name="text">
<string>Answers matched:</string> <string>Answers matched:</string>
</property> </property>