MOBILE-2567 quiz: Fix submission of overdue attempts with grace period

main
Albert Gasset 2018-09-05 15:13:20 +02:00
parent 0fbb1e2fd2
commit 35908f776f
2 changed files with 3 additions and 2 deletions

View File

@ -33,7 +33,7 @@
</ion-card>
<!-- List of user attempts. -->
<ion-card class="addon-mod_quiz-table" *ngIf="attempts && attempts.length">
<ion-card class="addon-mod_quiz-table" *ngIf="quiz && attempts && attempts.length">
<ion-card-header text-wrap>
<h2>{{ 'addon.mod_quiz.summaryofattempts' | translate }}</h2>
</ion-card-header>
@ -64,7 +64,7 @@
</ion-card>
<!-- Result info. -->
<ion-card *ngIf="showResults && (gradeResult || gradeOverridden || gradebookFeedback || (quiz.showFeedbackColumn && overallFeedback))">
<ion-card *ngIf="quiz && showResults && (gradeResult || gradeOverridden || gradebookFeedback || (quiz.showFeedbackColumn && overallFeedback))">
<ion-list>
<ion-item text-wrap *ngIf="gradeResult">{{ gradeResult }}</ion-item>
<ion-item text-wrap *ngIf="gradeOverridden">{{ 'core.course.overriddennotice' | translate }}</ion-item>

View File

@ -530,6 +530,7 @@ export class CoreQuestionHelperProvider {
prepareAnswers(questions: any[], answers: any, offline?: boolean, siteId?: string): Promise<any> {
const promises = [];
questions = questions || [];
questions.forEach((question) => {
promises.push(this.questionDelegate.prepareAnswersForQuestion(question, answers, offline, siteId));
});