From ed98c4e98e65a973615660247d3f4cc0cfd1bbdb Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Wed, 11 Aug 2010 23:57:03 +0000 Subject: [PATCH] SCORM MDL-23776 check for attempts that have passed as well as completed status --- mod/scorm/locallib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/scorm/locallib.php b/mod/scorm/locallib.php index 4b3c18c8dfc..d31f3577684 100755 --- a/mod/scorm/locallib.php +++ b/mod/scorm/locallib.php @@ -642,7 +642,7 @@ function scorm_get_last_completed_attempt($scormid, $userid) { global $DB; /// Find the last attempt number for the given user id and scorm id - if ($lastattempt = $DB->get_record('scorm_scoes_track', array('userid'=>$userid, 'scormid'=>$scormid, 'value'=> 'completed'), 'max(attempt) as a')) { + if ($lastattempt = $DB->get_record_select('scorm_scoes_track', "userid = ? AND scormid = ? AND (value='completed' OR value='passed')", array($userid, $scormid), 'max(attempt) as a')) { if (empty($lastattempt->a)) { return '1'; } else {