From 1cd167cc4411b697bb2fec0334b83b93b3baf51d Mon Sep 17 00:00:00 2001 From: piers Date: Mon, 15 Sep 2008 19:56:36 +0000 Subject: [PATCH] MDL-7097 - API debug. Add ability to manually poke the SCORM API for 1.2 and 2004. --- mod/scorm/datamodels/debug.js.php | 583 +++++++++++++++++++++++++++++- 1 file changed, 577 insertions(+), 6 deletions(-) diff --git a/mod/scorm/datamodels/debug.js.php b/mod/scorm/datamodels/debug.js.php index e8a64730ad..c0282b5dca 100644 --- a/mod/scorm/datamodels/debug.js.php +++ b/mod/scorm/datamodels/debug.js.php @@ -58,8 +58,142 @@ function toggleLog () { var logString = ""; var logRow = 0; var logPopUpWindow = "N"; +var debugSCORMVersion = 'version; ?>'; +version == 'scorm_12' ? 'LMS' : ''; + $LMS_api = $scorm->version == 'scorm_12' ? 'API' : 'API_1484_11'; + + $LMS_elements = array(); + if ($scorm->version == 'scorm_12') { + $LMS_elements = array( 'cmi.core._children', + 'cmi.core.student_id', + 'cmi.core.student_name', + 'cmi.core.lesson_location', + 'cmi.core.credit', + 'cmi.core.lesson_status', + 'cmi.core.entry', + 'cmi.core._children', + 'cmi.core.score.raw', + 'cmi.core.score.max', + 'cmi.core.score.min', + 'cmi.core.total_time', + 'cmi.core.lesson_mode', + 'cmi.core.exit', + 'cmi.core.session_time', + 'cmi.suspend_data', + 'cmi.launch_data', + 'cmi.comments', + 'cmi.comments_from_lms', + 'cmi.objectives._count', + 'cmi.objectives._children', + 'cmi.objectives.n.id', + 'cmi.objectives.n.score._children', + 'cmi.objectives.n.score.raw', + 'cmi.objectives.n.score.min', + 'cmi.objectives.n.score.max', + 'cmi.objectives.n.status', + 'cmi.student_data._children', + 'cmi.student_data.mastery_score', + 'cmi.student_data.max_time_allowed', + 'cmi.student_data.time_limit_action', + 'cmi.student_preference._children', + 'cmi.student_preference.audio', + 'cmi.student_preference.language', + 'cmi.student_preference.speed', + 'cmi.student_preference.text', + 'cmi.interactions._children', + 'cmi.interactions._count', + 'cmi.interactions.n.id', + 'cmi.interactions.n.objectives._count', + 'cmi.interactions.n.objectives.m.id', + 'cmi.interactions.n.time', + 'cmi.interactions.n.type', + 'cmi.interactions.n.correct_responses._count', + 'cmi.interactions.n.correct_responses.m.pattern', + 'cmi.interactions.n.weighting', + 'cmi.interactions.n.student_response', + 'cmi.interactions.n.result', + 'cmi.interactions.n.latency'); + } else { + $LMS_elements = array( 'cmi._children', + 'cmi._version', + 'cmi.learner_id', + 'cmi.learner_name', + 'cmi.location', + 'cmi.completion_status', + 'cmi.completion_threshold', + 'cmi.scaled_passing_score', + 'cmi.progressive_measure', + 'cmi.score._children', + 'cmi.score.raw', + 'cmi.score.max', + 'cmi.score.min', + 'cmi.score.scaled', + 'cmi.total_time', + 'cmi.time_limit_action', + 'cmi.max_time_allowed', + 'cmi.session_time', + 'cmi.success_status', + 'cmi.lesson_mode', + 'cmi.entry', + 'cmi.exit', + 'cmi.credit', + 'cmi.mode', + 'cmi.suspend_data', + 'cmi.launch_data', + 'cmi.comments', + 'cmi.comments_from_lms._children', + 'cmi.comments_from_lms._count', + 'cmi.comments_from_lms.n.comment', + 'cmi.comments_from_lms.n.location', + 'cmi.comments_from_lms.n.timestamp', + 'cmi.comments_from_learner._children', + 'cmi.comments_from_learner._count', + 'cmi.comments_from_learner.n.comment', + 'cmi.comments_from_learner.n.location', + 'cmi.comments_from_learner.n.timestamp', + 'cmi.objectives._count', + 'cmi.objectives._children', + 'cmi.objectives.n.id', + 'cmi.objectives.n.score._children', + 'cmi.objectives.n.score.raw', + 'cmi.objectives.n.score.min', + 'cmi.objectives.n.score.max', + 'cmi.objectives.n.score.scaled', + 'cmi.objectives.n.success_status', + 'cmi.objectives.n.completion_status', + 'cmi.objectives.n.progress_measure', + 'cmi.objectives.n.description', + 'cmi.student_data._children', + 'cmi.student_data.mastery_score', + 'cmi.student_data.max_time_allowed', + 'cmi.student_data.time_limit_action', + 'cmi.student_preference._children', + 'cmi.student_preference.audio', + 'cmi.student_preference.language', + 'cmi.student_preference.speed', + 'cmi.student_preference.text', + 'cmi.interactions._children', + 'cmi.interactions._count', + 'cmi.interactions.n.id', + 'cmi.interactions.n.objectives._count', + 'cmi.interactions.n.objectives.m.id', + 'cmi.interactions.n.time', + 'cmi.interactions.n.type', + 'cmi.interactions.n.correct_responses._count', + 'cmi.interactions.n.correct_responses.m.pattern', + 'cmi.interactions.n.weighting', + 'cmi.interactions.n.learner_response', + 'cmi.interactions.n.result', + 'cmi.interactions.n.latency', + 'cmi.interactions.n.description', + 'adl.nav.request'); + } +?> // add each entry to the log, or setup the log pane first time round +// The code written into the header is based on the ADL test suite API interaction code +// and various examples of test wrappers out in the community function UpdateLog(s) { var s1 = '