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

Critical lack of quiz filtering in quiz upgrade

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • 3.0.7, 3.1.3
    • 3.0.7, 3.1.2, 3.2
    • Quiz
    • MOODLE_30_STABLE, MOODLE_31_STABLE, MOODLE_32_STABLE
    • MOODLE_30_STABLE, MOODLE_31_STABLE
    • MDL-56303-master
    • Hide

      BEFORE last weeks weekly ( a few weeks ago)

      1. Create a couple of quizzes with:
        1. Grade to pass: 0.00
        2. Completion tracking: Show activity as complete when conditions are met
        3. Select Require passing grade.
      2. Add a few multiple choice or true/false questions to the quiz.

      UPGRADE:

      1. Take the quiz made there as a student, answering all questions correctly.
      2. Return to the course home.
      3. The quiz should be marked as completed
      Show
      BEFORE last weeks weekly ( a few weeks ago) Create a couple of quizzes with: Grade to pass: 0.00 Completion tracking: Show activity as complete when conditions are met Select Require passing grade. Add a few multiple choice or true/false questions to the quiz. UPGRADE: Take the quiz made there as a student, answering all questions correctly. Return to the course home. The quiz should be marked as completed

      Reported by colin:

      The mod/quiz/db/upgrade.php entry for this ticket appears to be updating a lot more than just quiz course modules. Neither the SELECT nor the UPDATE are specific enough to include only quizzes.

          if ($oldversion < 2015111602) {
              // Find quizzes with the combination of require passing grade and grade to pass 0.
              $quizzes = $DB->get_records_sql("
                  SELECT gi.id, gi.iteminstance
                    FROM {quiz} q
              INNER JOIN {course_modules} cm ON q.id = cm.instance
              INNER JOIN {grade_items} gi ON q.id = gi.iteminstance
                   WHERE q.completionpass = 1
                     AND gi.gradepass = 0
                     AND cm.completiongradeitemnumber IS NULL");
              if ($quizzes) {
                  foreach ($quizzes as $quiz) {
                      $DB->execute("UPDATE {course_modules}
                                       SET completiongradeitemnumber = :gradeitemid
                                     WHERE instance = :quizid",
                          array('gradeitemid' => $quiz->id, 'quizid' => $quiz->iteminstance));
                  }   
              }   
      

            poltawski Dan Poltawski
            poltawski Dan Poltawski
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

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