From 0dd957ed3d3a5a6bc8d5ed1eb625faa3a134ca4b Mon Sep 17 00:00:00 2001 From: bobopinna Date: Mon, 27 Jun 2005 07:28:19 +0000 Subject: [PATCH] New course format SCORM --- course/format/scorm/config.php | 12 +++ course/format/scorm/format.php | 173 +++++++++++++++++++++++++++++++++ 2 files changed, 185 insertions(+) create mode 100755 course/format/scorm/config.php create mode 100644 course/format/scorm/format.php diff --git a/course/format/scorm/config.php b/course/format/scorm/config.php new file mode 100755 index 00000000000..289ef677f62 --- /dev/null +++ b/course/format/scorm/config.php @@ -0,0 +1,12 @@ + diff --git a/course/format/scorm/format.php b/course/format/scorm/format.php new file mode 100644 index 00000000000..fae864ef48b --- /dev/null +++ b/course/format/scorm/format.php @@ -0,0 +1,173 @@ +dirroot/mod/forum/lib.php"); + + require_once($CFG->dirroot.'/mod/scorm/lib.php'); + echo ''; + + // Bounds for block widths + define('BLOCK_L_MIN_WIDTH', 100); + define('BLOCK_L_MAX_WIDTH', 210); + define('BLOCK_R_MIN_WIDTH', 100); + define('BLOCK_R_MAX_WIDTH', 210); + + optional_variable($preferred_width_left, blocks_preferred_width($pageblocks[BLOCK_POS_LEFT])); + optional_variable($preferred_width_right, blocks_preferred_width($pageblocks[BLOCK_POS_RIGHT])); + $preferred_width_left = min($preferred_width_left, BLOCK_L_MAX_WIDTH); + $preferred_width_left = max($preferred_width_left, BLOCK_L_MIN_WIDTH); + $preferred_width_right = min($preferred_width_right, BLOCK_R_MAX_WIDTH); + $preferred_width_right = max($preferred_width_right, BLOCK_R_MIN_WIDTH); + + $strgroups = get_string('groups'); + $strgroupmy = get_string('groupmy'); + $strupdate = get_string('update'); + $strscorm = get_string('modulename','scorm'); + $editing = $PAGE->user_is_editing(); + + echo ''; + echo ''; + + if (blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $editing) { + echo ''; + } + + echo ''; + + // The right column + if (blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $editing) { + echo ''; + } + + echo ''; + echo '
'; + blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT); + echo ''; + if ($scorms = get_all_instances_in_course("scorm", $course)) { + // The SCORM with the least id is the course SCORM + $scorm = current($scorms); + if (! $cm = get_coursemodule_from_instance('scorm', $scorm->id, $course->id)) { + error("Course Module ID was incorrect"); + } + + $headertext = '
'.get_string('scormcourse','scorm').': '.$scorm->name.''; + if (isteacher($course->id) || isadmin()) { + $reportlink = ''; + $trackedusers = get_record('scorm_scoes_track', 'scormid', $scorm->id, '', '', '', '', 'count(distinct(userid)) as c'); + if ($trackedusers->c > 0) { + $reportlink = ''; + } else { + $reportlink = ''; + } + if (isediting($course->id)) { + // Display update scorm icon + $path = $CFG->wwwroot.'/course'; + $headertext .= ''. + ''. + ''.$strupdate.''; + } + // Display report link + $headertext .= '
'.$reportlink; + } else { + $headertext .= ''; + } + $headertext .= '
'.$scorm->summary.'
'; + print_simple_box($headertext,'','100%'); +?> + +
+ launch; + if ($orgs = get_records_select_menu('scorm_scoes',"scorm='$scorm->id' AND organization='' AND launch=''",'id','id,title')) { + if (count($orgs) > 1) { + if (isset($_POST['organization'])) { + $organization = $_POST['organization']; + } + ?> +
+ +
+ +
+
+ organization == '') && ($org->launch == '')) { + $orgidentifier = $org->identifier; + } else { + $orgidentifier = $org->organization; + } + } + ?> + + +
+
+ browsemode == 1) { + print_string("mode","scorm"); + echo ': '."\n"; + if ($incomplete === true) { + echo '\n"; + } else { + echo '\n"; + } + } else { + if ($incomplete === true) { + echo ''."\n"; + } else { + echo ''."\n"; + } + } + ?> +
+ + + +
+
+ +id)) { + // Create a new scorm activity + redirect('mod.php?id='.$course->id.'&section=0&sesskey='.sesskey().'&add=scorm'); + } else { + notify('Could not find a SCORM course here'); + } + } + echo '
'; + blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT); + echo '
'; + +?>