Included support for guest users.
authorbobopinna <bobopinna>
Tue, 13 Sep 2005 06:50:55 +0000 (06:50 +0000)
committerbobopinna <bobopinna>
Tue, 13 Sep 2005 06:50:55 +0000 (06:50 +0000)
Now guest, teacher and admin (not student) can play scorm package without save tracks.

mod/scorm/aicc.php
mod/scorm/datamodel.php
mod/scorm/view.php

index 415b941..db31d85 100755 (executable)
                 break;
                 case 'putparam':
                     if ($status == 'Running') {
-                        if (!empty($aiccdata)) {
+                        if (!empty($aiccdata) && isstudent($scorm->course)) {
                             $initlessonstatus = 'not attempted';
                             $lessonstatus = 'not attempted';
                             if (isset($SESSION->scorm_lessonstatus)) {
             echo "error = 3\nerror_text = Invalid Session ID\n";
         }
     }
-?>
\ No newline at end of file
+?>
index ea09741..6c7ff50 100755 (executable)
     
     if (confirm_sesskey() && (!empty($scoid))) {
         $result = true;
-        foreach ($_POST as $element => $value) {
-            if (substr($element,0,3) == 'cmi') {
-                $element = str_replace('__','.',$element);
-                $element = preg_replace('/_(\d+)/',".\$1",$element);
-                $result = scorm_insert_track($USER->id, $scorm->id, $scoid, $element, $value) && $result;
+        if (isstudent($course->id)) {
+            foreach ($_POST as $element => $value) {
+                if (substr($element,0,3) == 'cmi') {
+                    $element = str_replace('__','.',$element);
+                    $element = preg_replace('/_(\d+)/',".\$1",$element);
+                    $result = scorm_insert_track($USER->id, $scorm->id, $scoid, $element, $value) && $result;
+                }
             }
         }
         if ($result) {
index 3c2f687..ac98aa9 100755 (executable)
 
         print_simple_box(format_text($scorm->summary), 'center', '70%', '', 5, 'generalbox', 'intro');
 
-        if (isguest()) {
-            print_heading(get_string("guestsno", "scorm"));
-            print_footer($course);
-            exit;
-        }
         print_simple_box_start('center');
 ?>
         <div class="structurehead"><?php print_string('coursestruct','scorm') ?></div>