mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 04:30:15 +01:00
Added popup support
This commit is contained in:
parent
bc5a6319be
commit
b5127f1e26
@ -49,6 +49,7 @@
|
||||
$userdata->mode = $mode;
|
||||
|
||||
if ($sco = get_record('scorm_scoes','id',$scoid)) {
|
||||
$userdata->course_id = $sco->identifier;
|
||||
$userdata->datafromlms = $sco->datafromlms;
|
||||
$userdata->masteryscore = $sco->masteryscore;
|
||||
$userdata->maxtimeallowed = $sco->maxtimeallowed;
|
||||
@ -89,6 +90,7 @@
|
||||
echo "[Core_Lesson]\n"."\n";
|
||||
}
|
||||
echo "[Core_Vendor]\n".$userdata->datafromlms."\n";
|
||||
echo "[Evaluation]\nCourse_ID = {".$userdata->course_id."}\n";
|
||||
} else {
|
||||
error('Sco not found');
|
||||
}
|
||||
@ -96,47 +98,78 @@
|
||||
break;
|
||||
case 'putparam':
|
||||
if ($status == 'Running') {
|
||||
print_r($_POST['aicc_data']);
|
||||
echo "error = 0\nerror_text = Successful\n";
|
||||
} else if ($status == 'Terminated') {
|
||||
echo "error = 1\nerror_text = Terminated\n";
|
||||
} else {
|
||||
echo "error = 1\nerror_text = Not Initialized\n";
|
||||
}
|
||||
break;
|
||||
case 'putcomments':
|
||||
if ($status == 'Running') {
|
||||
print_r($_POST['aicc_data']);
|
||||
echo "error = 0\nerror_text = Successful\n";
|
||||
} else if ($status == 'Terminated') {
|
||||
echo "error = 1\nerror_text = Terminated\n";
|
||||
} else {
|
||||
echo "error = 1\nerror_text = Not Initialized\n";
|
||||
}
|
||||
break;
|
||||
case 'putinteractions':
|
||||
if ($status == 'Running') {
|
||||
print_r($_POST['aicc_data']);
|
||||
echo "error = 0\nerror_text = Successful\n";
|
||||
} else if ($status == 'Terminated') {
|
||||
echo "error = 1\nerror_text = Terminated\n";
|
||||
} else {
|
||||
echo "error = 1\nerror_text = Not Initialized\n";
|
||||
}
|
||||
break;
|
||||
case 'putobjectives':
|
||||
if ($status == 'Running') {
|
||||
print_r($_POST['aicc_data']);
|
||||
echo "error = 0\nerror_text = Successful\n";
|
||||
} else if ($status == 'Terminated') {
|
||||
echo "error = 1\nerror_text = Terminated\n";
|
||||
} else {
|
||||
echo "error = 1\nerror_text = Not Initialized\n";
|
||||
}
|
||||
break;
|
||||
case 'putpath':
|
||||
if ($status == 'Running') {
|
||||
print_r($_POST['aicc_data']);
|
||||
echo "error = 0\nerror_text = Successful\n";
|
||||
} else if ($status == 'Terminated') {
|
||||
echo "error = 1\nerror_text = Terminated\n";
|
||||
} else {
|
||||
echo "error = 1\nerror_text = Not Initialized\n";
|
||||
}
|
||||
break;
|
||||
case 'putperformance':
|
||||
if ($status == 'Running') {
|
||||
print_r($_POST['aicc_data']);
|
||||
echo "error = 0\nerror_text = Successful\n";
|
||||
} else if ($status == 'Terminated') {
|
||||
echo "error = 1\nerror_text = Terminated\n";
|
||||
} else {
|
||||
echo "error = 1\nerror_text = Not Initialized\n";
|
||||
}
|
||||
break;
|
||||
case 'exitau':
|
||||
if ($status == 'Running') {
|
||||
$SESSION->scorm_status = 'Terminated';
|
||||
echo "error = 0\nerror_text = Successful\n";
|
||||
} else if ($status == 'Terminated') {
|
||||
echo "error = 1\nerror_text = Terminated\n";
|
||||
} else {
|
||||
echo "error = 1\nerror_text = Not Initialized\n";
|
||||
}
|
||||
break;
|
||||
default:
|
||||
echo "error = 1\nerror_text = Invalid Command\n";
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (empty($command)) {
|
||||
echo "error = 1\nerror_text = Invalid Command\n";
|
||||
} else {
|
||||
echo "error = 3\nerror_text = Invalid Session ID\n";
|
||||
}
|
||||
}
|
||||
?>
|
@ -178,6 +178,10 @@ function scorm_upgrade($oldversion) {
|
||||
if ($oldversion < 2005052200) {
|
||||
table_column("scorm_scoes_track", "", "timemodified", "INT", "10", "UNSIGNED", "0", "NOT NULL", "value");
|
||||
}
|
||||
|
||||
if ($oldversion < 2005062700) {
|
||||
table_column("scorm", "", "popup", "TINYINT", "1", "UNSIGNED", "0", "NOT NULL", "auto");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ CREATE TABLE prefix_scorm (
|
||||
summary text NOT NULL,
|
||||
browsemode tinyint(2) NOT NULL default '0',
|
||||
auto tinyint(1) unsigned NOT NULL default '0',
|
||||
popup tinyint(1) unsigned NOT NULL default '0',
|
||||
width int(10) unsigned NOT NULL default '800',
|
||||
height int(10) unsigned NOT NULL default '600',
|
||||
timemodified int(10) unsigned NOT NULL default '0',
|
||||
|
@ -15,6 +15,9 @@
|
||||
if (empty($form->auto)) {
|
||||
$form->auto = "";
|
||||
}
|
||||
if (empty($form->auto)) {
|
||||
$form->popup = "0";
|
||||
}
|
||||
if (empty($form->datadir)) {
|
||||
$form->datadir = "";
|
||||
}
|
||||
@ -171,15 +174,55 @@
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td colspan="2"><hr /></td></tr>
|
||||
|
||||
<tr>
|
||||
<td align="right"><b><?php print_string("advanced", "scorm") ?>:</b></td>
|
||||
<td>
|
||||
<script language="javascript" type="text/javascript">
|
||||
function showhide (id, set) {
|
||||
divobj = document.getElementById(id);
|
||||
butobj = document.getElementById(id+'button');
|
||||
prefobj = document.getElementById(id+'pref');
|
||||
if (set == true) {
|
||||
if (prefobj.value == '1') {
|
||||
divobj.style.display = 'block';
|
||||
butobj.value = '<?php print_string("hidesettings") ?>';
|
||||
} else {
|
||||
divobj.style.display = 'none';
|
||||
butobj.value = '<?php print_string("showsettings") ?>...';
|
||||
}
|
||||
} else {
|
||||
if (prefobj.value == '1') {
|
||||
divobj.style.display = 'none';
|
||||
butobj.value = '<?php print_string("showsettings") ?>...';
|
||||
prefobj.value = '0';
|
||||
} else {
|
||||
divobj.style.display = 'block';
|
||||
butobj.value = '<?php print_string("hidesettings") ?>';
|
||||
prefobj.value = '1';
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<input type="button" value="<?php print_string("hidesettings") ?>" id="advancedsettingsbutton" onclick="javascrip: return showhide('advancedsettings');" />
|
||||
<input type="hidden" name="advancedsettingspref" id="advancedsettingspref"
|
||||
value="<?php echo get_user_preferences('scorm_advancedsettingspref', $CFG->scorm_advancedsettings); ?>" />
|
||||
<?php helpbutton("advanced", get_string("advanced", "scorm"), "scorm", true) ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td colspan="2">
|
||||
<div id="advancedsettings">
|
||||
<table align="center">
|
||||
<tr>
|
||||
<td align="right"><b><?php print_string("autocontinue","scorm") ?>:</b></td>
|
||||
<td>
|
||||
<?php
|
||||
$options = array();
|
||||
$options[0]=get_string("no");
|
||||
$options[1]=get_string("yes");
|
||||
choose_from_menu ($options, "auto", $form->auto,'');
|
||||
helpbutton("autocontinue", get_string("autocontinue", "scorm"), "scorm", true);
|
||||
$options = array();
|
||||
$options[0]=get_string("no");
|
||||
$options[1]=get_string("yes");
|
||||
choose_from_menu ($options, "auto", $form->auto,'');
|
||||
helpbutton("autocontinue", get_string("autocontinue", "scorm"), "scorm", true);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
@ -195,25 +238,57 @@
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right"><b><?php print_string("popup","scorm") ?>:</b></td>
|
||||
<td>
|
||||
<?php
|
||||
$options = array();
|
||||
$options[0]=get_string("no");
|
||||
$options[1]=get_string("yes");
|
||||
choose_from_menu ($options, "popup", $form->popup,'');
|
||||
helpbutton("popupwindow", get_string("popup", "scorm"), "scorm", true);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td align="right">
|
||||
<b><?php print_string("stagesize","scorm") ?></b>
|
||||
<?php helpbutton("stagesize", get_string("stagesize", "scorm"), "scorm", true); ?>
|
||||
</td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td align="right"><b><?php print_string("width","scorm") ?>:</b></td>
|
||||
<td>
|
||||
<input type="text" name="width" value="<?php echo $form->width ?>" size="4" />
|
||||
<?php helpbutton("width", get_string("width", "scorm"), "scorm", true); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td align="right"><b><?php print_string("height","scorm") ?>:</b></td>
|
||||
<td>
|
||||
<input type="text" name="height" value="<?php echo $form->height ?>" size="4" />
|
||||
<?php helpbutton("height", get_string("height", "scorm"), "scorm", true); ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<script language="javascript" type="text/javascript">
|
||||
showhide('advancedsettings', true);
|
||||
</script>
|
||||
</td></tr>
|
||||
</table>
|
||||
<input type="hidden" name="datadir" value="<?php p($form->datadir) ?>" />
|
||||
<input type="hidden" name="pkgtype" value="<?php p($form->pkgtype) ?>" />
|
||||
<input type="hidden" name="launch" value="<?php p($form->launch) ?>" />
|
||||
|
||||
<?php
|
||||
$scorms = get_all_instances_in_course("scorm", $course);
|
||||
$coursescorm = current($scorms);
|
||||
if (($course->format == 'scorm') && ((count($scorms) == 0) || ($form->instance == $coursescorm->id))) {
|
||||
?>
|
||||
<input type="hidden" name="redirect" value="yes" />
|
||||
<input type="hidden" name="redirecturl" value="../course/view.php?id=<?php p($form->course) ?>" />
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<input type="hidden" name="course" value="<?php p($form->course) ?>" />
|
||||
<input type="hidden" name="sesskey" value="<?php p($form->sesskey) ?>" />
|
||||
<input type="hidden" name="section" value="<?php p($form->section) ?>" />
|
||||
|
@ -81,23 +81,23 @@
|
||||
//
|
||||
// Print the page header
|
||||
//
|
||||
$scripts = '';
|
||||
if ($scorm->popup = 1) {
|
||||
$scripts = 'onUnload="top.main.close();"';
|
||||
}
|
||||
|
||||
print_header($pagetitle, "$course->fullname",
|
||||
"$navigation <a target='{$CFG->framename}' href='view.php?id=$cm->id'>".format_string($scorm->name,true)."</a>",
|
||||
'', '', true, update_module_button($cm->id, $course->id, $strscorm));
|
||||
'', '', true, update_module_button($cm->id, $course->id, $strscorm), '', false, $scripts);
|
||||
?>
|
||||
|
||||
<table class="fullscreen">
|
||||
<tr><td class="top">
|
||||
<p><?php echo format_text($scorm->summary) ?></p>
|
||||
<p><?php echo $mode == 'browse' ? get_string('browsemode','scorm') : ' '; ?></p>
|
||||
<table class='generalbox' cellpadding='5' cellspacing='0'>
|
||||
<tr>
|
||||
<th>
|
||||
<div class="structurehead"><?php print_string('coursestruct','scorm') ?></div>
|
||||
<!--<div class="popupbutton">
|
||||
<a href='#' onClick='popup(main,popupimg);'><img id='popupimg' src="pix/popup.gif" alt="<?php echo $strpopup ?>" title="<?php echo $strpopup ?>"/></a>
|
||||
</div> -->
|
||||
</th>
|
||||
</tr>
|
||||
<tr><td class="top">
|
||||
@ -129,12 +129,26 @@
|
||||
</td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<?php
|
||||
if ($scorm->popup == 0) {
|
||||
?>
|
||||
<td class="top" width="<?php print $scorm->width ?>">
|
||||
<iframe name="main" width="<?php print $scorm->width ?>" height="<?php echo $scorm->height ?>" src="loadSCO.php?id=<?php echo $cm->id.$scoidstring.$modestring ?>"></iframe>
|
||||
</td></tr>
|
||||
</td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
</table>
|
||||
<script language="javascript" type="text/javascript">
|
||||
<!--
|
||||
<?php
|
||||
if ($scorm->popup == 1) {
|
||||
?>
|
||||
top.main = window.open("loadSCO.php?id=<?php echo $cm->id.$scoidstring.$modestring ?>","","width=<?php echo $scorm->width ?>,height=<?php echo $scorm->height ?>,scrollbars=1");
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
function playSCO(scoid) {
|
||||
if (scoid == 0) {
|
||||
document.location = '<?php echo $CFG->wwwroot ?>/course/view.php?id=<?php echo $cm->course ?>';
|
||||
@ -144,12 +158,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
function popup(win,image) {
|
||||
win = window.open("loadSCO.php?id=<?php echo $cm->id.$scoidstring.$modestring ?>","","width=<?php echo $scorm->width ?>,height=<?php echo $scorm->height ?>,scrollbars=1");
|
||||
image.src = "pix/popdown.gif";
|
||||
return win;
|
||||
}
|
||||
|
||||
function prevSCO() {
|
||||
playSCO(<?php echo $sco->prev ?>);
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
/// This fragment is called by moodle_needs_upgrading() and /admin/index.php
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
$module->version = 2005052200; // The (date) version of this module
|
||||
$module->version = 2005062700; // The (date) version of this module
|
||||
$module->requires = 2005021600; // The version of Moodle that is required
|
||||
$module->cron = 0; // How often should cron check this module (seconds)?
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user