Permalink
Browse files

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

…ng an attempt.
  • Loading branch information...
1 parent 481e8f7 commit 54bc823b80efa23059aaf9739ba099e23e867bb5 @danmarsden danmarsden committed Jan 30, 2013
Showing with 2 additions and 1 deletion.
  1. +2 −1 mod/scorm/locallib.php
View
3 mod/scorm/locallib.php
@@ -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 54bc823

Please sign in to comment.