From 6257f66455245c93b07c8099204f38f4971065c6 Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Thu, 16 Jun 2011 10:02:02 +1200 Subject: [PATCH 1/2] SCORM MDL-27366 add attempt status to My home --- mod/scorm/lib.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mod/scorm/lib.php b/mod/scorm/lib.php index 92a0b581735..54f88f8ab53 100644 --- a/mod/scorm/lib.php +++ b/mod/scorm/lib.php @@ -1059,7 +1059,10 @@ function scorm_print_overview($courses, &$htmlarray) { if ($scorm->timeclose) { $str .= '
'.$strduedate.': '.userdate($scorm->timeclose).'
'; } - + if ($scorm->displayattemptstatus == 1) { + require_once($CFG->dirroot.'/mod/scorm/locallib.php'); + $str .= '
'.scorm_get_attempt_status($USER, $scorm).'
'; + } $str .= ''; if (empty($htmlarray[$scorm->course]['scorm'])) { $htmlarray[$scorm->course]['scorm'] = $str; From 1a70a6470cf5337ffe2b5df2b22deddbe321fbb5 Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Thu, 16 Jun 2011 10:22:19 +1200 Subject: [PATCH 2/2] SCORM MDL-27366 - show content if attemptstatus is set even if closed. --- mod/scorm/lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/scorm/lib.php b/mod/scorm/lib.php index 54f88f8ab53..bbddc92e088 100644 --- a/mod/scorm/lib.php +++ b/mod/scorm/lib.php @@ -1036,7 +1036,7 @@ function scorm_print_overview($courses, &$htmlarray) { if ($scorm->timeopen) { $isopen = ($scorm->timeopen <= $time && $time <= $scorm->timeclose); } - if (empty($isopen) || empty($scorm->timeclose)) { + if (empty($scorm->displayattemptstatus) && (empty($isopen) || empty($scorm->timeclose))) { unset($scorms[$key]); }else{ $scormids[] = $scorm->id;