MOBILE-4345 quiz: Fix sequential navigation
parent
685a941da6
commit
4a10f1a068
|
@ -531,6 +531,14 @@ export class AddonModQuizPlayerPage implements OnInit, OnDestroy, CanLeave {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @todo MOBILE-4350: This is called before getting the attempt data in sequential quizzes as a workaround for a bug
|
||||||
|
// in the LMS. Once the bug has been fixed, this should be reverted.
|
||||||
|
if (this.isSequential) {
|
||||||
|
await CoreUtils.ignoreErrors(
|
||||||
|
AddonModQuiz.logViewAttempt(this.attempt.id, page, this.preflightData, this.offline, this.quiz),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
const data = await AddonModQuiz.getAttemptData(this.attempt.id, page, this.preflightData, {
|
const data = await AddonModQuiz.getAttemptData(this.attempt.id, page, this.preflightData, {
|
||||||
cmId: this.quiz.coursemodule,
|
cmId: this.quiz.coursemodule,
|
||||||
readingStrategy: this.offline ? CoreSitesReadingStrategy.PREFER_CACHE : CoreSitesReadingStrategy.ONLY_NETWORK,
|
readingStrategy: this.offline ? CoreSitesReadingStrategy.PREFER_CACHE : CoreSitesReadingStrategy.ONLY_NETWORK,
|
||||||
|
@ -559,9 +567,12 @@ export class AddonModQuizPlayerPage implements OnInit, OnDestroy, CanLeave {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Mark the page as viewed.
|
// Mark the page as viewed.
|
||||||
|
if (!this.isSequential) {
|
||||||
|
// @todo MOBILE-4350: Undo workaround.
|
||||||
CoreUtils.ignoreErrors(
|
CoreUtils.ignoreErrors(
|
||||||
AddonModQuiz.logViewAttempt(this.attempt.id, page, this.preflightData, this.offline, this.quiz),
|
AddonModQuiz.logViewAttempt(this.attempt.id, page, this.preflightData, this.offline, this.quiz),
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// Start looking for changes.
|
// Start looking for changes.
|
||||||
this.autoSave.startCheckChangesProcess(this.quiz, this.attempt, this.preflightData, this.offline);
|
this.autoSave.startCheckChangesProcess(this.quiz, this.attempt, this.preflightData, this.offline);
|
||||||
|
|
Loading…
Reference in New Issue