From: bobopinna Date: Tue, 29 Jun 2004 07:50:07 +0000 (+0000) Subject: Fixed last Explorer popup bug and added user score view X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=02f5d4390c6947f97c0a8bb4c42f1a6ee6a44210;p=moodle.git Fixed last Explorer popup bug and added user score view --- diff --git a/mod/scorm/playscorm.php b/mod/scorm/playscorm.php index f0d29bbd05..06a8ee1d8c 100755 --- a/mod/scorm/playscorm.php +++ b/mod/scorm/playscorm.php @@ -145,8 +145,13 @@ $startbold = ''; $endbold = ''; if ($sco->id == $currentSCO) { - $startbold = '-> '; - $endbold = ' <-'; + $startbold = '-> '; + $endbold = ' <-'; + } + if (($currentSCO == "") && ($mode != "normal")) { + $currentSCO = $sco->id; + $startbold = '-> '; + $endbold = ' <-'; } if ($sco_user=get_record("scorm_sco_users","scoid",$sco->id,"userid",$USER->id)) { if ( $sco_user->cmi_core_lesson_status == "") @@ -156,15 +161,18 @@ if ($currentSCO == "") { $incomplete = true; $currentSCO = $sco->id; - $startbold = '-> '; - $endbold = ' <-'; + $startbold = '-> '; + $endbold = ' <-'; } } } else { echo " \"".get_string("notattempted","scorm")."\""; $incomplete = true; } - echo "  $startboldid.");\">$sco->title$endbold\n \n"; + $score = ""; + if (($sco_user->cmi_core_lesson_status == "passed") || ($sco_user->cmi_core_lesson_status == "failed")) + $score = "(".get_string("score","scorm").": ".$sco_user->cmi_core_score_raw.")"; + echo "  $startboldid.");\">$sco->title $score$endbold\n \n"; } else { echo "  $sco->title\n \n"; } @@ -218,7 +226,6 @@ if ($scorm->popup != "") { ?> $course->shortname: $scorm->name\n"; echo "\n"; echo "scorm_framesize,*\" onLoad=\"SCOInitialize();\">\n"; - echo " id&mode=".$mode."&frameset=top\">\n"; - echo " \n"; + echo "\t id&mode=".$mode."&frameset=top\">\n"; + echo "\t \n"; echo "\n"; echo "\n"; } diff --git a/mod/scorm/scormAPI.php b/mod/scorm/scormAPI.php index ac5e33bf07..ff4a4dea60 100755 --- a/mod/scorm/scormAPI.php +++ b/mod/scorm/scormAPI.php @@ -158,10 +158,14 @@ function SCOInitialize() { print "\t".$navObj."document.navform.next.style.display = 'none';\n"; } ?> - top.main.location=""; -popup == "") { ?> - hilightcurrent(document.navform.courseStructure); - +popup == "") { + echo "\t top.main.location=\"$result\";\n"; + echo "\t hilightcurrent(".$navObj."document.navform.courseStructure);\n"; + } else { + echo "\t top.main = window.open('$result','main','$scorm->popup');\n"; + } +?> } function changeSco(direction) { diff --git a/mod/scorm/view.php b/mod/scorm/view.php index 97eae95c3b..0765a28a58 100755 --- a/mod/scorm/view.php +++ b/mod/scorm/view.php @@ -129,7 +129,10 @@ echo " \"".get_string("notattempted","scorm")."\""; $incomplete = true; } - echo "  id.")\">$sco->title\n \n"; + $score = ""; + if (($sco_user->cmi_core_lesson_status == "passed") || ($sco_user->cmi_core_lesson_status == "failed")) + $score = "(".get_string("score","scorm").": ".$sco_user->cmi_core_score_raw.")"; + echo "  id.")\">$sco->title $score\n \n"; } else { echo "  $sco->title\n \n"; }