From a1db71cb25daa135c4f6210ec2d3a4ea0e89f2e4 Mon Sep 17 00:00:00 2001 From: jamiesensei Date: Tue, 22 Jul 2008 13:06:54 +0000 Subject: [PATCH] MDL-15198 "non-standard sql in reportlib.php" similar sql used here, fixing. --- mod/quiz/report/statistics/report.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/quiz/report/statistics/report.php b/mod/quiz/report/statistics/report.php index a86712062d..47bab7f920 100644 --- a/mod/quiz/report/statistics/report.php +++ b/mod/quiz/report/statistics/report.php @@ -115,7 +115,7 @@ class quiz_statistics_report extends quiz_default_report { $whereqa .= ' AND qa.userid '.$grpsql.' '; $qaparams += $grpparams; } - $sql = 'SELECT (attempt=1) AS isfirst, COUNT(1) AS countrecs, SUM(sumgrades) AS total ' . + $sql = 'SELECT (CASE WHEN attempt=1 THEN 1 ELSE 0 END) AS isfirst, COUNT(1) AS countrecs, SUM(sumgrades) AS total ' . 'FROM '.$fromqa. 'WHERE ' .$whereqa. 'GROUP BY (attempt=1)'; -- 2.39.5