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

Quiz error when using Outcomes and Activity Completion

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Under Site Admin > Advanced Features enabled Outcomes and Completion tracking
      2. Go into a course as a teacher
      3. Under Course Admin > Edit settings enable completion tracking
      4. Under Course Admin > Outcomes add a new outcome
      5. Create a quiz
        1. Under Outcomes, select the outcome you created
        2. Under Activity completion, set Completion tracking to "Show activity as complete when conditions are met" and set "require passing grade"
        3. Click save and display
        4. Add a multiple choice question with one answer that is worth 100% and one that is worth 0%
      6. Go into the gradebook's "Categories and Items" page
      7. Edit the settings for the grade item of the quiz
      8. Set a grade to pass of 5 and save
      9. Login as a student in the same course
      10. Attempt the quiz, select the answer that is not correct
      11. Submit all and finish the quiz
      12. Go to the course main page and confirm that the checkbox to the right of the quiz is empty (not complete)
      13. Go back into the quiz and reattempt
      14. Select the answer that is not correct, submit all and finish the quiz
      15. Go to the course main page and confirm that the quiz shows as complete (checkbox marked)
      Show
      Under Site Admin > Advanced Features enabled Outcomes and Completion tracking Go into a course as a teacher Under Course Admin > Edit settings enable completion tracking Under Course Admin > Outcomes add a new outcome Create a quiz Under Outcomes, select the outcome you created Under Activity completion, set Completion tracking to "Show activity as complete when conditions are met" and set "require passing grade" Click save and display Add a multiple choice question with one answer that is worth 100% and one that is worth 0% Go into the gradebook's "Categories and Items" page Edit the settings for the grade item of the quiz Set a grade to pass of 5 and save Login as a student in the same course Attempt the quiz, select the answer that is not correct Submit all and finish the quiz Go to the course main page and confirm that the checkbox to the right of the quiz is empty (not complete) Go back into the quiz and reattempt Select the answer that is not correct, submit all and finish the quiz Go to the course main page and confirm that the quiz shows as complete (checkbox marked)
    • Affected Branches:
      MOODLE_28_STABLE
    • Fixed Branches:
      MOODLE_28_STABLE
    • Pull Master Branch:
      MDL-49160-master

      Description

      If you have outcomes enabled for a quiz, and you activate activity completion - passing grade, when the completes the quiz (or a teacher goes to manually grade items), the error "Found more than one record in fetch() !" is thrown.

      This is because quiz_get_completion_state does not provide enough restrictions on grade_item::fetch to make sure it is getting the true grade item, not the outcome grade items.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                emerrill Eric Merrill
                Reporter:
                emerrill Eric Merrill
                Peer reviewer:
                John Okely
                Integrator:
                Dan Poltawski
                Tester:
                Simey Lameze
                Participants:
                Component watchers:
                Sam Marshall, Amaia Anabitarte, Carlos Escobedo, Sara Arjona (@sarjona), Víctor Déniz Falcón, Damyon Wiese, Jean-Philippe Gaudreau, Steve Massicotte, Serge Gauthier, Issam Taboubi, Adrian Greeve, Mihail Geshoski, Peter Dias, Tim Hunt, Andrew Nicols, Mathew May, Michael Hawkins, Shamim Rezaie, Simey Lameze
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  9/Mar/15