MDL-15198 "non-standard sql in reportlib.php" similar sql used here, fixing.

This commit is contained in:
jamiesensei
2008-07-22 13:06:54 +00:00
parent 182dbc6f4d
commit a1db71cb25
+1 -1
View File
@@ -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)';