mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 04:30:15 +01:00
MDL-15718 "overview report slow for large data sets - print_user_picture queries the db if only provided with a userid"
This commit is contained in:
parent
5a4825fa76
commit
375381a006
@ -116,7 +116,13 @@ class quiz_report_overview_table extends table_sql {
|
||||
|
||||
function col_picture($attempt){
|
||||
global $COURSE;
|
||||
return print_user_picture($attempt->userid, $COURSE->id, $attempt->picture, false, true);
|
||||
$user = new object();
|
||||
$user->id = $attempt->userid;
|
||||
$user->lastname = $attempt->lastname;
|
||||
$user->firstname = $attempt->firstname;
|
||||
$user->imagealt = $attempt->imagealt;
|
||||
$user->picture = $attempt->picture;
|
||||
return print_user_picture($user, $COURSE->id, $attempt->picture, false, true);
|
||||
}
|
||||
|
||||
|
||||
|
@ -249,7 +249,8 @@ class quiz_overview_report extends quiz_default_report {
|
||||
// Construct the SQL
|
||||
$fields = $DB->sql_concat('u.id', '\'#\'', 'COALESCE(qa.attempt, \'0\')').' AS uniqueid, '.
|
||||
($qmsubselect?"($qmsubselect) AS gradedattempt, ":'').
|
||||
'qa.uniqueid AS attemptuniqueid, qa.id AS attempt, u.id AS userid, u.idnumber, u.firstname, u.lastname, u.picture, '.
|
||||
'qa.uniqueid AS attemptuniqueid, qa.id AS attempt, ' .
|
||||
'u.id AS userid, u.idnumber, u.firstname, u.lastname, u.picture, u.imagealt, '.
|
||||
'qa.sumgrades, qa.timefinish, qa.timestart, qa.timefinish - qa.timestart AS duration ';
|
||||
|
||||
// This part is the same for all cases - join users and quiz_attempts tables
|
||||
|
Loading…
x
Reference in New Issue
Block a user