MOBILE-3523 essay: Fix attachments in quiz submitted offline

main
Dani Palou 2020-11-24 14:27:32 +01:00
parent 185ed17cdb
commit bc7602abcd
1 changed files with 7 additions and 1 deletions

View File

@ -583,7 +583,13 @@ export class AddonModQuizPlayerPage implements OnInit, OnDestroy {
*/
protected processAttempt(userFinish?: boolean, timeUp?: boolean, retrying?: boolean): Promise<any> {
// 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) => {