Need Non-Editing Teacher-like Role that has access to courses but does NOT list in MyCourses HELP?!

Need Non-Editing Teacher-like Role that has access to courses but does NOT list in MyCourses HELP?!

by Susan Mangan -
Number of replies: 14
I've been banging my head on this one for a while ... any help would be GREATLY appreciated.

I'm trying to add a new Role at the Category Level - so for example, a Legal Studies Convenor has non-editing teacher rights to all the courses in the Legal Studies category to assist students, teachers, etc.

So I set the new Role moodle/course:view to allow.

B
ut this Legal Convenor also teaches so does not want ALL the courses listed in the My Courses block, just those he/she is a 'Teacher' in.

The only way I can see to do this is to re-create the Administrator Role, or a new role selecting: moodle/site:doanything - allow AND moodle/course:view - Prevent

However... I don't want the Role to have full editing capabilities. I tried to Prevent or Prohibit other capabilities manually but it seems that moodle/site:doanything over-rides this?

Help??

Thanks!!

Average of ratings: -
In reply to Susan Mangan

Re: Need Non-Editing Teacher-like Role that has access to courses but does NOT list in MyCourses HELP?!

by Ger Tielemans -

The problem is that the library routine that selects "my courses" does not discriminate between "my own" and "my-inhereted-by-category-role" courses. Only a programmer from Moodle Headquarter can solve this problme deep, deep in the library. 

It is a big (also performance) problem.

In reply to Susan Mangan

Re: Need Non-Editing Teacher-like Role that has access to courses but does NOT list in MyCourses HELP?!

by ben reynolds -
Hi There, Vancouver,
If I were you, I would make a separate user for the Legal Studies Convenor. When a teacher, your teacher logs in as Teacher. When a Convenor, as a Convenor.

As you know, "do anything" pretty much makes you an omniscient god, so it's difficult to blind someone who is omniscient wide eyes
In reply to ben reynolds

Re: Need Non-Editing Teacher-like Role that has access to courses but does NOT list in MyCourses HELP?!

by Susan Mangan -
Hi back, Baltimore! wink I did think of having our Legal Studies Convenor have a separate log in for that purpose but I haven't addressed it yet. I think that is a valid option though...
In reply to ben reynolds

Re: Need Non-Editing Teacher-like Role that has access to courses but does NOT list in MyCourses HELP?!

by Susan Mangan -
It's ironic though... I've been exploring more with this whole concept and even though "do anything" makes you an onmiscient god, it can in fact be blinded. Preventing course:view prevents just that. Makes me wonder what else can be prevented...? Or is that its sole achilles' heel ...
In reply to Susan Mangan

Re: Need Non-Editing Teacher-like Role that has access to courses but does NOT list in MyCourses HELP?!

by ben reynolds -
Your task, should you accept it, is to boldly go where no Moodle administrator has apparently gone before.

As with voting, please report back early and often.

If you contemplate jumping through a Stargate, ask for a rope and backup everything first.
In reply to Susan Mangan

Re: Need Non-Editing Teacher-like Role that has access to courses but does NOT list in MyCourses HELP?!

by Michael Woods -
Picture of Core developers
Hi Susan,

We faced a similar issue when we wanted our teaching staff to be able to roam in and out of other teacher's courses, without displaying 900 (!) courses in their "My Courses" list. We ended up:

1. Creating a new capability "Participate in Courses" (moodle/course:participate)
2. Set it to Allow for the roles where the courses should be listed in My Courses
3. Set it to Not Set for the roles where the courses should not be listed in My Courses (like your Legal Convenor role)
4. Alter a few lines of code to ensure the My Courses list is dependent upon a user having the "Participate" permission, rather than the "View courses" permission. I changed 2 files:

a) lib/datalib.php -> around line 937, change the capability checked to be 'moodle/course:participate'. eg:

$courses = get_user_courses_bycap($userid, 'moodle/course:participate', $accessinfo, $doanything, $sort, $fields, $limit);

b) lib/db/access.php -> between 'moodle/course:view' and 'moodle/course:bulkmessagin', add this code:

'moodle/course:participate' => array(

'captype' => 'read',
'contextlevel' => CONTEXT_COURSE
),


I believe there are plans for this sort of thing in Moodle 2.0, but we needed the solution 2 years ago, so went ahead and did it. There are probably spots in code that I've neglected, but it works for us, or at least for how we use Moodle.

Kind regards,
Michael


In reply to Michael Woods

Re: Need Non-Editing Teacher-like Role that has access to courses but does NOT list in MyCourses HELP?!

by Susan Mangan -
Michael,

Thanks so much for sharing! Very appreciated. We might give this a try...

Susan
In reply to Michael Woods

Re: Need Non-Editing Teacher-like Role that has access to courses but does NOT list in MyCourses HELP?!

by Stan Golanka -
Is there a way to create or modify a role so that users assigned that role can view any course and all student submissions, but:

1. Won't receive emails from classes
2. Cannot make changes to the classes

Our Moodle is hosted by a third party, so code changes are limited.

Thank you!

Stan
In reply to Stan Golanka

Re: Need Non-Editing Teacher-like Role that has access to courses but does NOT list in MyCourses HELP?!

by Henning Bostelmann -
Picture of Core developers Picture of Plugin developers
We're having a similar problem here (all staff need to see certain courses even if they're not the teacher there); it appears quite generic to me.

It seems that the problem can partially be fixed with hidden role assignments.

If you create a role that has the capability "moodle:course/view" (in a certain context: globally, in a category, etc.), and assign this role to somebody as a hidden role assignment, then this person can enter the course but does not get subscribed to forums.

However, they still see the course in their "my courses" list, and have the course events in their calendar, which can be annoying.

Maybe, excluding hidden role assignments from "My Courses" and from the calendar would be a performance-saving way of implementing this in Moodle 1.9?
In reply to Henning Bostelmann

Re: Need Non-Editing Teacher-like Role that has access to courses but does NOT list in MyCourses HELP?!

by Stan Golanka -

Thank you--that appears to work for the Forum subscriptions...

Besides the full course list for the administrator, the teachers still see the administrators in their assignments (unless the teacher is using groups).  I assume these are related, and fixing one would fix the other.

Unfortunately, we're already using 1.9.7, so maybe this will be a later fix?

In reply to Stan Golanka

Re: Need Non-Editing Teacher-like Role that has access to courses but does NOT list in MyCourses HELP?!

by Henning Bostelmann -
Picture of Core developers Picture of Plugin developers
Re "teachers still see the administrators in their assignments": This probably depends whether you give those users the "mod/assignment:submit" capability or not. I haven't tested it though.

Re the course list and calendar entries: I made a suggestion to exclude hidden roles in these places, but not more - I'm not one of the Moodle developers. So, as things stand, I don't think there's a forthcoming fix. However, if we agree here that excluding the hidden roles in "My courses" lists and in the calendar would be a good thing, we can open a request on the Moodle Tracker - and the more people vote on it, the more likely it will be implemented, for all I understand.
In reply to Michael Woods

Re: Need Non-Editing Teacher-like Role that has access to courses but does NOT list in MyCourses HELP?!

by Joshua Westerway -
The steps by Michael solve this issue well I think.

I added the capability to mdl_capabilities database table then added the code to lib/datalib.php and lib/db/access.php as specified, made a slight change to access.php as specified though to make role assignments / overrides clearer:

'moodle/course:participate' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'legacy' => array(
'student' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW
)
),

Then added to lang/role.php just to make it look nicer:

$string['course:participate'] = 'Participate in courses';

Edit the roles for teacher, non-edit teacher and student to allow this capability else were not set.

This works well, in the my page only courses where the user is enrolled as a teacher, non-edit teacher or student are listed, in the my courses block we use only the same course list is used (we don't really use the my page but may change now because of this fix) but with the inspector role (we call it teacher view-all) set to allow course:view but not set for course:participate allows teachers to go to moodle/course/index.php and see the course list and can get into any course to look at the techniques and resources being used by other staff members.

All in all an excellent work around. Working in Moodle 1.9.7+ (Build: 20100210).
In reply to Susan Mangan

Re: Need Non-Editing Teacher-like Role that has access to courses but does NOT list in MyCourses HELP?!

by Rochelle Goudeau -

Same problem here with non edit teacher seeing all the courses under my courses! If anyone knows a great solution please let me know