]> git.mjollnir.org Git - moodle.git/commitdiff
Fixed last Explorer popup bug and added user score view
authorbobopinna <bobopinna>
Tue, 29 Jun 2004 07:50:07 +0000 (07:50 +0000)
committerbobopinna <bobopinna>
Tue, 29 Jun 2004 07:50:07 +0000 (07:50 +0000)
mod/scorm/playscorm.php
mod/scorm/scormAPI.php
mod/scorm/view.php

index f0d29bbd05493d64e5655a1396fdc60860f1e06d..06a8ee1d8c824f4017d8ba675a4bd5b1898ce338 100755 (executable)
                        $startbold = '';
                        $endbold = '';
                        if ($sco->id == $currentSCO) {
-                           $startbold = '-> <b><u>';
-                           $endbold = '</u></b> <-';
+                           $startbold = '-> <b>';
+                           $endbold = '</b> <-';
+                       }
+                       if (($currentSCO == "") && ($mode != "normal")) {
+                           $currentSCO = $sco->id;
+                           $startbold = '-> <b>';
+                           $endbold = '</b> <-';
                        }
                        if ($sco_user=get_record("scorm_sco_users","scoid",$sco->id,"userid",$USER->id)) {
                            if ( $sco_user->cmi_core_lesson_status == "")
                                if ($currentSCO == "") {
                                    $incomplete = true;
                                    $currentSCO = $sco->id;
-                                   $startbold = '-> <b><u>';
-                                   $endbold = '</u></b> <-';
+                                   $startbold = '-> <b>';
+                                   $endbold = '</b> <-';
                                }
                            }
                        } else {
                            echo "      <img src=\"pix/notattempted.gif\" alt=\"".get_string("notattempted","scorm")."\" />";
                            $incomplete = true;
                        }
-                       echo "      &nbsp;$startbold<a href=\"javascript:playSCO(".$sco->id.");\">$sco->title</a>$endbold\n    </li>\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 "      &nbsp;$startbold<a href=\"javascript:playSCO(".$sco->id.");\">$sco->title</a> $score$endbold\n    </li>\n";
                    } else {
                        echo "      &nbsp;$sco->title\n    </li>\n";
                    }
        if ($scorm->popup != "") {
        ?>
            <script language="Javascript">
-               top.main = window.open('','main','<?php echo $scorm->popup ?>');
                SCOInitialize();
             </script>
         <?php
             echo "<head><title>$course->shortname: $scorm->name</title></head>\n";
             echo "<script id=\"scormAPI\" language=\"JavaScript\" type=\"text/javascript\" src=\"scormAPI.php?id=$cm->id&mode=".$mode.$scoid."\"></script>\n";
            echo "<frameset rows=\"$CFG->scorm_framesize,*\" onLoad=\"SCOInitialize();\">\n";
-            echo "         <frame name=\"nav\" src=\"playscorm.php?id=$cm->id&mode=".$mode."&frameset=top\">\n";
-            echo "         <frame name=\"main\" src=\"\">\n";
+            echo "\t    <frame name=\"nav\" src=\"playscorm.php?id=$cm->id&mode=".$mode."&frameset=top\">\n";
+            echo "\t    <frame name=\"main\" src=\"\">\n";
             echo "</frameset>\n";
             echo "</html>\n";
         }
index ac5e33bf0757fe729a6e917a7ad6663ad2f9f743..ff4a4dea60ab17653ab3102c33fbd89d608c66d9 100755 (executable)
@@ -158,10 +158,14 @@ function SCOInitialize() {
        print "\t".$navObj."document.navform.next.style.display = 'none';\n";
     }
 ?>
-       top.main.location="<?php echo $result; ?>";
-<?php  if ($scorm->popup == "") { ?>
-       hilightcurrent(<?php echo $navObj ?>document.navform.courseStructure);
-<?php   } ?>
+<?php  
+    if ($scorm->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) {
index 97eae95c3b6a2993b4daaed07bad31dbf2c29912..0765a28a58e0507e92632e3042db512e97a26631 100755 (executable)
                        echo "      <img src=\"pix/notattempted.gif\" alt=\"".get_string("notattempted","scorm")."\" />";
                        $incomplete = true;
                    }
-                   echo "      &nbsp;<a href=\"javascript:playSCO(".$sco->id.")\">$sco->title</a>\n    </li>\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 "      &nbsp;<a href=\"javascript:playSCO(".$sco->id.")\">$sco->title</a> $score\n    </li>\n";
                } else {
                    echo "      &nbsp;$sco->title\n    </li>\n";
                }