diff --git a/mod/scorm/playscorm.php b/mod/scorm/playscorm.php index d16a8b44eba10..f70f8d142612a 100755 --- a/mod/scorm/playscorm.php +++ b/mod/scorm/playscorm.php @@ -65,239 +65,180 @@ $modestring = ''; $scoidstring = ''; $currentorgstring = ''; - if (($scorm->popup == "") && ($frameset == "top")) { - if (!empty($_GET["mode"])) { - $mode = $_GET["mode"]; - $modestring = '&mode='.$mode; - } - if (!empty($_GET["scoid"])) { - $scoid = $_GET["scoid"]; - $scoidstring = '&scoid='.$scoid; - } - if (!empty($_GET['currentorg'])) { - $currentorg = $_GET['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 (!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"); - // - // Print the page header - // - $bodyscripts = ""; - if ($scorm->popup != "") { - $bodyscripts = "onUnload='SCOFinish(); closeMain();' "; - } - print_header($pagetitle, "$course->fullname", - "$navigation framename}\" href=\"view.php?id=$cm->id\">$scorm->name", - "", "", true, update_module_button($cm->id, $course->id, $strscorm), "", "", $bodyscripts); - echo "\n \n"; - if ($mode == "browse") - echo "\n"; - echo " \n
".text_to_html($scorm->summary, true, false)."".get_string("browsemode","scorm")."
\n"; + add_to_log($course->id, "scorm", "view", "playscorm.php?id=$cm->id", "$scorm->id"); + // + // Print the page header + // + $bodyscripts = "onUnload='SCOFinish(); closeMain();'"; + print_header($pagetitle, "$course->fullname", + "$navigation framename}\" href=\"view.php?id=$cm->id\">$scorm->name", + "", "", true, update_module_button($cm->id, $course->id, $strscorm), "", "", $bodyscripts); +?> + + + + + + + + +
+

summary, false, false) ?>

+

+ + + + \n"; - echo " \n"; - echo "
+
    +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
\n"; + $level--; + } else { + $i = $level; + $closelist = ""; + while (($i > 0) && ($parents[$level] != $sco->parent)) { + $closelist .= "\t\t\n"; + $i--; + } + if (($i == 0) && ($sco->parent != $currentorg)) { + echo "\t\t
    • \n"; + $level++; } else { - which.src = "pix/minus.gif"; - eval(beg+list+mid+".display='block';"); + echo $closelist; + $level = $i; } - + $parents[$level]=$sco->parent; } - --> - - - \n"; - echo "
  • ".get_string("coursestruct","scorm")."
    \n
      \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 "
    \n"; - $level--; - } else { - $i = $level; - $closelist = ""; - while (($i > 0) && ($parents[$level] != $sco->parent)) { - $closelist .= " \n"; - $i--; - } - if (($i == 0) && ($sco->parent != $currentorg)) { - echo "
    • \n"; - $level++; - } else { - echo $closelist; - $level = $i; - } - $parents[$level]=$sco->parent; - } - } - echo "
    • \n"; - $nextsco = next($scoes); - if (($nextsco !== false) && ($sco->parent != $nextsco->parent) && (($level==0) || (($level>0) && ($nextsco->parent == $sco->identifier)))) { - $sublist++; - echo " \n"; - } else { - echo " \n"; - } - - if ($sco->launch) { - $startbold = ''; - $endbold = ''; - if ($sco->id == $scoid) { - $startbold = '-> '; - $endbold = ' <-'; - } - if (($scoid == "") && ($mode != "normal")) { - $scoid = $sco->id; + } + echo "\t\t
    • "; + $nextsco = next($scoes); + if (($nextsco !== false) && ($sco->parent != $nextsco->parent) && (($level==0) || (($level>0) && ($nextsco->parent == $sco->identifier)))) { + $sublist++; + echo ""; + } else { + echo ""; + } + + if ($sco->launch) { + $startbold = ''; + $endbold = ''; + if ($sco->id == $scoid) { + $startbold = '-> '; + $endbold = ' <-'; + } + if (($scoid == "") && ($mode != "normal")) { + $scoid = $sco->id; + $startbold = '-> '; + $endbold = ' <-'; + } + $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 "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 = '-> '; - $endbold = ' <-'; - } - $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 " 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 = '-> '; - $endbold = ' <-'; - } - } - 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 " \"".get_string("notattempted","scorm")."\""; - $incomplete = true; - } else { - echo " \"".get_string("asset","scorm")."\""; - } - } - echo "  $startboldid.");\">$sco->title $score$endbold\n
    • \n"; - } else { - echo "  $sco->title\n \n"; + $endbold = ' <-'; + } + } + if ($sco_user->cmi_core_score_raw > 0) { + $score = "(".get_string("score","scorm").": ".$sco_user->cmi_core_score_raw.")"; } - } - for ($i=0;$i<$level;$i++){ - echo "
  • \n"; - } - } - echo "
    \n"; - print_simple_box_end(); - - } - - echo "\n \n"; - echo " \n"; - - echo "\n
    - -
    id\" target=\"_top\"> - - - -  \n"; - - if ($scorm->popup == "") { - if ($scoes = get_records_select("scorm_scoes","scorm='$scorm->id' AND organization='$currentorg' order by id ASC")){ - $level=0; - $parents[$level]="/"; - foreach ($scoes as $sco) { - if ($parents[$level]!=$sco->parent) { - if ($level>0 && $parents[$level-1]==$sco->parent) { - $level--; - } else { - $i = $level; - while (($i > 0) && ($parents[$level] != $sco->parent)) { - $i--; - } - if (($i == 0) && ($sco->parent != $currentorg)) { - $level++; - } else { - $level = $i; - } - $parents[$level]=$sco->parent; - } - } - $indenting = ""; - for ($i=0;$i<$level;$i++) { - $indenting .= "-"; + } else { + if ($sco->type == 'sco') { + echo "\"".get_string("notattempted","scorm")."\""; + $incomplete = true; + } else { + echo "\"".get_string("asset","scorm")."\""; } - $options[$sco->id] = $indenting."> ".$sco->title; - } + } + echo " $startboldid.");\">$sco->title $score$endbold\n"; + } else { + echo " $sco->title\n"; } - choose_from_menu($options, "courseStructure", $scoid, "", "document.navform.scoid.value=document.navform.courseStructure.options[document.navform.courseStructure.selectedIndex].value;document.navform.submit();"); } - echo "  \n"; - echo "
    -
    \n"; - if ($scorm->popup == "") { - echo "\n\n"; - } else { - print_footer($course); + for ($i=0;$i<$level;$i++) { + echo "\t\t\n"; } - } else { - if ($scorm->popup == "") { - // - // Frameset - // - echo "\n"; - echo "$course->shortname: $scorm->name\n"; - echo "\n"; - echo "\n"; - echo "scorm_framesize,*\" onUnload=\"SCOFinish();\">\n"; - echo "\t id".$modestring.$currentorgstring.$scoidstring."&frameset=top\">\n"; - echo "\t id$scoidstring\">\n"; - echo "\n"; - echo "\n"; - } } ?> + +
    +
    + + + + + +
    +
    + + + + + + +\n"; + echo "\t top.main = window.open('loadSCO.php?id=$cm->id".$scoidstring."','main','$scorm->popup$popuplocation');\n"; + echo "\n"; */ +?> + +