From bc7602abcde724284b1b8a4b98e5a9866923195e Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Tue, 24 Nov 2020 14:27:32 +0100 Subject: [PATCH] MOBILE-3523 essay: Fix attachments in quiz submitted offline --- src/addon/mod/quiz/pages/player/player.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/addon/mod/quiz/pages/player/player.ts b/src/addon/mod/quiz/pages/player/player.ts index 0ccbb17cf..fe33b00d9 100644 --- a/src/addon/mod/quiz/pages/player/player.ts +++ b/src/addon/mod/quiz/pages/player/player.ts @@ -583,7 +583,13 @@ export class AddonModQuizPlayerPage implements OnInit, OnDestroy { */ protected processAttempt(userFinish?: boolean, timeUp?: boolean, retrying?: boolean): Promise { // Get the answers to send. - return this.prepareAnswers().then((answers) => { + let promise = Promise.resolve({}); + + if (!this.showSummary) { + promise = this.prepareAnswers(); + } + + return promise.then((answers) => { // Send the answers. return this.quizProvider.processAttempt(this.quiz, this.attempt, answers, this.preflightData, userFinish, timeUp, this.offline).catch((error) => {