Commit 8bf362dd by Braden MacDonald

Fix: Can't retry if max_attempts set to zero after answering while it was nonzero

parent 3d4bf295
...@@ -33,10 +33,9 @@ function MentoringAssessmentView(runtime, element, mentoring) { ...@@ -33,10 +33,9 @@ function MentoringAssessmentView(runtime, element, mentoring) {
tryAgainDOM.show(); tryAgainDOM.show();
var attempts_data = $('.attempts', element).data(); var attempts_data = $('.attempts', element).data();
if (attempts_data.num_attempts >= attempts_data.max_attempts) { if (attempts_data.max_attempts > 0 && attempts_data.num_attempts >= attempts_data.max_attempts) {
tryAgainDOM.attr("disabled", "disabled"); tryAgainDOM.attr("disabled", "disabled");
} } else {
else {
tryAgainDOM.removeAttr("disabled"); tryAgainDOM.removeAttr("disabled");
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment