MOBILE-2817 lesson: Remove continue button if not needed

main
Dani Palou 2019-04-18 12:47:01 +02:00
parent 265f4a40f4
commit 3ec25faf65
1 changed files with 9 additions and 4 deletions

View File

@ -570,10 +570,15 @@ export class AddonModLessonPlayerPage implements OnInit, OnDestroy {
// Button to continue.
if (this.lesson.review && !result.correctanswer && !result.noanswer && !result.isessayquestion &&
!result.maxattemptsreached) {
this.processData.buttons.push({
label: 'addon.mod_lesson.reviewquestioncontinue',
pageId: result.newpageid
});
/* If both the "Yes, I'd like to try again" and "No, I just want to go on to the next question" point to the
same page then don't show the "No, I just want to go on to the next question" button. It's confusing. */
if (this.pageData.page.id != result.newpageid) {
// Button to continue the lesson (the page to go is configured by the teacher).
this.processData.buttons.push({
label: 'addon.mod_lesson.reviewquestioncontinue',
pageId: result.newpageid
});
}
} else {
this.processData.buttons.push({
label: 'addon.mod_lesson.continue',