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

A teacher trying to remove a submission without having the relevant capability encounters an error

    XMLWordPrintable

Details

    • MOODLE_37_STABLE, MOODLE_38_STABLE
    • MOODLE_37_STABLE, MOODLE_38_STABLE
    • MDL-65956-master-1
    • Hide

       Test 1 (Teacher missing mod/assign:editothersubmission capability)

      1. Log in as an Admin.
      2. Create a Course.
      3. Enrol a Teacher and 2 Students (Student1, Student2).
      4. Create an Assignment activity in the Course.
      5. Go to Site administration > Users > Permissions > Define roles
      6. Edit the Teacher role
        1. make sure the mod/assign:editothersubmission capability is disabled
      7. Log in as Student1
      8. Go to the Assignment.
        1. Add a Submission.
      9. Log in as Student2
      10. Go to the Assignment.
        1. Add a Submission.
      11. Log in as Teacher.
      12. Go to the Assignment > View all submissions
        1. make sure for each Student in the grading table, the "Remove submission" option IS NOT available in the "Edit" dropdown menu.
        2. make sure the "Remove submission" option IS NOT available in the bulk actions select element.

       Test 2 (Teacher has mod/assign:editothersubmission capability)

      1. Log in as an Admin.
      2. Create a Course.
      3. Enrol a Teacher and 2 Students (Student1, Student2).
      4. Create an Assignment activity in the Course.
      5. Go to Site administration > Users > Permissions > Define roles
      6. Edit the Teacher role
        1. make sure the mod/assign:editothersubmission capability is enabled
      7. Log in as Student1
      8. Go to the Assignment.
        1. Add a Submission.
      9. Log in as Student2
      10. Go to the Assignment.
        1. Add a Submission.
      11. Log in as Teacher.
      12. Go to the Assignment > View all submissions
        1. make sure for each Student in the grading table, the "Remove submission" option IS available in the "Edit" dropdown menu.
        2. make sure the "Remove submission" option IS available in the bulk actions select element.
      13. Select all Students in the grading table and attempt to bulk remove the submissions by selecting the 'Remove submission' from the bulk actions select element.
        1. make sure the submissions of Student1 and Student2 are removed and no notification messages are being displayed.

       Test 3 (Bulk remove submissions in assignment in separate groups mode)

      1. Log in as an Admin.
      2. Create a Course.
      3. Enrol a Teacher and 2 Students (Student1, Student2).
      4. Create an Assignment activity in the Course.
      5. Go to Site administration > Users > Permissions > Define roles
      6. Edit the Teacher role
        1. make sure the mod/assign:editothersubmission capability is enabled
      7. Edit the Assignment
        1. set Group mode = 'Separate groups' in Common module settings
      8. Log in as Student1
      9. Go to the Assignment.
        1. Add a Submission.
      10. Log in as Student2
      11. Go to the Assignment.
        1. Add a Submission.
      12. Log in as Teacher.
      13. Go to the Assignment > View all submissions
        1. make sure for each Student in the grading table, the "Remove submission" option IS NOT available in the "Edit" dropdown menu.
        2. make sure the "Remove submission" option IS available in the bulk actions select element.
      14. Select all Students in the grading table and attempt to bulk remove the submissions by selecting the 'Remove submission' from the bulk actions select element.
        1. make sure a notification is displayed stating that the submission of Student1 and Student2 cannot be removed.
      15. Go to the Course Participants page.
      16. Create a Group in the Course and add Student1 and Student2 into the Group.
      17. Go to the Assignment > View all submissions
        1. make sure for each Student in the grading table, the "Remove submission" option IS available in the "Edit" dropdown menu.
        2. make sure the "Remove submission" option IS available in the bulk actions select element.
      18. Select all Students in the grading table and attempt to bulk remove the submissions by selecting the 'Remove submission' from the bulk actions select element.
        1. make sure the submissions of Student1 and Student2 is removed.
      Show
        Test 1 (Teacher missing mod/assign:editothersubmission capability) Log in as an Admin. Create a Course. Enrol a Teacher and 2 Students (Student1, Student2). Create an Assignment activity in the Course. Go to Site administration > Users > Permissions > Define roles Edit the Teacher role make sure the mod/assign:editothersubmission capability is disabled Log in as Student1 Go to the Assignment. Add a Submission. Log in as Student2 Go to the Assignment. Add a Submission. Log in as Teacher. Go to the Assignment > View all submissions make sure for each Student in the grading table, the "Remove submission" option IS NOT available in the "Edit" dropdown menu . make sure the   "Remove submission" option IS NOT available in the bulk actions select element.   Test 2 (Teacher has mod/assign:editothersubmission capability) Log in as an Admin. Create a Course. Enrol a Teacher and 2 Students (Student1, Student2). Create an Assignment activity in the Course. Go to Site administration > Users > Permissions > Define roles Edit the Teacher role make sure the mod/assign:editothersubmission capability is enabled Log in as Student1 Go to the Assignment. Add a Submission. Log in as Student2 Go to the Assignment. Add a Submission. Log in as Teacher. Go to the Assignment > View all submissions make sure for each Student in the grading table, the "Remove submission" option IS available in the "Edit" dropdown menu . make sure the   "Remove submission" option IS available in the bulk actions select element. Select all Students in the grading table and attempt to bulk remove the submissions by selecting the 'Remove submission' from the bulk actions select element. make sure the submissions of Student1 and Student2 are removed and no notification messages are being displayed .   Test 3 (Bulk remove submissions in assignment in separate groups mode) Log in as an Admin. Create a Course. Enrol a Teacher and 2 Students (Student1, Student2). Create an Assignment activity in the Course. Go to Site administration > Users > Permissions > Define roles Edit the Teacher role make sure the mod/assign:editothersubmission capability is enabled Edit the Assignment set Group mode = 'Separate groups' in Common module settings Log in as Student1 Go to the Assignment. Add a Submission. Log in as Student2 Go to the Assignment. Add a Submission. Log in as Teacher. Go to the Assignment > View all submissions make sure for each Student in the grading table, the "Remove submission" option IS NOT available in the "Edit" dropdown menu . make sure the   "Remove submission" option IS available in the bulk actions select element. Select all Students in the grading table and attempt to bulk remove the submissions by selecting the 'Remove submission' from the bulk actions select element. make sure a notification is displayed stating that the submission of Student1 and Student2 cannot be removed. Go to the Course Participants page. Create a Group in the Course and add Student1 and Student2 into the Group. Go to the Assignment > View all submissions make sure for each Student in the grading table, the "Remove submission" option IS available in the "Edit" dropdown menu . make sure the   "Remove submission" option IS available in the bulk actions select element. Select all Students in the grading table and attempt to bulk remove the submissions by selecting the 'Remove submission' from the bulk actions select element. make sure the submissions of Student1 and Student2 is removed.

    Description

      Repro steps

      1. Login as an admin and verified that the "Teacher" role doe NOT have the capbility "Edit another student's submission" (mod/assign:editothersubmission).
      2. Login as a teacher.
      3. Create an assignment in your course.
      4. Login as a student and submit a paper to the assignment activity.
      5. Login as a teacher and view the submission table.
      6. Go the row of the student that submitted the paper.
      7. Go to the "Edit" column. # Click on the "Edit", and verify that you do NOT have the option "Remove submission" in the selected menu.
      8. Mark the relevant student row using the checkbox at its beginning.
      9. Click the "With Selected..." dropdown that is located under the submission table.
      10. From the dropdown, choose "Remove submission".
      11. Click on the "Go" button that is located on the side of the dropdown.

       

      Expected Results

      The submission should be removed, and if the user (teacher) doesn't have the required capability, a proper message should be displayed.

      Actual Results

      The submission is not removed, and instead the user is presented with a page that displays the text "error/nopermission" and link to the following page: https://docs.moodle.org/37/en/error/moodle/nopermission

      which does not exist yet.

       

      Problem

      If the user does NOT have the mod/assign:editothersubmission capability, expectedly he's not presented with the "Remove submission" problem in the "Edit" menu, but unexpectedly he can still choose it from the "With Selected..." dropdown. It seems like a bug, but maybe I'm missing something.

      Attachments

        Issue Links

          Activity

            People

              Geshoski Mihail Geshoski
              AcquaAlta Acqua Alta
              Dmitrii Metelkin Dmitrii Metelkin
              Jun Pataleta Jun Pataleta
              Gladys Basiana Gladys Basiana
              Adrian Greeve, Ilya Tregubov, Kevin Percy, Mathew May, Mihail Geshoski, Shamim Rezaie
              Votes:
              7 Vote for this issue
              Watchers:
              14 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                13/Jan/20

                Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 day, 3 hours, 50 minutes
                  1d 3h 50m