How a Teacher change role to Student but forbid (deny) enroll students

How a Teacher change role to Student but forbid (deny) enroll students

by Raul Hernandez -
Number of replies: 4
Hi Everybody,

I Just upgraded to Moodle 1.9.3 and i cant figure it out how to do this:

I Have "Teachers Role" who need to use the option "Change Role to Student" so they can have the view of their courses like students.

But Then i would like to Deny them the possibility to assign students to their courses since i manage to enroll students centrally using sql scripts.

Everytime i change moodle/role:assign to "allow" they can switch to students view normally but they also have the ability to enroll students.

If i deny this option they cant enroll students but they can not view their courses as students.

I have been playing around with some other options in conjunction but i cant seem to make it work as i want.

Any suggestions?

Thanks in Advance
Average of ratings: -
In reply to Raul Hernandez

Re: How a Teacher change role to Student but forbid (deny) enroll students

by Mary Parke -
Hmm...you seem to have a few issues here -

- one can be fixed with a "deny access" role...I think,
- another is a setting at the site level
- and a setting at the course level
- also there is simply using the "student" view in a course.



Okay, let's go in reverse order:

STUDENT VIEW
Faculty can view their own course as a student simply by clicking on the "change role to" and selecting "Student" at the top right of their course homepage. This allows all faculty to see the course as a student and take activities as students - provided that 1) the course is available to students (course settings - availability) AND 2) the course start date is current AND 3) the activity is opened for the date they're trying to test it (they can play with the dates in the course and then change their view to "student"). The ONLY thing they won't see as a student is the gradebook because anything they do in student view is NOT saved, but they see the instructions they've posted, their content, and how to interact with the activity.

SITE CONFIGURATION

Generally, I set Users>Authentication>Manage Authentication - Common Settings for Self-registration to "Disable". Especially if I'm in charge of enrollment.

You might want to investigate Courses>Enrollment>Internal enrollment settings...or External Database settings (if you use this)...

It seems your greatest problem if you don't allow self-registration is faculty going into their course and adding existing users to their course through the assign roles menu in Administration. However, if you let them know that doing this will screw up any "sync" you have in process, then they might not do this....depends on a lot of factors.

COURSE SETTINGS
If you're using internal enrollment as your default or even external database, then the enrollment settings are managed through these modules and if they are changed at the course level they shouldn't effect your loads via flat file...I think - you may want to investigate your enrollment settings.

Deny Access Role


Create a new role called "Deny access".

Do this by copying the guest role and changing the "viewcourses" ability to "prevent". Make sure that after you've created the new role, you assign the ability to use this role to your faculty (teacher role, TA role, any other faculty roles you have on the system).

I post this in the description of the role when I create it:

Faculty: If you assign a student to this role, you essentially deny him/her access to your course. The student remains assigned to the "student" role, but you also assign them to this "deny access" role as well. Once you've done this, the student will no longer see your course when he/she next logs in to your course.

If you assign a student to this role, EMAIL the student and explain WHY s/he cannot access your course and what they need to do to regain access. Once the student has contacted you and arrangements have been made, simply return to Roles in your course and remove the student from the "Deny Access" role. The student will have to log out and log back into the system again to see your course.


How faculty then actually use this role (instructions) are below:

To assign a student to the deny access role:

1. Go to your course.
2. Click on "Assign Roles" from your course administration block.
3. Click on "Deny Access"
4. Find the name of the student in the list at the right, highlight their name (click on it), and click on "Add" in the middle of the screen to assign this user to the role (the name will appear now in the list at the left).

Warning: If you assign a student to this role, you essentially deny him/her access to your course. The student remains assigned to the "student" role, but you also assign them to this "deny access" role as well. Once you've done this, the student will no longer see your course when he/she next logs in to your course. If you assign a student to this role, EMAIL the student and explain WHY s/he cannot access your course and what they need to do to regain access. Once the student has contacted you and arrangements have been made, simply return to Roles in your course and remove the student from the "Deny Access" role. The student will have to log out and log back into the system again to see your course.
Average of ratings: Useful (1)
In reply to Mary Parke

Re: How a Teacher change role to Student but forbid (deny) enroll students

by Raul Hernandez -
Thanks for your answer mary.

Figured it out! I use a php script to protect the "assign.php" page in admin->roles and that way when faculty try to add students they are requiered to put a user and password that only admins know therefore they cant see the page when roles are assigned.

see the attach in this post for the password protect php code.


In reply to Raul Hernandez

Re: How a Teacher change role to Student but forbid (deny) enroll students

by Mary Parke -
Wow. That's cool! I can't test it on our CCSF servers, but I may just test it on my own server (where I do my own testing of new Moodle stuff!).

Thanks Raul!

- Mary
In reply to Raul Hernandez

Re: How a Teacher change role to Student but forbid (deny) enroll students

by Susana L. -

Hi, I have exactly the same problem on Moodle 1.9.13
I don't understand what assign has to do with change role smile..

I also changed admin/roles/assign.php. Added the following piece of code:

    $user_role = get_user_roles_in_context($USER->id, $context, $view=true);
    if (strpos($user_role,'Teacher')) {
        error ('Sorry, you can not assign users!',"$CFG->wwwroot/course/view.php?id=$course->id");
    }