On our installation of Moodle, students are enrolled on courses and have a course tutor but they also have a "supervisor" who meets with them regularly to monitor their vocational voluntary work while in training and gives them advice on their voluntary professional work and on the course in general, so akin to a personal tutor.
Assignment of supervisors to their supervisees is done through a customised "parent" role in the context of the user.
The supervisor needs to be able to view all grades for their supervisee, which I've been able to do via a front-page block thanks to the My Mentees Plugin, however the other requirement is that they also need to be able to grade some of their supervisees assignments related to vocational work they are supervising.
For a course with 20 students, there will be one course tutor, but there might be 8 different supervisors for different students, who are not directly involved in the course and shouldn't have access to student identities or information other than their own supervisees. Individual supervisors will supervise students from many different courses.
I've been able to get it working using a custom role at the category level to provide basic access to the courses. The role doesn't have permission to see students details or grades so normally when they go to the grading/submissions page of the assignment they can't see any student details, however by making the supervisor the "allocated marker" for their supervisee, they can see their entry only and grade it.
This works, but for 9 assignments per course, 20 students per course and 15+ courses we're looking at over 2,500 manual allocations each year so this isn't ideal by any stretch.
Who is supervising whom is already recorded in our installation of Moodle through the "parent" role in user context which is currently doing well providing access to supervisee grades, but I'm trying to work out if there's any way with permissions or otherwise to give the supervisors access to only their supervisees in the assignment grading/submission page based on the supervisor being assigned a role in context of the user.
Sorry if that's a bit of a convoluted way of explaining or doing things. I would appreciate any advice on how to achieve this without manually allocating supervisors each year, especially because the supervisor can change mid-year and the information is already in Moodle!
Thankyou in advance