mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 17:06:53 +02:00
MDL-45712 mod_scorm: add results column to interactions report.
This commit is contained in:
parent
0dfcc2541a
commit
3ef6e46081
4 changed files with 23 additions and 1 deletions
|
@ -59,15 +59,18 @@ class report extends \mod_scorm\report {
|
||||||
$includeqtext = $fromform->qtext;
|
$includeqtext = $fromform->qtext;
|
||||||
$includeresp = $fromform->resp;
|
$includeresp = $fromform->resp;
|
||||||
$includeright = $fromform->right;
|
$includeright = $fromform->right;
|
||||||
|
$includeresult = $fromform->result;
|
||||||
set_user_preference('scorm_report_pagesize', $pagesize);
|
set_user_preference('scorm_report_pagesize', $pagesize);
|
||||||
set_user_preference('scorm_report_interactions_qtext', $includeqtext);
|
set_user_preference('scorm_report_interactions_qtext', $includeqtext);
|
||||||
set_user_preference('scorm_report_interactions_resp', $includeresp);
|
set_user_preference('scorm_report_interactions_resp', $includeresp);
|
||||||
set_user_preference('scorm_report_interactions_right', $includeright);
|
set_user_preference('scorm_report_interactions_right', $includeright);
|
||||||
|
set_user_preference('scorm_report_interactions_result', $includeresult);
|
||||||
} else {
|
} else {
|
||||||
$pagesize = get_user_preferences('scorm_report_pagesize', 0);
|
$pagesize = get_user_preferences('scorm_report_pagesize', 0);
|
||||||
$includeqtext = get_user_preferences('scorm_report_interactions_qtext', 0);
|
$includeqtext = get_user_preferences('scorm_report_interactions_qtext', 0);
|
||||||
$includeresp = get_user_preferences('scorm_report_interactions_resp', 1);
|
$includeresp = get_user_preferences('scorm_report_interactions_resp', 1);
|
||||||
$includeright = get_user_preferences('scorm_report_interactions_right', 0);
|
$includeright = get_user_preferences('scorm_report_interactions_right', 0);
|
||||||
|
$includeresult = get_user_preferences('scorm_report_interactions_result', 0);
|
||||||
}
|
}
|
||||||
if ($pagesize < 1) {
|
if ($pagesize < 1) {
|
||||||
$pagesize = SCORM_REPORT_DEFAULT_PAGE_SIZE;
|
$pagesize = SCORM_REPORT_DEFAULT_PAGE_SIZE;
|
||||||
|
@ -79,6 +82,7 @@ class report extends \mod_scorm\report {
|
||||||
$displayoptions['qtext'] = $includeqtext;
|
$displayoptions['qtext'] = $includeqtext;
|
||||||
$displayoptions['resp'] = $includeresp;
|
$displayoptions['resp'] = $includeresp;
|
||||||
$displayoptions['right'] = $includeright;
|
$displayoptions['right'] = $includeright;
|
||||||
|
$displayoptions['result'] = $includeresult;
|
||||||
|
|
||||||
$mform->set_data($displayoptions + array('pagesize' => $pagesize));
|
$mform->set_data($displayoptions + array('pagesize' => $pagesize));
|
||||||
if ($groupmode = groups_get_activity_groupmode($cm)) { // Groups are being used.
|
if ($groupmode = groups_get_activity_groupmode($cm)) { // Groups are being used.
|
||||||
|
@ -204,6 +208,10 @@ class report extends \mod_scorm\report {
|
||||||
$columns[] = 'right' . $id;
|
$columns[] = 'right' . $id;
|
||||||
$headers[] = get_string('rightanswerx', 'scormreport_interactions', $id);
|
$headers[] = get_string('rightanswerx', 'scormreport_interactions', $id);
|
||||||
}
|
}
|
||||||
|
if ($displayoptions['result']) {
|
||||||
|
$columns[] = 'result' . $id;
|
||||||
|
$headers[] = get_string('resultx', 'scormreport_interactions', $id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$download) {
|
if (!$download) {
|
||||||
|
@ -239,6 +247,9 @@ class report extends \mod_scorm\report {
|
||||||
if ($displayoptions['right']) {
|
if ($displayoptions['right']) {
|
||||||
$table->no_sorting('right'.$id);
|
$table->no_sorting('right'.$id);
|
||||||
}
|
}
|
||||||
|
if ($displayoptions['result']) {
|
||||||
|
$table->no_sorting('result'.$id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($scoes as $sco) {
|
foreach ($scoes as $sco) {
|
||||||
|
@ -526,6 +537,14 @@ class report extends \mod_scorm\report {
|
||||||
$row[] = ' ';
|
$row[] = ' ';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ($displayoptions['result']) {
|
||||||
|
$element = 'cmi.interactions_'.$i.'.result';
|
||||||
|
if (isset($trackdata->$element)) {
|
||||||
|
$row[] = s($trackdata->$element);
|
||||||
|
} else {
|
||||||
|
$row[] = ' ';
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// End of interaction data.
|
// End of interaction data.
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -29,7 +29,9 @@ $string['pluginname'] = 'Interactions report';
|
||||||
$string['questionx'] = 'Question {$a}';
|
$string['questionx'] = 'Question {$a}';
|
||||||
$string['responsex'] = 'Response {$a}';
|
$string['responsex'] = 'Response {$a}';
|
||||||
$string['rightanswerx'] = 'Right answer {$a}';
|
$string['rightanswerx'] = 'Right answer {$a}';
|
||||||
|
$string['resultx'] = 'Result {$a}';
|
||||||
$string['summaryofquestiontext'] = 'Summary of question';
|
$string['summaryofquestiontext'] = 'Summary of question';
|
||||||
$string['summaryofresponse'] = 'Summary of responses';
|
$string['summaryofresponse'] = 'Summary of responses';
|
||||||
$string['summaryofrightanswer'] = 'Summary of right answer';
|
$string['summaryofrightanswer'] = 'Summary of right answer';
|
||||||
|
$string['summaryofresult'] = 'Summary of result';
|
||||||
|
|
||||||
|
|
|
@ -43,6 +43,7 @@ class mod_scorm_report_interactions_settings extends moodleform {
|
||||||
$mform->addElement('advcheckbox', 'qtext', '', get_string('summaryofquestiontext', 'scormreport_interactions'));
|
$mform->addElement('advcheckbox', 'qtext', '', get_string('summaryofquestiontext', 'scormreport_interactions'));
|
||||||
$mform->addElement('advcheckbox', 'resp', '', get_string('summaryofresponse', 'scormreport_interactions'));
|
$mform->addElement('advcheckbox', 'resp', '', get_string('summaryofresponse', 'scormreport_interactions'));
|
||||||
$mform->addElement('advcheckbox', 'right', '', get_string('summaryofrightanswer', 'scormreport_interactions'));
|
$mform->addElement('advcheckbox', 'right', '', get_string('summaryofrightanswer', 'scormreport_interactions'));
|
||||||
|
$mform->addElement('advcheckbox', 'result', '', get_string('summaryofresult', 'scormreport_interactions'));
|
||||||
|
|
||||||
// -------------------------------------------------------------------------------
|
// -------------------------------------------------------------------------------
|
||||||
$mform->addElement('header', 'preferencesuser', get_string('preferencesuser', 'scorm'));
|
$mform->addElement('header', 'preferencesuser', get_string('preferencesuser', 'scorm'));
|
||||||
|
|
|
@ -25,6 +25,6 @@
|
||||||
|
|
||||||
defined('MOODLE_INTERNAL') || die();
|
defined('MOODLE_INTERNAL') || die();
|
||||||
|
|
||||||
$plugin->version = 2015111600; // The current plugin version (Date: YYYYMMDDXX)
|
$plugin->version = 2015121600; // The current plugin version (Date: YYYYMMDDXX)
|
||||||
$plugin->requires = 2015111000; // Requires this Moodle version.
|
$plugin->requires = 2015111000; // Requires this Moodle version.
|
||||||
$plugin->component = 'scormreport_interactions'; // Full name of the plugin (used for diagnostics).
|
$plugin->component = 'scormreport_interactions'; // Full name of the plugin (used for diagnostics).
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue