Skip to content

Commit 5c3e38b

Browse files
committed
MOBILE-1600 quiz: Create attempt when askPreflight is false
1 parent 3921221 commit 5c3e38b

File tree

1 file changed

+7
-1
lines changed
  • www/addons/mod/quiz/services

1 file changed

+7
-1
lines changed

www/addons/mod/quiz/services/quiz.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2192,7 +2192,13 @@ angular.module('mm.addons.mod_quiz')
21922192
var rules = quizAccessInfo.activerulenames;
21932193
return $mmaModQuizAccessRulesDelegate.getFixedPreflightData(rules, quiz, attempt, preflightData, true, siteId)
21942194
.then(function() {
2195-
// Don't return anything.
2195+
2196+
if (!attempt) {
2197+
// We need to create a new attempt.
2198+
return self.startAttempt(quiz.id, preflightData).then(function() {
2199+
// Don't return anything.
2200+
});
2201+
}
21962202
});
21972203
}
21982204
};

0 commit comments

Comments
 (0)