Prevent assigning roles after creating a course

Prevent assigning roles after creating a course

by maria ak -
Number of replies: 3
Hello. I'm using Moodle 1.9 and i have created a new role for the students. I want them to be able to create courses but not to be able to assign roles after a course has been created. I've been trying to change the capabilities for this role but i haven't solved the problem yet.

I've made the following settings:
Legacy role type -> none
role:assign -> prevent
role:override -> prevent
role:manage -> prevent
role:switchroles prevent

Am i missing something?

I would really appreciate some help, please.
Average of ratings: -
In reply to maria ak

Re: Prevent assigning roles after creating a course

by John Isner -
You didn't say what role you want students to have in the courses they create. Will they have Student or Teacher role? That's a key question. The answer depends on it.
In reply to John Isner

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

by maria ak -
I'm sorry. When a student creates a course he becomes a teacher.
In reply to maria ak

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

by John Isner -
  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)