We had to create a course for a client containing a number of topics. Well that’s a pretty normal request, right. So here’s the catch. The course had to consist of a number of topics. All the users had to do the first and last topic, and depending on their job description they had to do either the second or the third topic as well.
Basically this meant controlling access to topics using groups.
Briefly I did the following:
- Created a new course format based on the Topic format
- Wrote a little code that cleans up the topic summary, checks the users role in the course, and does one or two other things
- Created the course as normal, but used tags in the summary field
- Introduction (all) – allowed all users to see the topic
- Expenses (groupA) – was only visible to members in groupA
- Created the groups calling them groupA and groupB and enrolled the users as needed
(all) automatically showed the topic to all the users and did not require a group, while the summary with the (groupName) was only visible to those group members. I used groupA and groupB but you could really have used any names, as long as the name in () matched the name of the group.
Pretty simple really. Oh, and I did this for Totara 1.9.19, but it would work in Moodle as well.
Once all that was done and working, the boss had me migrate the site – and I had to recode the solution all over again for Totara 2.4.4 ,.. and that on a F1 weekend as well.