Managing users in a course using groups

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.

Student view

Student view – only topics 1, 3 and 4 are visible

Admin view

Admin view – all 4 topics are visible

Briefly I did the following:

  1. Created a new course format based on the Topic format
  2. Wrote a little code that cleans up the topic summary, checks the users role in the course, and does one or two other things
  3. Created the course as normal, but used tags in the summary field
  4. Introduction (all) – allowed all users to see the topic
  5. Expenses (groupA) – was only visible to members in groupA
  6. 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.

Leave a Reply

Your email address will not be published. Required fields are marked *