From 481e8f710578919293e1ae573d68baaad0189ff9 Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Mon, 28 Jan 2013 21:17:43 +1300 Subject: [PATCH] MDL-34231 SCORM: Lock after final attempt when using skip content structure or direct navigation to player.php --- mod/scorm/player.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mod/scorm/player.php b/mod/scorm/player.php index 6a7dda3749c..90dc15992f4 100644 --- a/mod/scorm/player.php +++ b/mod/scorm/player.php @@ -135,6 +135,12 @@ $attemptstr = '&attempt=' . $attempt; $result = scorm_get_toc($USER, $scorm, $cm->id, TOCJSLINK, $currentorg, $scoid, $mode, $attempt, true, true); $sco = $result->sco; +if ($scorm->lastattemptlock == 1 && $result->attemptleft == 0) { + echo $OUTPUT->header(); + echo $OUTPUT->notification(get_string('exceededmaxattempts', 'scorm')); + echo $OUTPUT->footer(); + exit; +} if (($mode == 'browse') && ($scorm->hidebrowse == 1)) { $mode = 'normal';