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

Quiz: report delete_selected_attempts notice when a user has multiple enrolments

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Login as admin
      2. Set "debug" to developer level and enable "debugdisplay"
      3. Create a new role ( Site administration > Users > Permissions > Define roles > Add a new role) which allows these two capabilities: mod/quiz:attempt and mod/quiz:reviewmyattempts.
      4. Create a user
      5. Create a course, with a quiz having 1 question
      6. Enrol the created user with 2 roles to the created course (Student role and the new one also).
      7. Login as that user and complete the Quiz.
      8. Login as admin.
      9. Go to any Quiz reports (Grade, Response).
      10. Select the attempt of that user and delete that attempt.
      11. Verify that there isn't any error like the one shown in the description of the issue.
      Show
      Login as admin Set "debug" to developer level and enable "debugdisplay" Create a new role ( Site administration > Users > Permissions > Define roles > Add a new role) which allows these two capabilities:  mod/quiz:attempt and mod/quiz:reviewmyattempts . Create a user Create a course, with a quiz having 1 question Enrol the created user with 2 roles to the created course (Student role and the new one also). Login as that user and complete the Quiz. Login as admin. Go to any Quiz reports (Grade, Response). Select the attempt of that user and delete that attempt. Verify that there isn't any error like the one shown in the description of the issue.
    • Affected Branches:
      MOODLE_37_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE
    • Fixed Branches:
      MOODLE_37_STABLE, MOODLE_38_STABLE
    • Pull from Repository:
    • Pull 3.7 Branch:
    • Pull 3.8 Branch:
    • Pull Master Branch:
      MDL-67942-master

      Description

      In quiz attempt report, if you delete an attempt which belongs to a user that was enrolled in more than one role, you will get the error:

       

      Did you remember to make the first column something unique in your call to get_records? Duplicate value 'xxxx' found in column 'id'.

       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              HuongNV Huong Nguyen
              Reporter:
              HuongNV Huong Nguyen
              Peer reviewer:
              Tim Hunt
              Integrator:
              Eloy Lafuente (stronk7)
              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:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                9/Mar/20

                  Time Tracking

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