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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.6 regressions, 3.6.4
    • Fix Version/s: 3.6.5, 3.7.1
    • Component/s: Quiz
    • Labels:
    • Testing Instructions:
      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.
    • Affected Branches:
      MOODLE_36_STABLE
    • Fixed Branches:
      MOODLE_36_STABLE, MOODLE_37_STABLE
    • Pull 3.7 Branch:
    • Pull Master Branch:

      Description

      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()

       

       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              timhunt Tim Hunt
              Reporter:
              tallthom Thom Rawson
              Peer reviewer:
              Eloy Lafuente (stronk7)
              Integrator:
              Adrian Greeve
              Tester:
              Janelle Barcega
              Participants:
              Component watchers:
              Tim Hunt, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                8/Jul/19

                  Time Tracking

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