course)) { error('Course is misconfigured'); } if (! $scorm = get_record('scorm', 'id', $cm->instance)) { error('Course module is incorrect'); } } else { 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'); } } require_login($course->id, false, $cm); if (!empty($_POST['scoid'])) { //echo 'scoid: '.$_POST['scoid']."\n"; if (!empty($_POST['cmi_core_lesson_location'])) { set_field('scorm_sco_users','cmi_core_lesson_location',$_POST['cmi_core_lesson_location'],'scoid',$_POST['scoid'],'userid',$USER->id); //echo 'cmi_core_lesson_location: '.$_POST['cmi_core_lesson_location']."\n"; } if (!empty($_POST['cmi_core_lesson_status'])) { set_field('scorm_sco_users','cmi_core_lesson_status',$_POST['cmi_core_lesson_status'],'scoid',$_POST['scoid'],'userid',$USER->id); //echo 'cmi_core_lesson_status: '.$_POST['cmi_core_lesson_status']."\n"; } if (!empty($_POST['cmi_core_exit'])) { set_field('scorm_sco_users','cmi_core_exit',$_POST['cmi_core_exit'],'scoid',$_POST['scoid'],'userid',$USER->id); //echo 'cmi_core_exit: '.$_POST['cmi_core_exit']."\n"; } if (!empty($_POST['cmi_core_score_raw'])) { set_field('scorm_sco_users','cmi_core_score_raw',$_POST['cmi_core_score_raw'],'scoid',$_POST['scoid'],'userid',$USER->id); //echo 'cmi_core_score_raw: '.$_POST['cmi_core_score_raw']."\n"; } if (!empty($_POST['cmi_suspend_data'])) { set_field('scorm_sco_users','cmi_suspend_data',$_POST['cmi_suspend_data'],'scoid',$_POST['scoid'],'userid',$USER->id); //echo 'cmi_suspend_data: '.$_POST['cmi_suspend_data']."\n"; } if (!empty($_POST['cmi_core_total_time'])) { set_field('scorm_sco_users','cmi_core_total_time',$_POST['cmi_core_total_time'],'scoid',$_POST['scoid'],'userid',$USER->id); //echo 'cmi_core_total_time: '.$_POST['cmi_core_total_time']."\n"; } } ?> cmi