I created a plugin for Moodle that allows teachers to grade assignments by scanning a QR code with an app. To use the app I must create a token for the user, and I must also assign a role that allows them to use the associated web service at the system level. I've tried assigning the role at the course level, but it doesn't work. That's unfortunate, because some teachers are also students in another course and granting them the ability to use their token system wide essentially gives them the ability to grade their own assignments. Is there any way to grant access in such a way that teachers can only use their token in classes they teach?
The plugin is: https://github.com/mbbackus/moodle-mod_qrcode
I can also provide the app along with source code if that will help.