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

Deleting quiz attempts throws error.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.7
    • Fix Version/s: 2.7
    • Component/s: Quiz
    • Labels:
    • Testing Instructions:
      Hide
      1. Create a course with at least one student enrolled.
      2. Create a quiz with a question.
      3. Log in as a student, complete the quiz and submit it.
      4. As a teacher/admin click on the quiz and click on the 'Attempts: #' link.
      5. Select the attempt and click 'Delete selected attempts'.
      6. Ensure it gets deleted with no issues.
      Show
      Create a course with at least one student enrolled. Create a quiz with a question. Log in as a student, complete the quiz and submit it. As a teacher/admin click on the quiz and click on the 'Attempts: #' link. Select the attempt and click 'Delete selected attempts'. Ensure it gets deleted with no issues.
    • Affected Branches:
      MOODLE_27_STABLE
    • Fixed Branches:
      MOODLE_27_STABLE
    • Pull Master Branch:
      MDL-45145_master

      Description

      If there are certain attempts for quiz and if teacher tries to select them and delete it deletes those attempts but gives an intermediate error.

      1.) Create a quiz with some questions and let some students attempt it.
      2.) Login as teacher. Go to reports and try to delete attempts.
      3.) Error will be shown although attempts get deleted.

      Error: Debug info: SELECT id,course FROM

      {course_modules}

      WHERE id IS NULL
      [array (
      )]
      Error code: invalidrecord
      Stack trace:
      line 1451 of /lib/dml/moodle_database.php: dml_missing_record_exception thrown
      line 1427 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select()
      line 7074 of /lib/accesslib.php: call to moodle_database->get_record()
      line 382 of /mod/quiz/locallib.php: call to context_module::instance()
      line 321 of /mod/quiz/report/attemptsreport.php: call to quiz_delete_attempt()
      line 290 of /mod/quiz/report/attemptsreport.php: call to quiz_attempts_report->delete_selected_attempts()
      line 266 of /mod/quiz/report/overview/report.php: call to quiz_attempts_report->process_actions()
      line 82 of /mod/quiz/report/overview/report.php: call to quiz_overview_report->process_actions()
      line 96 of /mod/quiz/report.php: call to quiz_overview_report->display()
      Output buffer: Notice: Undefined property: stdClass::$cmid in /var/www/vhosts/qa.moodle.net/html/mod/quiz/locallib.php on line 382

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              markn Mark Nelson
              Reporter:
              jacks92 Jayesh Anandani
              Peer reviewer:
              Tim Hunt
              Integrator:
              Dan Poltawski
              Tester:
              Sam Hemelryk
              Participants:
              Component watchers:
              Tim Hunt, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                12/May/14