A popup window display mode. DONE
New Moodle course format: SCORM. DONE
Add prerequisites support to SCORM 1.2. DONE
-Customizable player page. DONE
-Multiple attempt management.
+Customizable player page. DONE
+Multiple attempt management. DONE
Complete AICC conformance.
}
}
-function scorm_count_launchable($scormid,$organization) {
- return count_records_select('scorm_scoes',"scorm=$scormid AND organization='$organization' AND launch<>''");
+function scorm_count_launchable($scormid,$organization='') {
+ $strorganization = '';
+ if (!empty($organization)) {
+ $strorganization = " AND organization='$organization'";
+ }
+ return count_records_select('scorm_scoes',"scorm=$scormid$strorganization AND launch<>''");
}
function scorm_get_last_attempt($scormid, $userid) {
<?php
}
+function scorm_simple_play($scorm,$user) {
+ $result = false;
+ $scoes = get_records_select('scorm_scoes','scorm='.$scorm->id.' AND launch<>""');
+ if (count($scoes) == 1) {
+ if ($scorm->skipview >= 1) {
+ $sco = current($scoes);
+ if (scorm_get_tracks($sco->id,$user->id) === false) {
+ header('Location: player.php?a='.$scorm->id.'&scoid='.$sco->id);
+ $result = true;
+ } else if ($scorm->skipview == 2) {
+ header('Location: player.php?a='.$scorm->id.'&scoid='.$sco->id);
+ $result = true;
+ }
+ }
+ }
+ return $result;
+}
+
function scorm_parse($scorm) {
global $CFG,$repositoryconfigfile;
if (!isset($form->launch)) {
$form->launch = '';
}
+ if (!isset($form->skipview)) {
+ $form->skipview = 1;
+ }
if (!isset($form->auto)) {
$form->auto = '';
}
<td colspan="2">
<div id="advancedsettings">
<table align="center">
+ <tr>
+ <td align="right"><b><?php print_string('skipview','scorm') ?>:</b></td>
+ <td>
+ <?php
+ $options = array();
+ $options[0]=get_string('never');
+ $options[1]=get_string('firstaccess','scorm');
+ $options[2]=get_string('always');
+ choose_from_menu ($options, 'skipview', (int) $form->skipview,'');
+ helpbutton('skipview', get_string('skipview','scorm'), 'scorm', true);
+ ?>
+ </td>
+ </tr>
<tr>
<td align="right"><b><?php print_string('autocontinue','scorm') ?>:</b></td>
<td>
?>
</td>
</tr>
+<!--
+ <tr>
+ <td align="right"><b><?php print_string('hidereview','scorm') ?>:</b></td>
+ <td>
+ <?php
+ $options = array();
+ $options[0]=get_string('no');
+ $options[1]=get_string('yes');
+ choose_from_menu ($options, 'hidereview', (int) $form->hidereview, '');
+ helpbutton('reviewmode', get_string('hidereview','scorm'), 'scorm', true);
+ ?>
+ </td>
+ </tr>
+-->
<tr>
<td align="right"><b><?php print_string('hidebrowse','scorm') ?>:</b></td>
<td>
?>
</td>
</tr>
+<!--
+ <tr>
+ <td align="right"><b><?php print_string('hideexit','scorm') ?>:</b></td>
+ <td>
+ <?php
+ $options = array();
+ $options[0]=get_string('no');
+ $options[1]=get_string('yes');
+ choose_from_menu ($options, 'hideexit', (int) $form->hideexit, '');
+ ?>
+ </td>
+ </tr>
+-->
</table>
</div>
</td>
/// This fragment is called by moodle_needs_upgrading() and /admin/index.php
/////////////////////////////////////////////////////////////////////////////////
-$module->version = 2006091201; // The (date) version of this module
+$module->version = 2006102601; // The (date) version of this module
$module->requires = 2006080900; // The version of Moodle that is required
$module->cron = 0; // How often should cron check this module (seconds)?
add_to_log($course->id, 'scorm', 'pre-view', 'view.php?id='.$cm->id, "$scorm->id");
+ if ((has_capability('mod/scorm:skipview', get_context_instance(CONTEXT_MODULE,$cm->id))) && scorm_simple_play($scorm,$USER)) {
+ exit;
+ }
+
//
// Print the page header
//