Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-15378

Quizz: sql error if not student in the group

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.1
    • Fix Version/s: 1.9.2
    • Component/s: Quiz
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      As admin:

      • Create a course with two empty group
      • Create a quizz
        As student:
      • Attempt the quizz
        As admin:
      • View the result > Select an empty group

      SQL error is displayed:

      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 qa.preview = 0 AND qa.id IS NOT NULL' at line 1

      SELECT COUNT(DISTINCT(CONCAT(u.id,'#',COALESCE(qa.attempt, 0)))) FROM mdl_user u LEFT JOIN mdl_quiz_attempts qa ON qa.userid = u.id AND qa.quiz = 7 WHERE u.id IN () AND qa.preview = 0 AND qa.id IS NOT NULL

      • line 686 of lib\dmllib.php: call to debugging()
      • line 379 of lib\dmllib.php: call to get_recordset_sql()
      • line 396 of mod\quiz\report\overview\report.php: call to count_records_sql()
      • line 73 of mod\quiz\report.php: call to quiz_report->display()

      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 qa.preview = 0 AND qa.id IS NOT NULL' at line 1

      SELECT COUNT(DISTINCT(CONCAT(u.id,'#',COALESCE(qa.attempt, 0)))) FROM mdl_user u LEFT JOIN mdl_quiz_attempts qa ON qa.userid = u.id AND qa.quiz = 7 WHERE u.id IN () AND qa.preview = 0 AND qa.id IS NOT NULL

      • line 686 of lib\dmllib.php: call to debugging()
      • line 379 of lib\dmllib.php: call to get_recordset_sql()
      • line 400 of mod\quiz\report\overview\report.php: call to count_records_sql()
      • line 73 of mod\quiz\report.php: call to quiz_report->display()

      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 qa.preview = 0 AND qa.id IS NOT NULL ORDER BY uniqueid LIMIT 30' at line 1

      SELECT CONCAT(u.id,'#', IFNULL(qa.attempt, 0) ) AS uniqueid, (SELECT id FROM mdl_quiz_attempts WHERE quiz = 7 AND u.id = userid ORDER BY sumgrades DESC, timestart ASC LIMIT 1)=qa.id AS gradedattempt, qa.uniqueid AS attemptuniqueid, qa.id AS attempt, u.id AS userid, u.idnumber, u.firstname, u.lastname, u.picture, qa.sumgrades, qa.timefinish, qa.timestart, qa.timefinish - qa.timestart AS duration FROM mdl_user u LEFT JOIN mdl_quiz_attempts qa ON qa.userid = u.id AND qa.quiz = 7 WHERE u.id IN () AND qa.preview = 0 AND qa.id IS NOT NULL ORDER BY uniqueid

      • line 686 of lib\dmllib.php: call to debugging()
      • line 966 of lib\dmllib.php: call to get_recordset_sql()
      • line 410 of mod\quiz\report\overview\report.php: call to get_records_sql()
      • line 73 of mod\quiz\report.php: call to quiz_report->display()

        Attachments

          Activity

            People

            • Assignee:
              jamiesensei Jamie Pratt
              Reporter:
              jerome Jérôme Mouneyrac
              Tester:
              Jérôme Mouneyrac
              Participants:
              Component watchers:
              Tim Hunt, Andrew Nicols, Mathew May, Michael Hawkins, Shamim Rezaie, Simey Lameze
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                11/Jul/08