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

SQL error during review of the attempt in HEAD

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0
    • 2.0
    • Quiz
    • None
    • MOODLE_20_STABLE
    • MOODLE_20_STABLE

    Description

      After finishing a quiz you is redirected to review.php and get an error:

      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 '00 < maxgrade' at line 1<br /><br />SELECT feedbacktext FROM mdl_quiz_feedback WHERE quizid = ? AND mingrade <= ? AND 0,00 < maxgrade<br />[array ( 0 => '6', 1 => '0,00', )]
      Stack trace:
      line 372 of \lib\dml\moodle_database.php: dml_read_exception thrown
      line 656 of \lib\dml\mysqli_native_moodle_database.php: call to moodle_database->query_end()
      line 1209 of \lib\dml\moodle_database.php: call to mysqli_native_moodle_database->get_records_sql()
      line 1284 of \lib\dml\moodle_database.php: call to moodle_database->get_record_sql()
      line 1263 of \lib\dml\moodle_database.php: call to moodle_database->get_field_sql()
      line 462 of \mod\quiz\locallib.php: call to moodle_database->get_field_select()
      line 207 of \mod\quiz\review.php: call to quiz_feedback_for_grade()

      P.S. I guess a function displaying SQL in errors could use some upgrading too. It escapes HTML-related things too much, resulting in a things like mingrade <= ? displayed on the page

      Attachments

        Activity

          People

            timhunt Tim Hunt
            oa_sychev Oleg Sychev
            Nobody Nobody
            Tim Hunt, Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              24/Nov/10