assign different roles to same user based on time interval in one course

assign different roles to same user based on time interval in one course

by Ruth Bor -
Number of replies: 14

Hi everybody,

hope this is the right forum (I tried others but no answer there).

I have this necessity:

One course with 3 different teacher. So I know I can assign all teachers to the course with teacher role. The problem is that each teacher is responsible for  1-2 or 3 days of the entire course and at the rest of the days he has to be able only to see course/participants information but cannot change anything since it is not the assigned day for him to teach. 

Let's say I have course A and teacher ab and c.

a is teaching mon and tue

b is the teacher for wed

c is the teacher for thu and fri

I assign for ab and c the teacher role limiting it for the time interval in which they actually the teacher. I need that a will be able to see information about participants also from wed to fri when he is not the teacher. So I thought to create a special role for the days the teacher is not actually THE teacher and assign it to from wed to fri BUT I understand that I can assign few roles to same teacher but only one time interval (start time-end time) and not a time interval for each role.

Is there a way to do that? with some plugin or other solution?

Thanks!!


Average of ratings: -
In reply to Ruth Bor

Re: assign different roles to same user based on time interval in one course

by Davo Smith -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
This seems to be a very odd and specific thing to want to do (can the teachers not be trusted to simply not interact with the courses on the days they're not teaching?).

Maybe you should consider splitting into multiple courses - with teachers only assigned to courses for the students they are teaching on specific days?

But back to your original question - for something that specific, you're almost certainly going to need to hire a developer to write some custom code for you. If you don't have access to a suitable developer already, then you might want to contact a Moodle Partner to ask for a quote to develop this (for transparency, I work for a Moodle Partner).
Average of ratings: Useful (1)
In reply to Davo Smith

Re: assign different roles to same user based on time interval in one course

by Ruth Bor -
HI Davo Smith.
Thanks for answering.
I understand it can be odd what I am asking but for the structure of our courses it is crucial.
It is not coming from the thought that we dont trust the teachers. On the contrary, we would like to ease their moodle experience by showing them on home and dashboard only the courses they are assigned for as teachers for the day and to not take attendance of another teacher by mistake. Our courses have a variable duration from 1day to 4 weeks in presence and a teacher can be THE teacher the first 2 days and other 4 days in between. The teacher most of the time in one day teaches several courses at the same hours (phisically the partecipants are grouped together but on moodle they are in seperate courses because they are certified in different competencies).
I thought the best solution was to assign the role of the teacher based on time interval (ex: a is the teacher on mon, wed and fri) and create a role for the remainng days when a is not teaching these courses).
I am trying to understand what could be the best solution to organize the teachers.

Thanks for any suggestion.
In reply to Ruth Bor

Re: assign different roles to same user based on time interval in one course

by Stefan Scholz -
Picture of Plugin developers
Hi Ruth,

in order to really change roles based upon time, you’ll indeed probably need bespoke development like Davo suggested.

But maybe you could explore a solution based upon access restrictions. They do allow time based access, which could possibly help to prevent mistakes, too.

Let’s assume your teachers indeed have the role the whole time. But depending on when they should actually do something or not, you could hide the activity for them or the parent section of it?

I have not tried this myself, so I don’t know for sure if it would work, but it’s something you could experiment with.

Using access restrictions is easy and pretty standard for a moodle course.

You’ll probably need to adjust the teacher role for that purpose though - because by default, they see hidden sections and activities.

It will not have any effect on the dashboard though.

Another solution could be to explore the available enrolment methods. Maybe you have some system on place which can create, update and/or suspend enrolments?

Hope this helps!
Stefan
In reply to Ruth Bor

Re: assign different roles to same user based on time interval in one course

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
So I actually wonder if you are thinking about this wrong...that maybe you should be organizing the courses differently instead of the teacher roles...you could use a meta course for the overarching course and then create separate courses for each teacher - all the students would be grouped together in the metacourse but each teacher would only teach their part of it...see https://docs.moodle.org/311/en/Course_meta_link
Average of ratings: Useful (1)
In reply to Emma Richardson

Re: assign different roles to same user based on time interval in one course

by Stefan Scholz -
Picture of Plugin developers
I’d usually put the student first (not the teacher), but many organisations effectively build their whole system based around who teaches something anyway, meaning it’s a well known and typical logic…

If the structure makes sense for the students (too), Emma’s idea us probably one of the best. Core functionality, very robust and easy to manage.


Another idea:
Have you considered locally assigned roles? You can let the teacher be a “guest” in the course, and only assign them the teacher role in the very activities that they are really in charge of.

That might be easier, especially if the courses already exist?

I think Rick (sorry if it wasn’t you!) mentioned a while ago that there is a tracker issue for assigning roles per section, so while that’s not possible at the moment, maybe vote for it if you think it’s a good idea! (I do)

Hope this helps!
Stefan
In reply to Stefan Scholz

Re: assign different roles to same user based on time interval in one course

by Stefan Scholz -
Picture of Plugin developers
Maybe it would help to know what actually happens in these courses - I mean what are the teachers/students actually doing? Is it only taking attendance? And providing resources? Are teachers adding content on-the-fly? Do students interact with each other and need to be moderated/graded?
In reply to Stefan Scholz

Re: assign different roles to same user based on time interval in one course

by Ruth Bor -

Hi to all.

So here below is a simple scheme of how our courses are divided.

All courses has activities for teachers and students. We have a section hidden only for teacher use and contains attendance, dataform activity and a private forum. All other activities are visibile to students.

Since our courses are not months long but some are 8, 16 or 120 hours long, and the teachers programming is done every week, I think the solution to assign locally roles to activities or sections will be complicated for us. 

I will try to summarise my problem:

Teachers entering the moodle site has to see somewhere (on home page, dashboard or other dedicated page) only the courses they are enrolled to as teacher today. This will help them to know immediately the courses where they need to take attendance for example. We do not want to give them a list of participants or list of courses because it will duplicate our work. The best way is that our moodle site will show them only the courses of today.  

I cannot give them the teacher role only for the first 3 days (see course C teacher 3) because they will not be able to consult the course activities in other days (lets say they forgot to write a note or to assign a grade or attendance). In addition (see course A teacher 1 and course B teacher3) if I will give the teacher role for the first day or 2 I will have to enter again thursday and assign all over again the teacher role to the first teacher since there is no possibility to assign a role for a determined interval of time and for several times. So, my question was based on that: I will create another role and assign that role to the teachers that in certain interval of time are not THE teachers. These teachers will be able to see all courses from the mycourses menu but on home page or dashboard or some other page they will see only the courses they are in charge of for today (with some filtering). 

With groups I can solve the problem of 2 teachers on the same day by assigning each and relative students to a separate group. But when the same teacher on the first day teaches all students and on the last day teaches only a part of them (see teacher 1 course A or teacher 3 course B) he or she will be part of a group with all students and a group with some of the students so it could be confusing.

Hope it is more clear now and thanks for your attention.

image of the courses' structure

In reply to Emma Richardson

Re: assign different roles to same user based on time interval in one course

by Ruth Bor -
Hi Emma.
Thanks. I didn't know this function. I certainly will try it. The thing is that I cannot change the structure of courses and the students are in the frontline and not the teachers. I will put a scheme of the structure so it could be more clear.
In reply to Ruth Bor

Re: assign different roles to same user based on time interval in one course

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
Pragmatically, what's wrong with the human solution of 'I'm not teaching today so I won't do teacher activities when I'm logged on'? Or have two accounts per teacher, one that they use when teaching and the other that they use when they are not.
In reply to Gareth J Barnard

Re: assign different roles to same user based on time interval in one course

by Ruth Bor -
Hi Gareth and thanks for answering.
Nothing against humans...wink
The problem is that the teacher on one day teaches some group of students from course 1 and 2 and the next day can have other courses 3 and 4 with other students. Then the third day he could have again as students some of the first day and some or all from the second day... I will try to design a scheme of the structure so maybe it will be more clear then words.
The structure of the courses cannot be changed and not depends on me so I cannot decide to change it in any way...
In reply to Ruth Bor

Re: assign different roles to same user based on time interval in one course

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
Ah, what I'm trying to say is really that there are times where Human Intelligence should be used instead of Artificial Intelligence. And this is one of them. Having the system enforce a set of strict inflexible rules that cannot adapt to the ever changing circumstances of life can mean that your users will get frustrated and angry with the system they are using when, for instance, they need to take over from a teacher whom is ill on a day that they are not scheduled to teach and they cannot immediately contact somebody to enable that to operate correctly.

Build computer systems to aid not hinder or take away control from the human.

But looking at https://moodle.org/mod/forum/discuss.php?d=431315#p1735677 then it seems that you need an enrolment plugin that is day specific with multiple instances on the same course at the same time - thus has a user on one enrolment is a teacher and at another a non-editing teacher = complex to code but easy for a human to know their role at any given moment.
In reply to Ruth Bor

Re: assign different roles to same user based on time interval in one course

by Shirley Gregorczyk -
Picture of Particularly helpful Moodlers
Maybe groups would be useful here.
If each teacher's section of the course was a separate activity within the same course, you could limit each teacher to only their group. 
Disclaimer - I do not use groups - 
Kind Regards,
In reply to Shirley Gregorczyk

Re: assign different roles to same user based on time interval in one course

by Ruth Bor -
Hi shirley.
Yes. I do use though of using groups for the more complicated courses (yes it gets even more complicated)...When I have 2 or 3 teachers for 1 course on the same day I will use groups to group the students with their teacher and also the activities will base on that.
I thought also to use cohorts but never used them so I do not know if the solution is right for my case.
Thanks.
In reply to Ruth Bor

Re: assign different roles to same user based on time interval in one course

by Shirley Gregorczyk -
Picture of Particularly helpful Moodlers
Cohorts are a way to group student enrollments - I use cohorts to enrollment a group of students into multiple courses. I don't believe it will be helpful in the situation you posted.
Kind Regards