Hide
Overrides primer
Overrides are kind of a mess in Moodle. There are 3 course modules that implement them: Assign, lesson and quiz. The general idea is that you can have user and group level overrides for the various module dates (e.g., open, close). The golden rule is that a user override should trump everything, but there are still some unusual resolution rules for groups. For example you can create two groups, and put the same user in both of them - in this situation, if you add an override for both of those groups, what date should the student who is in both groups see? The answer is: it depends. In lesson and quiz, the strategy is to go with the most lenient dates, so in the case that both groups define an "open date" override, we should use the earliest possible date, or if both define a "close date" we should use the latest possible date.
Assign, however, doesn't play by the rules, it's a loose cannon. For assign, group overrides can be moved up and down on the overrides page - the correct behaviour is that the override higher in the list should take priority.
Upgrade path tests
34f5a23e6abd87a6925439f1ad9299590d977b61 → integration
- Install moodle from the 34f5a23e6abd87a6925439f1ad9299590d977b61 commit
- Add user and group overrides for lesson, quiz and assign
- Check the DB and you should see the user overrides have priority 9999999 and the assign group overrides have priorities based on their sort order
- Check out integration and run the upgrade
- Rows in the DB should not change
- Run cron
- Verify that priority is now 0 for all user overrides
master → integration
- Install moodle from latest master
- Add user and group overrides for lesson, quiz and assign
- Check the DB and you should see the user overrides have priority 0 and the assign group overrides have priorities based on their sort order
- Check out integration and run the upgrade
- Rows in the DB should not change
- Run cron
- Verify that priority is still 0 for all user overrides
Functional tests
Setup
- A user, U1 in a course
- Two groups, G1 and G2 in the course, both with U1 in them
Quiz test
- Create a quiz, setting all possible dates
- Add an override for both G1 and G2 - set each of the possible dates, but note down what you set and what you expect to happen based on the description above
- Verify that on the overview, calendar, and quiz page, the overrides are being displayed correctly as per the description above (i.e., due type overrides should use the date furthest away from the current time and open type overrides should use the date closest to the current date)
Lesson test
- Same as quiz (except use lesson instead of quiz obviously)
Assign test
- Create an assignment, setting each of the possible dates
- Create a group override for G1 and G2 - set each of the dates and take note of which override is at the top of the list
- Verify that in the calendar, grading table, and overview, that the override on the top of the list is the one applied (nb: there is a bug on the assignment submission page that causes it to display the wrong date, ignore that)
- Swap them around and stuff on the overrides page and make sure the change is reflected in all the appropriate places
Show
Overrides primer
Overrides are kind of a mess in Moodle. There are 3 course modules that implement them: Assign, lesson and quiz. The general idea is that you can have user and group level overrides for the various module dates (e.g., open, close). The golden rule is that a user override should trump everything, but there are still some unusual resolution rules for groups. For example you can create two groups, and put the same user in both of them - in this situation, if you add an override for both of those groups, what date should the student who is in both groups see? The answer is: it depends. In lesson and quiz, the strategy is to go with the most lenient dates, so in the case that both groups define an "open date" override, we should use the earliest possible date, or if both define a "close date" we should use the latest possible date.
Assign, however, doesn't play by the rules, it's a loose cannon. For assign, group overrides can be moved up and down on the overrides page - the correct behaviour is that the override higher in the list should take priority.
Upgrade path tests
34f5a23e6abd87a6925439f1ad9299590d977b61 → integration
Install moodle from the 34f5a23e6abd87a6925439f1ad9299590d977b61 commit
Add user and group overrides for lesson, quiz and assign
Check the DB and you should see the user overrides have priority 9999999 and the assign group overrides have priorities based on their sort order
Check out integration and run the upgrade
Rows in the DB should not change
Run cron
Verify that priority is now 0 for all user overrides
master → integration
Install moodle from latest master
Add user and group overrides for lesson, quiz and assign
Check the DB and you should see the user overrides have priority 0 and the assign group overrides have priorities based on their sort order
Check out integration and run the upgrade
Rows in the DB should not change
Run cron
Verify that priority is still 0 for all user overrides
Functional tests
Setup
A user, U1 in a course
Two groups, G1 and G2 in the course, both with U1 in them
Quiz test
Create a quiz, setting all possible dates
Add an override for both G1 and G2 - set each of the possible dates, but note down what you set and what you expect to happen based on the description above
Verify that on the overview, calendar, and quiz page, the overrides are being displayed correctly as per the description above (i.e., due type overrides should use the date furthest away from the current time and open type overrides should use the date closest to the current date)
Lesson test
Same as quiz (except use lesson instead of quiz obviously)
Assign test
Create an assignment, setting each of the possible dates
Create a group override for G1 and G2 - set each of the dates and take note of which override is at the top of the list
Verify that in the calendar, grading table, and overview, that the override on the top of the list is the one applied (nb: there is a bug on the assignment submission page that causes it to display the wrong date, ignore that)
Swap them around and stuff on the overrides page and make sure the change is reflected in all the appropriate places