Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-34231 SCORM: use correct calculation of attemptsleft

  • Loading branch information...
commit 8bdac11f11364d6f3594ff301fc04cd8dab4061d 1 parent 9de3aac
@danmarsden danmarsden authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 mod/scorm/locallib.php
View
5 mod/scorm/locallib.php
@@ -1322,10 +1322,11 @@ function scorm_get_toc($user,$scorm,$cmid,$toclink=TOCJSLINK,$currentorg='',$sco
//
// If not specified retrieve the last attempt number
//
+ $attemptsmade = scorm_get_attempt_count($user->id, $scorm);
if (empty($attempt)) {
- $attempt = scorm_get_attempt_count($user->id, $scorm);
+ $attempt = $attemptsmade;
}
- $result->attemptleft = $scorm->maxattempt == 0 ? 1 : $scorm->maxattempt - $attempt;
+ $result->attemptleft = $scorm->maxattempt == 0 ? 1 : $scorm->maxattempt - $attemptsmade;
if ($scoes = scorm_get_scoes($scorm->id, $currentorg)){
//
// Retrieve user tracking data for each learning object
Please sign in to comment.
Something went wrong with that request. Please try again.