MDL-39926 SCORM: Adapt report to alt name fields
This commit is contained in:
@@ -158,10 +158,10 @@ class scorm_objectives_report extends scorm_default_report {
|
||||
|
||||
$params = array();
|
||||
list($usql, $params) = $DB->get_in_or_equal($allowedlist, SQL_PARAMS_NAMED);
|
||||
// Construct the SQL.
|
||||
// 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'.
|
||||
user_picture::fields('u', array('idnumber'), 'userid') .
|
||||
get_extra_user_fields_sql($coursecontext, 'u', '', array('email', 'idnumber')) . ' ';
|
||||
|
||||
// This part is the same for all cases - join users and scorm_scoes_track tables.
|
||||
@@ -423,9 +423,10 @@ class scorm_objectives_report extends scorm_default_report {
|
||||
'id'=>$scouser->userid,
|
||||
'picture'=>$scouser->picture,
|
||||
'imagealt'=>$scouser->imagealt,
|
||||
'email'=>$scouser->email,
|
||||
'firstname'=>$scouser->firstname,
|
||||
'lastname'=>$scouser->lastname);
|
||||
'email'=>$scouser->email);
|
||||
foreach (get_all_user_name_fields() as $addname) {
|
||||
$user->$addname = $scouser->$addname;
|
||||
}
|
||||
$row[] = $OUTPUT->user_picture($user, array('courseid'=>$course->id));
|
||||
}
|
||||
if (!$download) {
|
||||
@@ -658,4 +659,4 @@ function get_scorm_objectives($scormid) {
|
||||
}
|
||||
$rs->close();
|
||||
return $objectives;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user