From 266a129c14c8ccadbc59fdf4ca38a285a2477eb9 Mon Sep 17 00:00:00 2001 From: Ankit Kumar Agarwal Date: Sat, 30 Jul 2011 20:41:19 +0530 Subject: [PATCH] MDL-27624 Small structural changes MDL-27624 SCORM adding definition to scrom elements modified: mod/scorm/lang/en/scorm.php modified: mod/scorm/userreport.php --- mod/scorm/lang/en/scorm.php | 15 ++++++++++ mod/scorm/userreport.php | 55 ++++++++++++++++++++++++++++++------- 2 files changed, 60 insertions(+), 10 deletions(-) diff --git a/mod/scorm/lang/en/scorm.php b/mod/scorm/lang/en/scorm.php index b972a2970fc..b0a55f053cf 100644 --- a/mod/scorm/lang/en/scorm.php +++ b/mod/scorm/lang/en/scorm.php @@ -81,6 +81,7 @@ $string['displaysettings'] = 'Display Settings'; $string['domxml'] = 'DOMXML external library'; $string['duedate'] = 'Due date'; $string['element'] = 'Element'; +$string['elementdefinition'] = 'Element Definition'; $string['enter'] = 'Enter'; $string['entercourse'] = 'Enter course'; $string['errorlogs'] = 'Errors log'; @@ -145,6 +146,20 @@ $string['identifier'] = 'Question identifier'; $string['incomplete'] = 'Incomplete'; $string['info'] = 'Info'; $string['interactions'] = 'Interactions'; +$string['interactionsid'] = 'Id of the element'; +$string['interactionscorrectcount'] = 'Number of correct results for the question'; +$string['interactionspattern'] = 'Pattern of correct response'; +$string['interactionslatency'] = 'Time elapsed between the time the interaction
was made available to the learner for response
and the time of the first response'; +$string['interactionsresponse'] = 'Student\'s Response'; +$string['interactionsresult'] = 'Result based on student\'s response and
correct result'; +$string['interactionsscoremin'] = 'Minimum value in the range for the raw score'; +$string['interactionsscoremax'] = 'Maximum value in the range for the raw score'; +$string['interactionsscoreraw'] = 'Number that reflects the performance of the learner
relative to the range bounded by the values of min and max'; +$string['interactionssuspenddata'] = 'Provides space to store and retrieve data
between learner sessions'; +$string['interactionstime'] = 'Time at which the attempt was intiated'; +$string['interactionstype'] = 'Type of question'; +$string['interactionsweight'] = 'Weight assigned to the element'; +$string['interactionslearnerresponse'] = 'Learner\'s Response'; $string['invalidactivity'] = 'Scorm activity is incorrect'; $string['invalidmanifestresource'] = 'WARNING: The following resources were referenced in your manifest but couldn\'t be found:'; $string['last'] = 'Last accessed on'; diff --git a/mod/scorm/userreport.php b/mod/scorm/userreport.php index b1a415ce763..8288b13f9f1 100644 --- a/mod/scorm/userreport.php +++ b/mod/scorm/userreport.php @@ -15,13 +15,13 @@ // along with Moodle. If not, see . /** -* This page displays the user data from a single attempt -* -* @package mod -* @subpackage scorm -* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com} -* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later -*/ + * This page displays the user data from a single attempt + * + * @package mod + * @subpackage scorm + * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ require_once("../../config.php"); require_once($CFG->dirroot.'/mod/scorm/locallib.php'); @@ -289,7 +289,7 @@ if (!empty($b)) { 'cmi.objectives.'.$i.'.score.max'); $row = array(); foreach ($elements as $element) { - if (isset($trackdata->$element)) { + if (isset($trackdata->$element)) { $row[] = s($trackdata->$element); $printedelements[]=$element; } else { @@ -306,7 +306,7 @@ if (!empty($b)) { echo html_writer::table($table); } $table = new html_table(); - $table->head = array(get_string('element', 'scorm'), get_string('value', 'scorm')); + $table->head = array(get_string('element', 'scorm'), get_string('elementdefinition', 'scorm'), get_string('value', 'scorm')); $table->align = array('left', 'left'); $table->wrap = array('nowrap', 'wrap'); $table->width = '100%'; @@ -319,7 +319,42 @@ if (!empty($b)) { if (!(in_array ($element, $printedelements))) { $existelements = true; $row = array(); - $row[] = get_string($element, 'scorm') != '[['.$element.']]' ? get_string($element, 'scorm') : $element; + $string=false; + if (stristr($element, '.id')!=null) { + $string="interactionsid"; + } else if (stristr($element, '.result')!=null) { + $string="interactionsresult"; + } else if (stristr($element, '.student_response')!=null) { + $string="interactionsresponse"; + } else if (stristr($element, '.type')!=null) { + $string="interactionstype"; + } else if (stristr($element, '.weighting')!=null) { + $string="interactionsweight"; + } else if (stristr($element, '.time')!=null) { + $string="interactionstime"; + } else if (stristr($element, '.correct_responses._count')!=null) { + $string="interactionscorrectcount"; + } else if (stristr($element, '.learner_response')!=null) { + $string="interactionslearnerresponse"; + } else if (stristr($element, '.score.min')!=null) { + $string="interactionslscoremin"; + } else if (stristr($element, '.score.max')!=null) { + $string="interactionsscoremax"; + } else if (stristr($element, '.score.raw')!=null) { + $string="interactionsscoreraw"; + } else if (stristr($element, '.latency')!=null) { + $string="interactionslatency"; + } else if (stristr($element, '.pattern')!=null) { + $string="interactionspattern"; + } else if (stristr($element, '.suspend_data')!=null) { + $string="interactionssuspenddata"; + } + $row[]=$element; + if (empty($string)) { + $row[]=$element; + } else { + $row[] = get_string($string, 'scorm'); + } if (strpos($element, '_time') === false) { $row[] = s($value); } else {