course)) { error("Course is misconfigured"); } if (! $scorm = get_record("scorm", "id", $cm->instance)) { error("Course module is incorrect"); } } else if (!empty($a)) { if (! $scorm = get_record("scorm", "id", $a)) { error("Course module is incorrect"); } if (! $course = get_record("course", "id", $scorm->course)) { error("Course is misconfigured"); } if (! $cm = get_coursemodule_from_instance("scorm", $scorm->id, $course->id)) { error("Course Module ID was incorrect"); } } else { error('A required parameter is missing'); } require_login($course->id, false, $cm); if ($usertrack = scorm_get_tracks($scoid,$USER->id,$attempt)) { if ((isset($usertrack->{'cmi.exit'}) && ($usertrack->{'cmi.exit'} != 'time-out')) || ($scorm->version != "SCORM_1.3")) { foreach ($usertrack as $key => $value) { $userdata->$key = addslashes_js($value); } } else { $userdata->status = ''; $userdata->score_raw = ''; } } else { $userdata->status = ''; $userdata->score_raw = ''; } $userdata->student_id = addslashes_js($USER->username); $userdata->student_name = addslashes_js($USER->lastname .', '. $USER->firstname); $userdata->mode = 'normal'; if (isset($mode)) { $userdata->mode = $mode; } if ($userdata->mode == 'normal') { $userdata->credit = 'credit'; } else { $userdata->credit = 'no-credit'; } if ($scodatas = scorm_get_sco($scoid, SCO_DATA)) { foreach ($scodatas as $key => $value) { $userdata->$key = addslashes_js($value); } } else { error('Sco not found'); } if (!$sco = scorm_get_sco($scoid)) { error('Sco not found'); } $scorm->version = strtolower(clean_param($scorm->version, PARAM_SAFEDIR)); // Just to be safe if (file_exists($CFG->dirroot.'/mod/scorm/datamodels/'.$scorm->version.'.js.php')) { include_once($CFG->dirroot.'/mod/scorm/datamodels/'.$scorm->version.'.js.php'); } else { include_once($CFG->dirroot.'/mod/scorm/datamodels/scorm_12.js.php'); } // set the start time of this SCO scorm_insert_track($USER->id,$scorm->id,$scoid,$attempt,'x.start.time',time()); ?> var errorCode = "0"; function underscore(str) { str = String(str).replace(/.N/g,"."); return str.replace(/\./g,"__"); }