2005-02-17 08:52:54 +00:00
|
|
|
<?PHP // $Id$
|
2004-05-20 17:06:19 +00:00
|
|
|
|
|
|
|
/// This page prints a particular instance of scorm
|
|
|
|
|
2005-04-01 15:53:32 +00:00
|
|
|
require_once('../../config.php');
|
|
|
|
require_once('lib.php');
|
2004-05-20 17:06:19 +00:00
|
|
|
|
|
|
|
optional_variable($id); // Course Module ID, or
|
|
|
|
optional_variable($a); // scorm ID
|
|
|
|
|
|
|
|
if ($id) {
|
2005-04-01 15:53:32 +00:00
|
|
|
if (! $cm = get_record('course_modules', 'id', $id)) {
|
|
|
|
error('Course Module ID was incorrect');
|
2004-05-20 17:06:19 +00:00
|
|
|
}
|
2005-02-17 08:52:54 +00:00
|
|
|
|
2005-04-01 15:53:32 +00:00
|
|
|
if (! $course = get_record('course', 'id', $cm->course)) {
|
|
|
|
error('Course is misconfigured');
|
2004-05-20 17:06:19 +00:00
|
|
|
}
|
2005-02-17 08:52:54 +00:00
|
|
|
|
2005-04-01 15:53:32 +00:00
|
|
|
if (! $scorm = get_record('scorm', 'id', $cm->instance)) {
|
|
|
|
error('Course module is incorrect');
|
2004-05-20 17:06:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
2005-04-01 15:53:32 +00:00
|
|
|
if (! $scorm = get_record('scorm', 'id', $a)) {
|
|
|
|
error('Course module is incorrect');
|
2004-05-20 17:06:19 +00:00
|
|
|
}
|
2005-04-01 15:53:32 +00:00
|
|
|
if (! $course = get_record('course', 'id', $scorm->course)) {
|
|
|
|
error('Course is misconfigured');
|
2004-05-20 17:06:19 +00:00
|
|
|
}
|
2005-04-01 15:53:32 +00:00
|
|
|
if (! $cm = get_coursemodule_from_instance('scorm', $scorm->id, $course->id)) {
|
|
|
|
error('Course Module ID was incorrect');
|
2004-05-20 17:06:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-02-16 10:40:48 +00:00
|
|
|
require_login($course->id, false, $cm);
|
|
|
|
|
2005-02-17 08:52:54 +00:00
|
|
|
|
2005-04-01 15:53:32 +00:00
|
|
|
$strscorms = get_string('modulenameplural', 'scorm');
|
|
|
|
$strscorm = get_string('modulename', 'scorm');
|
2005-02-17 08:52:54 +00:00
|
|
|
|
2004-05-20 17:06:19 +00:00
|
|
|
if ($course->category) {
|
|
|
|
$navigation = "<a target=\"{$CFG->framename}\" href=\"../../course/view.php?id=$course->id\">$course->shortname</a> ->
|
|
|
|
<a target=\"{$CFG->framename}\" href=\"index.php?id=$course->id\">$strscorms</a> ->";
|
|
|
|
} else {
|
|
|
|
$navigation = "<a target=\"{$CFG->framename}\" href=\"index.php?id=$course->id\">$strscorms</a> ->";
|
|
|
|
}
|
|
|
|
|
|
|
|
$pagetitle = strip_tags("$course->shortname: $scorm->name");
|
|
|
|
|
|
|
|
if (!$cm->visible and !isteacher($course->id)) {
|
2005-04-01 15:53:32 +00:00
|
|
|
print_header($pagetitle, "$course->fullname", "$navigation $scorm->name", '', '', true,
|
2004-05-20 17:06:19 +00:00
|
|
|
update_module_button($cm->id, $course->id, $strscorm), navmenu($course, $cm));
|
|
|
|
notice(get_string("activityiscurrentlyhidden"));
|
|
|
|
}
|
2005-02-17 08:52:54 +00:00
|
|
|
|
2005-02-16 10:40:48 +00:00
|
|
|
//
|
2005-02-17 08:52:54 +00:00
|
|
|
// Checkin script parameters
|
2005-02-16 10:40:48 +00:00
|
|
|
//
|
2005-02-17 08:52:54 +00:00
|
|
|
$mode = '';
|
|
|
|
$scoid='';
|
|
|
|
$currentorg='';
|
|
|
|
$modestring = '';
|
|
|
|
$scoidstring = '';
|
|
|
|
$currentorgstring = '';
|
2005-04-01 15:53:32 +00:00
|
|
|
if (!empty($_POST['mode'])) {
|
|
|
|
$mode = $_POST['mode'];
|
2005-03-01 17:52:39 +00:00
|
|
|
$modestring = '&mode='.$mode;
|
|
|
|
}
|
2005-04-01 15:53:32 +00:00
|
|
|
if (!empty($_POST['scoid'])) {
|
|
|
|
$scoid = $_POST['scoid'];
|
2005-03-01 17:52:39 +00:00
|
|
|
$scoidstring = '&scoid='.$scoid;
|
|
|
|
}
|
|
|
|
if (!empty($_POST['currentorg'])) {
|
|
|
|
$currentorg = $_POST['currentorg'];
|
|
|
|
$currentorgstring = '¤torg='.$currentorg;
|
2005-02-16 10:40:48 +00:00
|
|
|
}
|
2005-02-17 08:52:54 +00:00
|
|
|
|
2005-04-01 15:53:32 +00:00
|
|
|
$strexpand = get_string('expcoll','scorm');
|
|
|
|
|
2005-03-01 17:52:39 +00:00
|
|
|
//
|
|
|
|
// Print the page header
|
|
|
|
//
|
2005-04-01 15:53:32 +00:00
|
|
|
$bodyscripts = "onUnload='SCOFinish();'";
|
2005-03-01 17:52:39 +00:00
|
|
|
print_header($pagetitle, "$course->fullname",
|
2005-04-01 15:53:32 +00:00
|
|
|
"$navigation <a target='{$CFG->framename}' href='view.php?id=$cm->id'>$scorm->name</a>",
|
|
|
|
'', '', true, update_module_button($cm->id, $course->id, $strscorm), "", "", $bodyscripts);
|
2005-03-01 17:52:39 +00:00
|
|
|
?>
|
|
|
|
<style type="text/css">
|
|
|
|
.scormlist {
|
|
|
|
list-style-type:none;
|
|
|
|
text-indent:-4ex;
|
|
|
|
}
|
2005-04-01 15:53:32 +00:00
|
|
|
|
|
|
|
.fullscreen {
|
|
|
|
width: 100%;
|
|
|
|
vertical-align: top;
|
|
|
|
}
|
2005-03-01 17:52:39 +00:00
|
|
|
</style>
|
|
|
|
<script language="Javascript">
|
|
|
|
<!--
|
|
|
|
function playSCO(scoid) {
|
2005-04-01 15:53:32 +00:00
|
|
|
if (scoid == 0) {
|
|
|
|
document.location = 'view.php?id=<?php echo $cm->id ?>';
|
|
|
|
} else {
|
|
|
|
document.navform.scoid.value=scoid;
|
|
|
|
document.navform.submit();
|
|
|
|
}
|
2005-03-01 17:52:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function expandCollide(which,list) {
|
|
|
|
var nn=document.ids?true:false
|
|
|
|
var w3c=document.getElementById?true:false
|
|
|
|
var beg=nn?"document.ids.":w3c?"document.getElementById(":"document.all.";
|
|
|
|
var mid=w3c?").style":".style";
|
2005-02-17 08:52:54 +00:00
|
|
|
|
2005-03-01 17:52:39 +00:00
|
|
|
if (eval(beg+list+mid+".display") != "none") {
|
|
|
|
which.src = "pix/plus.gif";
|
|
|
|
eval(beg+list+mid+".display='none';");
|
|
|
|
} else {
|
|
|
|
which.src = "pix/minus.gif";
|
|
|
|
eval(beg+list+mid+".display='block';");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
-->
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<script language="JavaScript" type="text/javascript" src="request.js"></script>
|
|
|
|
<script language="JavaScript" type="text/javascript" src="api.php?id=<?php echo $cm->id ?>"></script>
|
2005-04-04 14:10:03 +00:00
|
|
|
<table class="fullscreen" height="90%">
|
2005-03-01 17:52:39 +00:00
|
|
|
<tr><td valign="top">
|
|
|
|
<p><?php echo text_to_html($scorm->summary, false, false) ?></p>
|
2005-04-01 15:53:32 +00:00
|
|
|
<p><?php echo $mode == 'browse' ? get_string('browsemode','scorm') : ' '; ?></p>
|
|
|
|
<table class='generalbox' cellpadding='5' cellspacing='0'>
|
|
|
|
<tr>
|
|
|
|
<th>
|
|
|
|
<div style='float: left;'><?php print_string('coursestruct','scorm') ?></div>
|
|
|
|
<div style='float:right;'>
|
|
|
|
<a href='#' onClick='expandCollide(imgmain,0);'>
|
|
|
|
<img id='imgmain' src="pix/minus.gif" alt="<?php echo $strexpand ?>" title="<?php echo $strexpand ?>"/>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</th>
|
|
|
|
</tr>
|
2005-04-04 14:10:03 +00:00
|
|
|
<tr><td nowrap>
|
2005-03-01 17:52:39 +00:00
|
|
|
<?php
|
2005-04-04 14:10:03 +00:00
|
|
|
$sco = scorm_display_structure($scorm,'scormlist',$currentorg,$scoid,$mode,true);
|
|
|
|
add_to_log($course->id, 'scorm', 'view', "reviewscorm.php?id=$cm->id&uid=$USER->id&scoid=$sco->id", "$scorm->id");
|
2004-05-20 17:06:19 +00:00
|
|
|
?>
|
2005-03-01 17:52:39 +00:00
|
|
|
</td></tr>
|
|
|
|
<tr><td align="center">
|
|
|
|
<form name="navform" method="post" action="playscorm.php?id=<?php echo $cm->id ?>" target="_top">
|
|
|
|
<input name="scoid" type="hidden" />
|
|
|
|
<input name="currentorg" type="hidden" value="<?php echo $currentorg ?>" />
|
|
|
|
<input name="mode" type="hidden" value="<?php echo $mode ?>" />
|
2005-04-04 14:10:03 +00:00
|
|
|
<input name="prev" type="<?php if ($sco->prev == 0) { echo 'hidden'; } else { echo 'button'; } ?>" value="<?php print_string('prev','scorm') ?>" onClick="playSCO(<?php echo $sco->prev ?>);" />
|
|
|
|
<input name="next" type="button" value="<?php if ($sco->next == 0) { print_string('exit','scorm'); } else { print_string('next','scorm'); } ?>" onClick="playSCO(<?php echo $sco->next ?>)" />
|
2005-03-01 17:52:39 +00:00
|
|
|
</form>
|
|
|
|
</td></tr>
|
|
|
|
</table>
|
|
|
|
</td>
|
2005-04-04 14:10:03 +00:00
|
|
|
<td class="fullscreen" height="90%">
|
2005-04-06 08:07:03 +00:00
|
|
|
<iframe name="main" class="fullscreen" height="640" src="loadSCO.php?id=<?php echo $cm->id.$scoidstring ?>"></iframe>
|
|
|
|
<!--<iframe name="main" class="fullscreen" height="100%" src="loadSCO.php?id=<?php echo $cm->id.$scoidstring ?>"></iframe> -->
|
2005-03-01 17:52:39 +00:00
|
|
|
</td></tr>
|
|
|
|
</table>
|
|
|
|
</body>
|
|
|
|
</html>
|