Non-admin site-level users receiving assignment notification e-mails.

Non-admin site-level users receiving assignment notification e-mails.

by Miriam R -
Number of replies: 8
We have a custom role for our User Support Center that is similar to administrator, but lacks most of the system-wide privileges. These users need to be able to behave like teachers in any course without actually being enrolled in courses.

However, these users are considered members of the course for certain instances (choices, groups/groupings, participants lists, locally assigned roles for activities, and the recent activity block). The User Support Center role is a hidden assignment to minimize these appearances.

However, if the site-wide role is hidden (and only if), when a teacher enables "Send e-mail notifications to teachers" in an assignment, anyone with the User Support Center role receives notification e-mails.

The only thing remotely like a fix that we've found is to disable the e-mail address of anyone with a User Support Center role, but we would like to enroll these users in a course and have them receive e-mails.

Is anyone else having this problem? Do you have a better solution for it?
Average of ratings: -
In reply to Miriam R

Re: Non-admin site-level users receiving assignment notification e-mails.

by ben reynolds -
Hi Miriam,
Our solution was to create a second instance of Moodle.

On the second instance, we have a classroom for all instructors on the first instance, and we are building a knowledge base safe from non-instructor, non-admin users' eyes. Email is enabled on the second instance, and whether to enable on the first is at the option of each user.

You can put the second instance on the same server, but be sure to backup regularly so you save the (I'm guess you are building) knowledge base if something blows up the server.
In reply to ben reynolds

Re: Non-admin site-level users receiving assignment notification e-mails.

by Caroline Moore -
Hi Ben,

That's a great suggestion, but unfortunately it won't work for our purpose. Our User Support Center users need to be able to access all of the live courses on the production server in order to support our faculty members, so the system-level role needs to be on the production server.

Thanks for the suggestion, though!
~Caroline
In reply to Miriam R

Re: Non-admin site-level users receiving assignment notification e-mails.

by Mike Worth -
I had a similar thing happen, I gave head of departments access into all course including the ability to grade work (It seems to be the only way for them to be able to see submitted work).

What happens is that the assignment module emails anyone who can grade the work; what I did was change the code such that another permission was checked:

diff moodle-clean/moodle/mod/assignment/lib.php moodle-dev/mod/assignment/lib.php
1621c1621
< $graders[$t->id] = $t;
---
> if (has_capability('moodle/course:enrolled',$this->context,$t->id))$graders[$t->id] = $t;
1632c1632
< $graders[$t->id] = $t;
---
> if (has_capability('moodle/course:enrolled',$this->context,$t->id)) $graders[$t->id] = $t;
1641c1641
< $graders[$t->id] = $t;
---
> if (has_capability('moodle/course:enrolled',$this->context,$t->id))$graders[$t->id] = $t;


You won't be able to check course:enrolled as that's another change I made (MDL-11798), but you can check another permission that real teachers have but support users don't

Mike
Average of ratings: Useful (1)
In reply to Mike Worth

Re: Non-admin site-level users receiving assignment notification e-mails.

by Caroline Moore -
Hi Mike,

That's a great idea; thanks for the diff file. Unfortunately, our User Support Center users have the same capabilities as Teachers within courses so that they can best support our instructors.

What I've done in another circumstance is to tell Moodle to ignore the higher-than-course-level contexts (category and system). I'll look into doing that in this case, too. Anyone know of a good Moodle function to do that so I don't have to hack it?

~Caroline
In reply to Caroline Moore

Re: Non-admin site-level users receiving assignment notification e-mails.

by Mike Worth -
You could always use !has_capability('somethingonlysupportusersdhave'...

Or are your support users just assigned the teacher role in the system context?

Mike
In reply to Mike Worth

Re: Non-admin site-level users receiving assignment notification e-mails.

by Anthony Borrow -
Picture of Core developers Picture of Plugin developers Picture of Testers
Mike's observations are good, we probably should do more to check who gets the teacher email notifications. This is related to MDL-19263 should others wish to comment or vote on this issue. I've listed a couple of possible workarounds until it gets fixed. Peace - Anthony
In reply to Miriam R

Re: Non-admin site-level users receiving assignment notification e-mails.

by Caroline Moore -
We did further testing and discovered that this issue is not limited to hidden role assignments after all. It is true for all site-level or category-level users with the capability to grade assignments.

Our User Support role has this capability so they can walk users through grading an assignment, but I may have to disallow this capability to prevent them from getting dozens of emails.
In reply to Caroline Moore

Re: Non-admin site-level users receiving assignment notification e-mails.

by Andreas Vollmer -
Hi Caroline,

we created a role with capability "doanything" and everything else "not set" but notifications, which are "prevented" (i.e. forum:initialsubscriptions, feedback:receivemail, quiz:emailconfirmsubmission, quiz:emailnotifysubmission).

This role is assigned on category-level (not site-wide), so the support is able to access and assist quickly every course. The support team is also assigned a second role on site-level, which (obviously) excludes "doanything" but allows access to users profiles.

For some reason, we do not receive postings from assignments (but actually reminders of scheduled unenrolments, which is fortunately not that often).

Best,
Andreas