MOBILE-4339 quiz: Add unanswered questions warning
parent
c6714285b0
commit
3faa55e489
|
@ -919,6 +919,7 @@
|
|||
"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",
|
||||
|
|
|
@ -68,6 +68,7 @@
|
|||
"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",
|
||||
|
|
|
@ -406,7 +406,34 @@ 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) {
|
||||
await CoreDomUtils.showConfirm(Translate.instant('addon.mod_quiz.confirmclose'));
|
||||
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 += `
|
||||
<ion-card class="core-warning-card">
|
||||
<ion-item>
|
||||
<ion-label>
|
||||
${ warning }
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
</ion-card>
|
||||
`;
|
||||
}
|
||||
|
||||
await CoreDomUtils.showConfirm(
|
||||
message,
|
||||
Translate.instant('addon.mod_quiz.submitallandfinish'),
|
||||
Translate.instant('core.submit'),
|
||||
);
|
||||
}
|
||||
|
||||
modal = await CoreDomUtils.showModalLoading('core.sending', true);
|
||||
|
|
|
@ -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 "OK" near "Once you submit" in the app
|
||||
And I press "Submit" 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 "OK" in the app
|
||||
And I press "Submit" 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 "OK" in the app
|
||||
And I press "Submit" 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]"
|
||||
|
|
|
@ -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 "OK" in the app
|
||||
And I press "Submit" 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
|
||||
|
|
|
@ -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 "OK" near "Once you submit" in the app
|
||||
And I press "Submit" 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 "OK" in the app
|
||||
And I press "Submit" 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 "OK" in the app
|
||||
And I press "Submit" 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]"
|
||||
|
|
|
@ -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 "OK" near "Once you submit" in the app
|
||||
And I press "Submit" 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 "OK" near "Once you submit" in the app
|
||||
And I press "Submit" 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
|
||||
|
|
|
@ -516,6 +516,12 @@ ion-alert {
|
|||
.alert-message {
|
||||
user-select: text;
|
||||
flex-shrink: 0;
|
||||
|
||||
ion-card {
|
||||
margin: 0;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue