mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 17:06:53 +02:00
New user inteface
This commit is contained in:
parent
3320057725
commit
b7ddb4a618
1 changed files with 163 additions and 222 deletions
|
@ -65,239 +65,180 @@
|
||||||
$modestring = '';
|
$modestring = '';
|
||||||
$scoidstring = '';
|
$scoidstring = '';
|
||||||
$currentorgstring = '';
|
$currentorgstring = '';
|
||||||
if (($scorm->popup == "") && ($frameset == "top")) {
|
if (!empty($_POST["mode"])) {
|
||||||
if (!empty($_GET["mode"])) {
|
$mode = $_POST["mode"];
|
||||||
$mode = $_GET["mode"];
|
$modestring = '&mode='.$mode;
|
||||||
$modestring = '&mode='.$mode;
|
}
|
||||||
}
|
if (!empty($_POST["scoid"])) {
|
||||||
if (!empty($_GET["scoid"])) {
|
$scoid = $_POST["scoid"];
|
||||||
$scoid = $_GET["scoid"];
|
$scoidstring = '&scoid='.$scoid;
|
||||||
$scoidstring = '&scoid='.$scoid;
|
}
|
||||||
}
|
if (!empty($_POST['currentorg'])) {
|
||||||
if (!empty($_GET['currentorg'])) {
|
$currentorg = $_POST['currentorg'];
|
||||||
$currentorg = $_GET['currentorg'];
|
$currentorgstring = '¤torg='.$currentorg;
|
||||||
$currentorgstring = '¤torg='.$currentorg;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (!empty($_POST["mode"])) {
|
|
||||||
$mode = $_POST["mode"];
|
|
||||||
$modestring = '&mode='.$mode;
|
|
||||||
}
|
|
||||||
if (!empty($_POST["scoid"])) {
|
|
||||||
$scoid = $_POST["scoid"];
|
|
||||||
$scoidstring = '&scoid='.$scoid;
|
|
||||||
}
|
|
||||||
if (!empty($_POST['currentorg'])) {
|
|
||||||
$currentorg = $_POST['currentorg'];
|
|
||||||
$currentorgstring = '¤torg='.$currentorg;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($frameset == "top") || ($scorm->popup != "")) {
|
add_to_log($course->id, "scorm", "view", "playscorm.php?id=$cm->id", "$scorm->id");
|
||||||
add_to_log($course->id, "scorm", "view", "playscorm.php?id=$cm->id", "$scorm->id");
|
//
|
||||||
//
|
// Print the page header
|
||||||
// Print the page header
|
//
|
||||||
//
|
$bodyscripts = "onUnload='SCOFinish(); closeMain();'";
|
||||||
$bodyscripts = "";
|
print_header($pagetitle, "$course->fullname",
|
||||||
if ($scorm->popup != "") {
|
"$navigation <a target=\"{$CFG->framename}\" href=\"view.php?id=$cm->id\">$scorm->name</a>",
|
||||||
$bodyscripts = "onUnload='SCOFinish(); closeMain();' ";
|
"", "", true, update_module_button($cm->id, $course->id, $strscorm), "", "", $bodyscripts);
|
||||||
}
|
?>
|
||||||
print_header($pagetitle, "$course->fullname",
|
<style type="text/css">
|
||||||
"$navigation <a target=\"{$CFG->framename}\" href=\"view.php?id=$cm->id\">$scorm->name</a>",
|
.scormlist {
|
||||||
"", "", true, update_module_button($cm->id, $course->id, $strscorm), "", "", $bodyscripts);
|
list-style-type:none;
|
||||||
echo "<table width=\"100%\">\n <tr><td align=\"center\">".text_to_html($scorm->summary, true, false)."</td>\n";
|
text-indent:-4ex;
|
||||||
if ($mode == "browse")
|
}
|
||||||
echo "<td align=\"right\" width=\"10%\" nowrap>".get_string("browsemode","scorm")."</td>\n";
|
</style>
|
||||||
echo " </tr>\n</table>\n";
|
<script language="Javascript">
|
||||||
|
<!--
|
||||||
|
function playSCO(scoid) {
|
||||||
|
document.navform.scoid.value=scoid;
|
||||||
|
document.navform.submit();
|
||||||
|
}
|
||||||
|
|
||||||
|
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";
|
||||||
|
|
||||||
if ($scorm->popup != "") {
|
if (eval(beg+list+mid+".display") != "none") {
|
||||||
echo "<script language=\"JavaScript\" type=\"text/javascript\" src=\"request.js\"></script>\n";
|
which.src = "pix/plus.gif";
|
||||||
echo "<script language=\"JavaScript\" type=\"text/javascript\" src=\"api.php?id=$cm->id\"></script>\n";
|
eval(beg+list+mid+".display='none';");
|
||||||
?>
|
} else {
|
||||||
<br />
|
which.src = "pix/minus.gif";
|
||||||
<script language="Javascript">
|
eval(beg+list+mid+".display='block';");
|
||||||
<!--
|
}
|
||||||
function playSCO(scoid) {
|
|
||||||
document.navform.scoid.value=scoid;
|
|
||||||
document.navform.submit();
|
|
||||||
}
|
|
||||||
|
|
||||||
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";
|
|
||||||
|
|
||||||
if (eval(beg+list+mid+".display") != "none") {
|
}
|
||||||
which.src = "pix/plus.gif";
|
-->
|
||||||
eval(beg+list+mid+".display='none';");
|
</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>
|
||||||
|
<table width="100%">
|
||||||
|
<tr><td valign="top">
|
||||||
|
<p><?php echo text_to_html($scorm->summary, false, false) ?></p>
|
||||||
|
<p><?php echo $mode == "browse" ? get_string("browsemode","scorm") : ' '; ?></p>
|
||||||
|
<?php print_simple_box_start(); ?>
|
||||||
|
<table>
|
||||||
|
<tr><th><?php print_string("coursestruct","scorm") ?></th></tr>
|
||||||
|
<tr><td nowrap>
|
||||||
|
<ul class="scormlist">
|
||||||
|
<?php
|
||||||
|
$incomplete = false;
|
||||||
|
if ($scoes = get_records_select("scorm_scoes","scorm='$scorm->id' AND organization='$currentorg' order by id ASC")){
|
||||||
|
$level=0;
|
||||||
|
$sublist=0;
|
||||||
|
$parents[$level]="/";
|
||||||
|
foreach ($scoes as $sco) {
|
||||||
|
if ($parents[$level]!=$sco->parent) {
|
||||||
|
if ($level>0 && $parents[$level-1]==$sco->parent) {
|
||||||
|
echo "\t\t</ul></li>\n";
|
||||||
|
$level--;
|
||||||
|
} else {
|
||||||
|
$i = $level;
|
||||||
|
$closelist = "";
|
||||||
|
while (($i > 0) && ($parents[$level] != $sco->parent)) {
|
||||||
|
$closelist .= "\t\t</ul></li>\n";
|
||||||
|
$i--;
|
||||||
|
}
|
||||||
|
if (($i == 0) && ($sco->parent != $currentorg)) {
|
||||||
|
echo "\t\t<li><ul id='".$sublist."' class=\"scormlist\"'>\n";
|
||||||
|
$level++;
|
||||||
} else {
|
} else {
|
||||||
which.src = "pix/minus.gif";
|
echo $closelist;
|
||||||
eval(beg+list+mid+".display='block';");
|
$level = $i;
|
||||||
}
|
}
|
||||||
|
$parents[$level]=$sco->parent;
|
||||||
}
|
}
|
||||||
-->
|
}
|
||||||
</script>
|
echo "\t\t<li>";
|
||||||
<style type="text/css">
|
$nextsco = next($scoes);
|
||||||
.scormlist { list-style-type:none; }
|
if (($nextsco !== false) && ($sco->parent != $nextsco->parent) && (($level==0) || (($level>0) && ($nextsco->parent == $sco->identifier)))) {
|
||||||
</style>
|
$sublist++;
|
||||||
<?php
|
echo "<img id='img".$sublist."' src=\"pix/minus.gif\" onClick='expandCollide(this,".$sublist.");'/>";
|
||||||
print_simple_box_start("CENTER");
|
} else {
|
||||||
echo "<table>\n";
|
echo "<img src=\"pix/spacer.gif\" />";
|
||||||
echo " <tr><th>".get_string("coursestruct","scorm")."</th></tr>\n";
|
}
|
||||||
echo " <tr><td nowrap>\n<ul class=\"scormlist\">\n";
|
|
||||||
$incomplete = false;
|
|
||||||
if ($scoes = get_records_select("scorm_scoes","scorm='$scorm->id' AND organization='$currentorg' order by id ASC")){
|
|
||||||
$level=0;
|
|
||||||
$sublist=0;
|
|
||||||
$parents[$level]="/";
|
|
||||||
foreach ($scoes as $sco) {
|
|
||||||
if ($parents[$level]!=$sco->parent) {
|
|
||||||
if ($level>0 && $parents[$level-1]==$sco->parent) {
|
|
||||||
echo " </ul></li>\n";
|
|
||||||
$level--;
|
|
||||||
} else {
|
|
||||||
$i = $level;
|
|
||||||
$closelist = "";
|
|
||||||
while (($i > 0) && ($parents[$level] != $sco->parent)) {
|
|
||||||
$closelist .= " </ul></li>\n";
|
|
||||||
$i--;
|
|
||||||
}
|
|
||||||
if (($i == 0) && ($sco->parent != $currentorg)) {
|
|
||||||
echo " <li><ul id='".$sublist."' class=\"scormlist\"'>\n";
|
|
||||||
$level++;
|
|
||||||
} else {
|
|
||||||
echo $closelist;
|
|
||||||
$level = $i;
|
|
||||||
}
|
|
||||||
$parents[$level]=$sco->parent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
echo " <li>\n";
|
|
||||||
$nextsco = next($scoes);
|
|
||||||
if (($nextsco !== false) && ($sco->parent != $nextsco->parent) && (($level==0) || (($level>0) && ($nextsco->parent == $sco->identifier)))) {
|
|
||||||
$sublist++;
|
|
||||||
echo " <img src=\"pix/minus.gif\" onClick='expandCollide(this,".$sublist.");'/>\n";
|
|
||||||
} else {
|
|
||||||
echo " <img src=\"pix/spacer.gif\" />\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($sco->launch) {
|
|
||||||
$startbold = '';
|
|
||||||
$endbold = '';
|
|
||||||
if ($sco->id == $scoid) {
|
|
||||||
$startbold = '-> <b>';
|
|
||||||
$endbold = '</b> <-';
|
|
||||||
}
|
|
||||||
if (($scoid == "") && ($mode != "normal")) {
|
|
||||||
$scoid = $sco->id;
|
|
||||||
$startbold = '-> <b>';
|
|
||||||
$endbold = '</b> <-';
|
|
||||||
}
|
|
||||||
$score = "";
|
|
||||||
if ($sco_user=get_record("scorm_sco_users","scoid",$sco->id,"userid",$USER->id)) {
|
|
||||||
if ( $sco_user->cmi_core_lesson_status == "") {
|
|
||||||
$sco_user->cmi_core_lesson_status = "not attempted";
|
|
||||||
}
|
|
||||||
echo " <img src=\"pix/".scorm_remove_spaces($sco_user->cmi_core_lesson_status).".gif\" alt=\"".get_string(scorm_remove_spaces($sco_user->cmi_core_lesson_status),"scorm")."\" title=\"".get_string(scorm_remove_spaces($sco_user->cmi_core_lesson_status),"scorm")."\" />\n";
|
|
||||||
if (($sco_user->cmi_core_lesson_status == "not attempted") || ($sco_user->cmi_core_lesson_status == "incomplete")) {
|
|
||||||
if ($scoid == "") {
|
|
||||||
$incomplete = true;
|
|
||||||
$scoid = $sco->id;
|
|
||||||
$startbold = '-> <b>';
|
|
||||||
$endbold = '</b> <-';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($sco_user->cmi_core_score_raw > 0) {
|
|
||||||
$score = "(".get_string("score","scorm").": ".$sco_user->cmi_core_score_raw.")";
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if ($sco->type == 'sco') {
|
|
||||||
echo " <img src=\"pix/notattempted.gif\" alt=\"".get_string("notattempted","scorm")."\" />";
|
|
||||||
$incomplete = true;
|
|
||||||
} else {
|
|
||||||
echo " <img src=\"pix/asset.gif\" alt=\"".get_string("asset","scorm")."\" />";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
echo " $startbold<a href=\"javascript:playSCO(".$sco->id.");\">$sco->title</a> $score$endbold\n </li>\n";
|
|
||||||
} else {
|
|
||||||
echo " $sco->title\n </li>\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for ($i=0;$i<$level;$i++){
|
|
||||||
echo " </ul></li>\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
echo "</ul></td></tr>\n";
|
|
||||||
echo "</table>\n";
|
|
||||||
print_simple_box_end();
|
|
||||||
|
|
||||||
}
|
if ($sco->launch) {
|
||||||
|
$startbold = '';
|
||||||
echo "<table width=\"100%\">\n <tr>\n";
|
$endbold = '';
|
||||||
echo " <td align=\"center\" nowrap>
|
if ($sco->id == $scoid) {
|
||||||
<!--<iframe name=\"cmi\" width=\"1\" height=\"1\" src=\"cmi.php?id=$cm->id\" style=\"visibility: hidden\"></iframe> -->
|
$startbold = '-> <b>';
|
||||||
<form name=\"navform\" method=\"POST\" action=\"playscorm.php?id=$cm->id\" target=\"_top\">
|
$endbold = '</b> <-';
|
||||||
<input name=\"scoid\" type=\"hidden\" />
|
}
|
||||||
<input name=\"currentorg\" type=\"hidden\" value=\"$currentorg\" />
|
if (($scoid == "") && ($mode != "normal")) {
|
||||||
<input name=\"mode\" type=\"hidden\" value=\"".$mode."\" />
|
$scoid = $sco->id;
|
||||||
<input name=\"prev\" type=\"button\" value=\"".get_string("prev","scorm")."\" onClick=\"top.changeSco('previous');\" /> \n";
|
$startbold = '-> <b>';
|
||||||
|
$endbold = '</b> <-';
|
||||||
if ($scorm->popup == "") {
|
}
|
||||||
if ($scoes = get_records_select("scorm_scoes","scorm='$scorm->id' AND organization='$currentorg' order by id ASC")){
|
$score = "";
|
||||||
$level=0;
|
if ($sco_user=get_record("scorm_sco_users","scoid",$sco->id,"userid",$USER->id)) {
|
||||||
$parents[$level]="/";
|
if ( $sco_user->cmi_core_lesson_status == "") {
|
||||||
foreach ($scoes as $sco) {
|
$sco_user->cmi_core_lesson_status = "not attempted";
|
||||||
if ($parents[$level]!=$sco->parent) {
|
}
|
||||||
if ($level>0 && $parents[$level-1]==$sco->parent) {
|
echo "<img src=\"pix/".scorm_remove_spaces($sco_user->cmi_core_lesson_status).".gif\" alt=\"".get_string(scorm_remove_spaces($sco_user->cmi_core_lesson_status),"scorm")."\" title=\"".get_string(scorm_remove_spaces($sco_user->cmi_core_lesson_status),"scorm")."\" />\n";
|
||||||
$level--;
|
if (($sco_user->cmi_core_lesson_status == "not attempted") || ($sco_user->cmi_core_lesson_status == "incomplete")) {
|
||||||
} else {
|
if ($scoid == "") {
|
||||||
$i = $level;
|
$incomplete = true;
|
||||||
while (($i > 0) && ($parents[$level] != $sco->parent)) {
|
$scoid = $sco->id;
|
||||||
$i--;
|
$startbold = '-> <b>';
|
||||||
}
|
$endbold = '</b> <-';
|
||||||
if (($i == 0) && ($sco->parent != $currentorg)) {
|
}
|
||||||
$level++;
|
}
|
||||||
} else {
|
if ($sco_user->cmi_core_score_raw > 0) {
|
||||||
$level = $i;
|
$score = "(".get_string("score","scorm").": ".$sco_user->cmi_core_score_raw.")";
|
||||||
}
|
}
|
||||||
$parents[$level]=$sco->parent;
|
} else {
|
||||||
}
|
if ($sco->type == 'sco') {
|
||||||
|
echo "<img src=\"pix/notattempted.gif\" alt=\"".get_string("notattempted","scorm")."\" />";
|
||||||
|
$incomplete = true;
|
||||||
|
} else {
|
||||||
|
echo "<img src=\"pix/asset.gif\" alt=\"".get_string("asset","scorm")."\" />";
|
||||||
}
|
}
|
||||||
$indenting = "";
|
}
|
||||||
for ($i=0;$i<$level;$i++) {
|
echo " $startbold<a href=\"javascript:playSCO(".$sco->id.");\">$sco->title</a> $score$endbold</li>\n";
|
||||||
$indenting .= "-";
|
} else {
|
||||||
}
|
echo " $sco->title</li>\n";
|
||||||
$options[$sco->id] = $indenting."> ".$sco->title;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
choose_from_menu($options, "courseStructure", $scoid, "", "document.navform.scoid.value=document.navform.courseStructure.options[document.navform.courseStructure.selectedIndex].value;document.navform.submit();");
|
|
||||||
}
|
}
|
||||||
echo " <input name=\"next\" type=\"button\" value=\"".get_string("next","scorm")."\" onClick=\"top.changeSco('continue')\" />\n";
|
for ($i=0;$i<$level;$i++) {
|
||||||
echo " </form>
|
echo "\t\t</ul></li>\n";
|
||||||
</td>\n";
|
|
||||||
|
|
||||||
echo "</tr>\n</table>\n";
|
|
||||||
if ($scorm->popup == "") {
|
|
||||||
echo "</body>\n</html>\n";
|
|
||||||
} else {
|
|
||||||
print_footer($course);
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
if ($scorm->popup == "") {
|
|
||||||
//
|
|
||||||
// Frameset
|
|
||||||
//
|
|
||||||
echo "<html>\n";
|
|
||||||
echo "<head><title>$course->shortname: $scorm->name</title></head>\n";
|
|
||||||
echo "<script language=\"JavaScript\" type=\"text/javascript\" src=\"request.js\"></script>\n";
|
|
||||||
echo "<script language=\"JavaScript\" type=\"text/javascript\" src=\"api.php?id=$cm->id\"></script>\n";
|
|
||||||
echo "<frameset rows=\"$CFG->scorm_framesize,*\" onUnload=\"SCOFinish();\">\n";
|
|
||||||
echo "\t <frame name=\"navigation\" src=\"playscorm.php?id=$cm->id".$modestring.$currentorgstring.$scoidstring."&frameset=top\">\n";
|
|
||||||
echo "\t <frame name=\"main\" src=\"loadSCO.php?id=$cm->id$scoidstring\">\n";
|
|
||||||
echo "</frameset>\n";
|
|
||||||
echo "</html>\n";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
</ul>
|
||||||
|
</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 ?>" />
|
||||||
|
<input name="prev" type="button" value="<?php print_string('prev','scorm') ?>" onClick="top.changeSco('previous');" />
|
||||||
|
<input name="next" type="button" value="<?php print_string('next','scorm') ?>" onClick="top.changeSco('continue')" />
|
||||||
|
</form>
|
||||||
|
</td></tr>
|
||||||
|
</table>
|
||||||
|
<?php print_simple_box_end(); ?>
|
||||||
|
</td>
|
||||||
|
<td width="100%">
|
||||||
|
<iframe name="main" height="500" width="100%" src="loadSCO.php?id=<?php echo $cm->id.$scoidstring ?>"></iframe>
|
||||||
|
</td></tr>
|
||||||
|
</table>
|
||||||
|
<?php
|
||||||
|
/*$popuplocation = '';
|
||||||
|
if (isset($_COOKIE["SCORMpopup"])) {
|
||||||
|
$popuplocation = $_COOKIE["SCORMpopup"];
|
||||||
|
}
|
||||||
|
echo "<script language=\"javascript\">\n";
|
||||||
|
echo "\t top.main = window.open('loadSCO.php?id=$cm->id".$scoidstring."','main','$scorm->popup$popuplocation');\n";
|
||||||
|
echo "</script>\n"; */
|
||||||
|
?>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue