Strange Error

Strange Error

by Lewis Miskowicz -
Number of replies: 0

I just updated last night "successfully" to the October 9th release of 3.3.2+. However, when sorting through quiz attempts I am getting a strange error regarding sql syntax...This only happens when I click on a letter of a first or last name to find a certain attempt. I get the following error pasted below. I can arrange by surname or first name with no issues. Its only when I try to sort via letter that I see the error. Thanks very much for any help you can provide.

As an aside...my server environment is all "OK" and my server requirements all exceed the minimums recommended.


×Debug info: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND lastname LIKE 'Z%' ESCAPE '\\'' at line 29
SELECT COUNT(1) FROM (SELECT DISTINCT CONCAT(u.id, '#', COALESCE(quiza.attempt, 0)) AS uniqueid,
(CASE WHEN (quiza.state = 'finished' AND NOT EXISTS (
SELECT 1 FROM mdl_quiz_attempts qa2
WHERE qa2.quiz = quiza.quiz AND
qa2.userid = quiza.userid AND
qa2.state = 'finished' AND (
COALESCE(qa2.sumgrades, 0) > COALESCE(quiza.sumgrades, 0) OR
(COALESCE(qa2.sumgrades, 0) = COALESCE(quiza.sumgrades, 0) AND qa2.attempt < quiza.attempt)
))) THEN 1 ELSE 0 END) AS gradedattempt,
quiza.uniqueid AS usageid,
quiza.id AS attempt,
u.id AS userid,
u.idnumber, u.firstnamephonetic,u.lastnamephonetic,u.middlename,u.alternatename,u.firstname,u.lastname,
u.picture,
u.imagealt,
u.institution,
u.department,
u.email,
quiza.state,
quiza.sumgrades,
quiza.timefinish,
quiza.timestart,
CASE WHEN quiza.timefinish = 0 THEN null
WHEN quiza.timefinish > quiza.timestart THEN quiza.timefinish - quiza.timestart
ELSE 0 END AS duration FROM mdl_user u
LEFT JOIN mdl_quiz_attempts quiza ON
quiza.userid = u.id AND quiza.quiz = ?
JOIN mdl_user_enrolments ej1_ue ON ej1_ue.userid = u.id
JOIN mdl_enrol ej1_e ON (ej1_e.id = ej1_ue.enrolid AND ej1_e.courseid = ?) WHERE quiza.preview = 0 AND quiza.id IS NOT NULL AND 1 = 1 AND u.deleted = 0) temp AND lastname LIKE ? ESCAPE '\\'
[array (
0 => '53',
1 => '9',
2 => 'Z%',
)]
Error code: dmlreadexception


Stack trace:

  • line 486 of /lib/dml/moodle_database.php: dml_read_exception thrown
  • line 1190 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
  • line 1558 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->get_records_sql()
  • line 1631 of /lib/dml/moodle_database.php: call to moodle_database->get_record_sql()
  • line 1841 of /lib/dml/moodle_database.php: call to moodle_database->get_field_sql()
  • line 1589 of /lib/tablelib.php: call to moodle_database->count_records_sql()
  • line 542 of /mod/quiz/report/attemptsreport_table.php: call to table_sql->query_db()
  • line 314 of /mod/quiz/report/overview/overview_table.php: call to quiz_attempts_report_table->query_db()
  • line 1630 of /lib/tablelib.php: call to quiz_overview_table->query_db()
  • line 244 of /mod/quiz/report/overview/report.php: call to table_sql->out()
  • line 97 of /mod/quiz/report.php: call to quiz_overview_report->display()

Average of ratings: -