From 8bdac11f11364d6f3594ff301fc04cd8dab4061d Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Thu, 31 Jan 2013 11:12:43 +1300 Subject: [PATCH] MDL-34231 SCORM: use correct calculation of attemptsleft --- mod/scorm/locallib.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mod/scorm/locallib.php b/mod/scorm/locallib.php index 182de2453ce..c45ed5b8c23 100644 --- a/mod/scorm/locallib.php +++ b/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 -- 2.43.0