Prevent assigning roles after creating a course

Re: Απάντηση: Re: Prevent assigning roles after creating a course

by John Isner -
Number of replies: 0
  1. Choose a category for all student-created courses, say category CAT
  2. In CAT, override Teacher, setting moodle/role:assign = Not set
  3. Assign your students the role of Course creator in category CAT.
When a student creates a course, they will get an error (this is a bug and should be reported), but the course will be created successfully. Inside the course, the student will be a Teacher and will be able to turn editing on, but they will not have an Assign roles link in their Course administration block.

Notice that I said "the student" because I'm talking about a user, like "joe." I'm not talking about a role. When I refer to a role, I use an upper case letter.

So when the student (small s) logs in, he should click on category CAT. When he enters CAT he gets the role of Course creator, which allows him to create courses. When he creates a course, he is automatically assigned the Teacher role within the course. The override prevents the user (who now has two roles) from making any role assignments in the course.

The reason that you must set aside a category for student-created courses is that no user with the Teacher role will be able to assign roles in the category (at least not without doing some more work). If this is a problem, let me know and I'll give you a more elegant solution. This solution is a simple one smile

Notice that you do not need to modify any roles. All predefined roles (Teacher, Student, etc.) should be reset to their default values. Otherwise I can't guarantee this solution.

Let us know how it works out!

Average of ratings: Useful (1)