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

Quiz: Manual Grading: Change Sort to "By Student ID" -- exception thrown

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.6.5, 3.7.1
    • 3.6 regressions, 3.6.4
    • Quiz
    • MOODLE_36_STABLE
    • MOODLE_36_STABLE, MOODLE_37_STABLE
    • Hide
      1. Create or find a quiz containing an Essay question.
      2. Log in as Student 1 and attempt the quiz.
      3. Log in as Student 2 and attempt the quiz.
      4. Log in as Teacher
      5. Go to Quiz -> Results -> Manual grading
      6. Click on the "Grade" link for the question.
      7. In the form at the top of the grading page, change 'Order attempts' to 'by student id number'.
      8. Click Change options.
      9. Verify that the page loads without an error.
      Show
      Create or find a quiz containing an Essay question. Log in as Student 1 and attempt the quiz. Log in as Student 2 and attempt the quiz. Log in as Teacher Go to Quiz -> Results -> Manual grading Click on the "Grade" link for the question. In the form at the top of the grading page, change 'Order attempts' to 'by student id number'. Click Change options. Verify that the page loads without an error.

      When grading manually graded questions in the Moodle Quiz activity, if you change the sort option from the default (Randomly) to "By Student ID", a database exception is thrown.

       

      SELECT
      qa.questionusageid,
      1

      FROM mdl_quiz_attempts quiza JOIN mdl_user u ON quiza.userid = u.id
      JOIN mdl_question_attempts qa ON qa.questionusageid = quiza.uniqueid
      JOIN mdl_question_attempt_steps qas ON qas.questionattemptid = qa.id
      AND qas.sequencenumber = (
      SELECT MAX(sequencenumber)
      FROM mdl_question_attempt_steps
      WHERE questionattemptid = qa.id
      )
      JOIN mdl_question q ON q.id = qa.questionid

      WHERE
      quiza.quiz = ? AND
      quiza.preview = 0 AND
      quiza.state = ? AND
      qa.slot = ?
      AND qa.questionid = ?

      ORDER BY idnumber

      [array (
      0 => '4457',
      1 => 'finished',
      2 => 2,
      3 => 199250,
      )]
      Error code: dmlreadexception

      Stack trace:

      line 486 of /lib/dml/moodle_database.php: dml_read_exception thrown
      line 1245 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
      line 1495 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->get_records_sql()
      line 744 of /question/engine/datalib.php: call to moodle_database->get_records_sql_menu()
      line 558 of /mod/quiz/report/grading/report.php: call to question_engine_data_mapper->load_questions_usages_where_question_in_state()
      line 338 of /mod/quiz/report/grading/report.php: call to quiz_grading_report->get_usage_ids_where_question_in_state()
      line 156 of /mod/quiz/report/grading/report.php: call to quiz_grading_report->display_grading_interface()
      line 97 of /mod/quiz/report.php: call to quiz_grading_report->display()

       

       

        1. image-2019-06-06-08-49-05-224.png
          64 kB
          Janelle Barcega
        2. Screen Shot 2019-05-28 at 16.04.30.png
          408 kB
          Thom Rawson
        3. Screen Shot 2019-05-28 at 16.04.41.png
          117 kB
          Thom Rawson

            timhunt Tim Hunt
            tallthom Thom Rawson
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Adrian Greeve Adrian Greeve
            Janelle Barcega Janelle Barcega
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 25 minutes
                1h 25m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.