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

Calendar wrongly shows overrides for groups it should not be able to access

XMLWordPrintable

    • MOODLE_403_STABLE, MOODLE_404_STABLE
    • MOODLE_403_STABLE, MOODLE_404_STABLE
    • MDL-81272-403
    • MDL-81272-404
    • MDL-81272-main
    • Hide

      Covered by newly created PHPUnit

      Manual testing as below

      Initial setup

      1. Navigate to Site Administration> Users > Define roles.
      2. Edit the Teacher role.
      3. Filter the moodle/site:accessallgroups
      4. Uncheck the Allow checkbox.
      5. Save changes.
      6. Create 4 accounts called: s1, s2, t1, and t2.
      7. Create 2 courses called C1 and C2 with
        • Group mode: Separate groups
        • Force group mode: Yes
      8. Enrol s1 as a student to C1.
      9. Enrol t1 as a teacher to C1.
      10. Create a group called G1 in C1.
      11. Add s1 and t1 to G1 group C1 course.
      12. Enrol s1 and s2 as students to C2.
      13. Enrol t1 and t2 as teachers to C2.
      14. Create a group called G1 in C2.
      15. Create a group called G2 in C2.
      16. Add s1 and t1 to G1 group in C2 course.
      17. Add s2 and t2 to G2 group in C2 course.
      18. Create a Quiz activity called C1-Q1 in a C1 course: Open: Today, Close: 5 days later.
      19. Create a Quiz activity called C2-Q1 in a C2 course: Open: Today, Close: 5 days later.

      Testing

      1. Login as t1.
      2. Navigate to C1.
      3. Navigate to C1-Q1 Quiz.
      4. Click More > Overrides.
      5. Change the tertiary navigation to Group overrides.
      6. Click the Add group override button.
        • Group: G1.
        • Open the Quiz: +1 day.
        • Close the Quiz: +1 day
      7. Save.
      8. Navigate to C2.
      9. Navigate to C2-Q1 Quiz.
      10. Click More > Overrides.
      11. Change the tertiary navigation to Group overrides.
      12. Click the Add group override button.
        • Group: G1.
        • Open the Quiz: +1 day.
        • Close the Quiz: +1 day
      13. Navigate to Dashboard.
      14. Verify in the Calendar block:
        1. Verify that you will see C1-Q1 - G1 opens event.
        2. Verify that you will see C2-Q1 - G1 opens event.
        3. Verify that you will see C1-Q1 - G1 closes event.
        4. Verify that you will see C2-Q1 - G1 closes event.
      15. Log in as t2.
      16. Navigate to Dashboard
      17. Verify in the Calendar block:
        1. Verify that you will not see C1-Q1 - G1 opens event.
        2. Verify that you will not see C2-Q1 - G1 opens event.
        3. Verify that you will not see C1-Q1 - G1 closes event.
        4. Verify that you will not see C2-Q1 - G1 closes event.
        5. Verify that you will see C2-Q1 opens event (The original date)
        6. Verify that you will see C2-Q1 closes event (The original date)
      Show
      Covered by newly created PHPUnit Manual testing as below Initial setup Navigate to Site Administration> Users > Define roles. Edit the Teacher role. Filter the moodle/site:accessallgroups Uncheck the Allow checkbox. Save changes. Create 4 accounts called: s1 , s2 , t1 , and t2 . Create 2 courses called C1 and C2 with Group mode: Separate groups Force group mode: Yes Enrol s1 as a student to C1 . Enrol t1 as a teacher to C1 . Create a group called G1 in C1 . Add s1 and t1 to G1 group C1 course. Enrol s1 and s2 as students to C2 . Enrol t1 and t2 as teachers to C2 . Create a group called G1 in C2 . Create a group called G2 in C2 . Add s1 and t1 to G1 group in C2 course. Add s2 and t2 to G2 group in C2 course. Create a Quiz activity called C1-Q1 in a C1 course: Open: Today , Close: 5 days later . Create a Quiz activity called C2-Q1 in a C2 course: Open: Today , Close: 5 days later . Testing Login as t1 . Navigate to C1. Navigate to C1-Q1 Quiz. Click More > Overrides. Change the tertiary navigation to Group overrides. Click the Add group override button. Group: G1. Open the Quiz: +1 day. Close the Quiz: +1 day Save. Navigate to C2. Navigate to C2-Q1 Quiz. Click More > Overrides. Change the tertiary navigation to Group overrides. Click the Add group override button. Group: G1. Open the Quiz: +1 day. Close the Quiz: +1 day Navigate to Dashboard. Verify in the Calendar block: Verify that you will see C1-Q1 - G1 opens event. Verify that you will see C2-Q1 - G1 opens event. Verify that you will see C1-Q1 - G1 closes event. Verify that you will see C2-Q1 - G1 closes event. Log in as t2 . Navigate to Dashboard Verify in the Calendar block: Verify that you will not see C1-Q1 - G1 opens event. Verify that you will not see C2-Q1 - G1 opens event. Verify that you will not see C1-Q1 - G1 closes event. Verify that you will not see C2-Q1 - G1 closes event. Verify that you will see C2-Q1 opens event ( The original date ) Verify that you will see C2-Q1 closes event ( The original date )
    • 2
    • Team Hedgehog 2024 Sprint 2.3, Team Hedgehog 2024 Review 2

      Hi all,

      When a teacher (permission: moodle/site:accessallgroups not allowed ) enrolled to only one course (setting: group mode: seperate groups , force group mode: yes), it's calendar wrongly shows the others overrides events even overlapped with its events , while teachers in more than one course shows a correct ovrieds groups events.

      I checked the Code (find attached image), found that:
      when $courseeventfrom (the number of courses which teacher enrolled) ==1 , then groups_get_all_groups bring all groups inside the course even the unrelated others groups,

       

      here are the cenario:

      Model 4.0.9 4.1 4.2 4.3
      1- created 2 courses , C1 , C2 (setting: group mode: seperate groups , force group mode: yes)
      2- created 2 teachers t1 , t2 (permission: moodle/site:accessallgroups not allowed )
      3- created 2 students s1 , s2

      4- inside C1, created 1 group G1 (t1, s1)
      5- inside C2 created 2 groups G1(t1, s1) G2 (t2, s2)

      6- C1 hase a quiz C1-Q1
      7- C2 hase a quiz C2-Q1

      8- teacher 1 (t1) added overrides groups C1-G1 event on C1-Q1
      9- teacher 1 (t1) added overrides groups C2-G1 event on C2-Q1

      then, when teacher 1 (t1 enrolled to C1 and C2) went to Dashboard, its calendar contains 4 Events(which is good and correct):

      C1_Q1 - C1-G1 opens
      C1_Q1 - C1-G1 close
      C2_Q1 - C2-G1 opens
      C2_Q1 - C2-G1 close

      but when teacher t2 (t2 enrolled to C2 only) went to Dashboard, its Calendar shows a wrong events (the events of others group C2-G1 from course C2)
      C2_Q1 - C2-G1 opens
      C2_Q1 - C2-G1 close

      10- if we enrolled teacher t2 to first course C1( now t2 enrolled to C1 and C2) : then t2 Dashboard Calendar shows Nothing( which is right and correct)

            huongn@moodle.com Huong Nguyen
            kflihan Khaled Flihan
            Meirza Meirza
            Andrew Lyons Andrew Lyons
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

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

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