Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-26937 quiz grades report. Work-around MySQL fussiness, like for M…

…DL-26416.
  • Loading branch information...
commit 71ec5d19df4f506ca810cd55e25ebca4c5b94962 1 parent d14e8ea
Tim Hunt timhunt authored
Showing with 16 additions and 3 deletions.
  1. +16 −3 mod/quiz/report/overview/report.php
19 mod/quiz/report/overview/report.php
View
@@ -348,9 +348,22 @@ function display($quiz, $cm, $course) {
"END) AS gradedattempt, ";
}
- $select .= '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 ';
+ $select .= '
+ qa.uniqueid AS attemptuniqueid,
+ qa.id AS attempt,
+ u.id AS userid,
+ u.idnumber,
+ u.firstname,
+ u.lastname,
+ u.picture,
+ u.imagealt,
+ u.email,
+ qa.sumgrades,
+ qa.timefinish,
+ qa.timestart,
+ CASE WHEN qa.timefinish = 0 THEN null
+ WHEN qa.timefinish > qa.timestart THEN qa.timefinish - qa.timestart
+ ELSE 0 END AS duration ';
// This part is the same for all cases - join users and quiz_attempts tables
$from = 'FROM '.$CFG->prefix.'user u ';
Please sign in to comment.
Something went wrong with that request. Please try again.