mirror of
https://github.com/moodle/moodle.git
synced 2025-02-16 05:45:36 +01:00
MDL-30422 SCORM Fixing old variable use in interraction report
This commit is contained in:
parent
79b0fece1f
commit
6348043461
@ -111,6 +111,7 @@ class scorm_interactions_report extends scorm_default_report {
|
||||
}
|
||||
if ( !$nostudents ) {
|
||||
// Now check if asked download of data
|
||||
$coursecontext = context_course::instance($course->id);
|
||||
if ($download) {
|
||||
$filename = clean_filename("$course->shortname ".format_string($scorm->name, true,$formattextoptions));
|
||||
}
|
||||
@ -128,9 +129,11 @@ class scorm_interactions_report extends scorm_default_report {
|
||||
}
|
||||
$columns[] = 'fullname';
|
||||
$headers[] = get_string('name');
|
||||
if ($CFG->grade_report_showuseridnumber) {
|
||||
$columns[] = 'idnumber';
|
||||
$headers[] = get_string('idnumber');
|
||||
|
||||
$extrafields = get_extra_user_fields($coursecontext);
|
||||
foreach ($extrafields as $field) {
|
||||
$columns[] = $field;
|
||||
$headers[] = get_user_field_name($field);
|
||||
}
|
||||
$columns[] = 'attempt';
|
||||
$headers[] = get_string('attempt', 'scorm');
|
||||
@ -154,7 +157,8 @@ class scorm_interactions_report extends scorm_default_report {
|
||||
// Construct the SQL
|
||||
$select = 'SELECT DISTINCT '.$DB->sql_concat('u.id', '\'#\'', 'COALESCE(st.attempt, 0)').' AS uniqueid, ';
|
||||
$select .= 'st.scormid AS scormid, st.attempt AS attempt, ' .
|
||||
'u.id AS userid, u.idnumber, u.firstname, u.lastname, u.picture, u.imagealt, u.email ';
|
||||
'u.id AS userid, u.idnumber, u.firstname, u.lastname, u.picture, u.imagealt, u.email'.
|
||||
get_extra_user_fields_sql($coursecontext, 'u', '', array('idnumber')) . ' ';
|
||||
|
||||
// This part is the same for all cases - join users and scorm_scoes_track tables
|
||||
$from = 'FROM {user} u ';
|
||||
@ -207,7 +211,10 @@ class scorm_interactions_report extends scorm_default_report {
|
||||
|
||||
$table->column_suppress('picture');
|
||||
$table->column_suppress('fullname');
|
||||
$table->column_suppress('idnumber');
|
||||
// This is done to prevent redundant data, when a user has multiple attempts
|
||||
foreach ($extrafields as $field) {
|
||||
$table->column_suppress($field);
|
||||
}
|
||||
|
||||
$table->no_sorting('start');
|
||||
$table->no_sorting('finish');
|
||||
@ -410,8 +417,8 @@ class scorm_interactions_report extends scorm_default_report {
|
||||
} else {
|
||||
$row[] = fullname($scouser);
|
||||
}
|
||||
if (in_array('idnumber', $columns)) {
|
||||
$row[] = $scouser->idnumber;
|
||||
foreach ($extrafields as $field) {
|
||||
$row[] = s($scouser->{$field});
|
||||
}
|
||||
if (empty($timetracks->start)) {
|
||||
$row[] = '-';
|
||||
|
Loading…
x
Reference in New Issue
Block a user