By default, enrol user only to courses and groups defined for the primary scale.
Add a plugin setting to get the old behaviour: enrol into courses and groups of all matching scales.
Refactorings:
since we already have the information about which scale is primary in the attempt data, we re-use them
There is a new method get_courses_to_enrol in attemptfeedback.php
There is a new method get_groups_to_enrol in attemptfeedback.php
These methods are only responsible for detecting the courses and groups.
Enrolment and sending of messages is still handled in the catquiz class as before.
I added attemptfeedback_test to check the course/group enrolment works as expected.
Closes #479
Refactorings: since we already have the information about which scale is primary in the attempt data, we re-use them
get_courses_to_enrol
in attemptfeedback.phpget_groups_to_enrol
in attemptfeedback.phpThese methods are only responsible for detecting the courses and groups. Enrolment and sending of messages is still handled in the
catquiz
class as before.I added
attemptfeedback_test
to check the course/group enrolment works as expected.