Skip to content

Commit

Permalink
MDL-27624 Small structural changes
Browse files Browse the repository at this point in the history
MDL-27624 SCORM adding definition to scrom elements
	modified:   mod/scorm/lang/en/scorm.php
	modified:   mod/scorm/userreport.php
  • Loading branch information
ankitagarwal authored and danmarsden committed Aug 18, 2011
1 parent 4f36324 commit 266a129
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 10 deletions.
15 changes: 15 additions & 0 deletions mod/scorm/lang/en/scorm.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
$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';
Expand Down Expand Up @@ -145,6 +146,20 @@
$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 <br />was made available to the learner for response <br />and the time of the first response';
$string['interactionsresponse'] = 'Student\'s Response';
$string['interactionsresult'] = 'Result based on student\'s response and <br />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<br /> relative to the range bounded by the values of min and max';
$string['interactionssuspenddata'] = 'Provides space to store and retrieve data <br />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';
Expand Down
55 changes: 45 additions & 10 deletions mod/scorm/userreport.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* 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');
Expand Down Expand Up @@ -289,7 +289,7 @@
'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 {
Expand All @@ -306,7 +306,7 @@
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%';
Expand All @@ -319,7 +319,42 @@
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 {
Expand Down

0 comments on commit 266a129

Please sign in to comment.