From 99fc2d01cae7e452462e6ff2b9de603ca360169c Mon Sep 17 00:00:00 2001 From: Noel De Martin Date: Tue, 10 Oct 2023 12:36:59 +0200 Subject: [PATCH] Revert "MOBILE-4339 quiz: Add unanswered questions warning" This reverts commit 3faa55e489f9d2eea24ca1522296fe31d32beda5. --- scripts/langindex.json | 1 - src/addons/mod/quiz/lang.json | 1 - src/addons/mod/quiz/pages/player/player.ts | 29 +------------------ .../quiz/tests/behat/basic_usage-311.feature | 6 ++-- .../quiz/tests/behat/basic_usage-39.feature | 2 +- .../mod/quiz/tests/behat/basic_usage.feature | 6 ++-- .../quiz/tests/behat/quiz_navigation.feature | 4 +-- src/theme/theme.base.scss | 6 ---- 8 files changed, 10 insertions(+), 45 deletions(-) diff --git a/scripts/langindex.json b/scripts/langindex.json index 93fea518ec0..614f7c5b078 100644 --- a/scripts/langindex.json +++ b/scripts/langindex.json @@ -929,7 +929,6 @@ "addon.mod_quiz.stateoverdue": "quiz", "addon.mod_quiz.stateoverduedetails": "quiz", "addon.mod_quiz.status": "quiz", - "addon.mod_quiz.submission_confirmation_unanswered": "quiz", "addon.mod_quiz.submitallandfinish": "quiz", "addon.mod_quiz.summaryofattempt": "quiz", "addon.mod_quiz.summaryofattempts": "quiz", diff --git a/src/addons/mod/quiz/lang.json b/src/addons/mod/quiz/lang.json index dc328c5e1de..d62d1d3c0fc 100644 --- a/src/addons/mod/quiz/lang.json +++ b/src/addons/mod/quiz/lang.json @@ -68,7 +68,6 @@ "stateoverdue": "Overdue", "stateoverduedetails": "Must be submitted by {{$a}}", "status": "Status", - "submission_confirmation_unanswered": "Questions without a response: {{$a}}", "submitallandfinish": "Submit all and finish", "summaryofattempt": "Summary of attempt", "summaryofattempts": "Summary of your previous attempts", diff --git a/src/addons/mod/quiz/pages/player/player.ts b/src/addons/mod/quiz/pages/player/player.ts index 818c4440df3..0ea6316c0a5 100644 --- a/src/addons/mod/quiz/pages/player/player.ts +++ b/src/addons/mod/quiz/pages/player/player.ts @@ -406,34 +406,7 @@ export class AddonModQuizPlayerPage implements OnInit, OnDestroy, CanLeave { try { // Show confirm if the user clicked the finish button and the quiz is in progress. if (!timeUp && this.attempt.state == AddonModQuizProvider.ATTEMPT_IN_PROGRESS) { - let message = Translate.instant('addon.mod_quiz.confirmclose'); - - const unansweredCount = this.summaryQuestions - .filter(question => question.state === 'todo' || question.state === 'invalid') - .length; - - if (unansweredCount > 0) { - const warning = Translate.instant( - 'addon.mod_quiz.submission_confirmation_unanswered', - { $a: unansweredCount }, - ); - - message += ` - - - - ${ warning } - - - - `; - } - - await CoreDomUtils.showConfirm( - message, - Translate.instant('addon.mod_quiz.submitallandfinish'), - Translate.instant('core.submit'), - ); + await CoreDomUtils.showConfirm(Translate.instant('addon.mod_quiz.confirmclose')); } modal = await CoreDomUtils.showModalLoading('core.sending', true); diff --git a/src/addons/mod/quiz/tests/behat/basic_usage-311.feature b/src/addons/mod/quiz/tests/behat/basic_usage-311.feature index 27cf76e317c..5e39b28799d 100644 --- a/src/addons/mod/quiz/tests/behat/basic_usage-311.feature +++ b/src/addons/mod/quiz/tests/behat/basic_usage-311.feature @@ -125,7 +125,7 @@ Feature: Attempt a quiz in app Then I should find "Summary of attempt" in the app When I press "Submit all and finish" in the app - And I press "Submit" near "Once you submit" in the app + And I press "OK" near "Once you submit" in the app Then I should find "Review" in the app And I should find "Started on" in the app And I should find "State" in the app @@ -184,7 +184,7 @@ Feature: Attempt a quiz in app But I should not find "Not yet answered" in the app When I press "Submit all and finish" in the app - And I press "Submit" in the app + And I press "OK" in the app Then I should find "Review" in the app And I should find "Finished" in the app And I should find "Not yet graded" in the app @@ -203,7 +203,7 @@ Feature: Attempt a quiz in app And I press "False" in the app And I press "Submit" in the app And I press "Submit all and finish" in the app - And I press "Submit" in the app + And I press "OK" in the app Then I should find "Review" in the app When I replace "/.*/" within "page-addon-mod-quiz-review core-loading > ion-card ion-item:nth-child(1) p:nth-child(2)" with "[Started on date]" diff --git a/src/addons/mod/quiz/tests/behat/basic_usage-39.feature b/src/addons/mod/quiz/tests/behat/basic_usage-39.feature index d3392fd7c0c..db17d5d8034 100644 --- a/src/addons/mod/quiz/tests/behat/basic_usage-39.feature +++ b/src/addons/mod/quiz/tests/behat/basic_usage-39.feature @@ -113,7 +113,7 @@ Feature: Attempt a quiz in app And I should find "Incomplete answer" within "9" "ion-item" in the app When I press "Submit all and finish" in the app - And I press "Submit" in the app + And I press "OK" in the app Then I should find "Review" in the app And I should find "Finished" in the app And I should find "Not yet graded" in the app diff --git a/src/addons/mod/quiz/tests/behat/basic_usage.feature b/src/addons/mod/quiz/tests/behat/basic_usage.feature index a0f7f175922..ae004f67da5 100755 --- a/src/addons/mod/quiz/tests/behat/basic_usage.feature +++ b/src/addons/mod/quiz/tests/behat/basic_usage.feature @@ -122,7 +122,7 @@ Feature: Attempt a quiz in app Then I should find "Summary of attempt" in the app When I press "Submit all and finish" in the app - And I press "Submit" near "Once you submit" in the app + And I press "OK" near "Once you submit" in the app Then I should find "Review" in the app And I should find "Started on" in the app And I should find "State" in the app @@ -181,7 +181,7 @@ Feature: Attempt a quiz in app But I should not find "Not yet answered" in the app When I press "Submit all and finish" in the app - And I press "Submit" in the app + And I press "OK" in the app Then I should find "Review" in the app And I should find "Finished" in the app And I should find "Not yet graded" in the app @@ -201,7 +201,7 @@ Feature: Attempt a quiz in app And I press "False" in the app And I press "Submit" in the app And I press "Submit all and finish" in the app - And I press "Submit" in the app + And I press "OK" in the app Then I should find "Review" in the app When I replace "/.*/" within "page-addon-mod-quiz-review core-loading > ion-card ion-item:nth-child(1) p:nth-child(2)" with "[Started on date]" diff --git a/src/addons/mod/quiz/tests/behat/quiz_navigation.feature b/src/addons/mod/quiz/tests/behat/quiz_navigation.feature index 27c1af77dd7..63b0db1bfb9 100644 --- a/src/addons/mod/quiz/tests/behat/quiz_navigation.feature +++ b/src/addons/mod/quiz/tests/behat/quiz_navigation.feature @@ -81,7 +81,7 @@ Feature: Attempt a quiz in app Then I should find "Summary of attempt" in the app When I press "Submit all and finish" in the app - And I press "Submit" near "Once you submit" in the app + And I press "OK" near "Once you submit" in the app Then I should find "Review" in the app And I should find "Text of the first question" in the app And I should find "Text of the second question" in the app @@ -131,7 +131,7 @@ Feature: Attempt a quiz in app # And I should find "Not yet answered" within "3" "ion-item" in the app When I press "Submit all and finish" in the app - And I press "Submit" near "Once you submit" in the app + And I press "OK" near "Once you submit" in the app Then I should find "Review" in the app # @todo MOBILE-4350: Uncomment these. # And I should find "Text of the first question" in the app diff --git a/src/theme/theme.base.scss b/src/theme/theme.base.scss index 862bb2c7c4a..1d01e3107b7 100644 --- a/src/theme/theme.base.scss +++ b/src/theme/theme.base.scss @@ -541,12 +541,6 @@ ion-alert { .alert-message { user-select: text; flex-shrink: 0; - - ion-card { - margin: 0; - margin-top: 10px; - } - } }