Permalink
Browse files

MDL-34231 SCORM: calculate correct number of attemptsleft when enteri…

…ng an attempt.
  • Loading branch information...
1 parent cce0da7 commit 220e5b5216af646eab6affc104e5eb7066f1d3ed @danmarsden danmarsden committed Jan 30, 2013
Showing with 2 additions and 1 deletion.
  1. +2 −1 mod/scorm/locallib.php
View
@@ -1580,7 +1580,8 @@ function scorm_format_toc_for_treeview($user, $scorm, $scoes, $usertracks, $cmid
$result->incomplete = true;
if (!$children) {
- $result->attemptleft = $scorm->maxattempt == 0 ? 1 : $scorm->maxattempt - $attempt;
+ $attemptsmade = scorm_get_attempt_count($user->id, $scorm);
+ $result->attemptleft = $scorm->maxattempt == 0 ? 1 : $scorm->maxattempt - $attemptsmade;
}
if (!$children) {

0 comments on commit 220e5b5

Please sign in to comment.