-
Bug
-
Resolution: Fixed
-
Critical
-
2.1.5, 2.7
-
MOODLE_21_STABLE, MOODLE_27_STABLE
-
MOODLE_26_STABLE, MOODLE_27_STABLE
-
When reviewing the grades for a quiz, and modifying the report to only show attempts "that are graded for each user (Highest Grade)" results in the following Oracle error:
Error reading from database
Debug info: ORA-01799: a column may not be outer-joined to a subquery
SELECT *
FROM (SELECT 'x' FROM m_quiz_overview_regrades WHERE questionusageid IN (SELECT uniqueid FROM
m_user u
LEFT JOIN m_quiz_attempts quiza ON
quiza.userid = u.id AND quiza.quiz = :o_quizid AND quiza.id = (
SELECT MIN(qa2.id)
FROM m_quiz_attempts qa2
WHERE qa2.quiz = quiza.quiz AND
qa2.userid = quiza.userid AND
COALESCE(qa2.sumgrades, 0) = (
SELECT MAX(COALESCE(qa3.sumgrades, 0))
FROM m_quiz_attempts qa3
WHERE qa3.quiz = quiza.quiz AND
qa3.userid = quiza.userid
)
) WHERE quiza.id IS NOT NULL AND quiza.preview = 0))
WHERE rownum <= :o_oracle_num_rows
[array (
'o_quizid' => '1328',
'o_oracle_num_rows' => 1,
)]
Stack trace:
line 394 of /lib/dml/moodle_database.php: dml_read_exception thrown
line 268 of /lib/dml/oci_native_moodle_database.php: call to moodle_database->query_end()
line 1059 of /lib/dml/oci_native_moodle_database.php: call to oci_native_moodle_database->query_end()
line 1587 of /lib/dml/moodle_database.php: call to oci_native_moodle_database->get_recordset_sql()
line 1572 of /lib/dml/moodle_database.php: call to moodle_database->record_exists_sql()
line 542 of /mod/quiz/report/overview/report.php: call to moodle_database->record_exists_select()
line 316 of /mod/quiz/report/overview/report.php: call to quiz_overview_report->has_regraded_questions()
line 100 of /mod/quiz/report.php: call to quiz_overview_report->display()