Automating change of users roles in specific courses for a specific time

Automating change of users roles in specific courses for a specific time

napisao/la Anwesh Mishra -
Broj odgovora: 2

Hi,

Need to automate a process by which the role of  some users enrolled in specific courses can be changed for a specific amount of time?

For example, for 15 days, user named A who is a student in a course will have Admin role in that specific course / courses and then after 15 days, will be reverted back to being a student.

 

This needs to be done to an entire list of students automatically through some code. How do i go about writing this code? Or is there a plugin already that allows me to do this?

Can anyone please suggest where do i start from or how do i go about this? Any links will also be appreciated.

U odgovoru na Anwesh Mishra

Re: Automating change of users roles in specific courses for a specific time

napisao/la Mark Johnson -
Slika Core developers Slika Particularly helpful Moodlers Slika Peer reviewers Slika Plugin developers

You might want to look at flatfile enrolments, you could either write a small routine to generate the required flatfiles to enrol/unenrol and generate them as required, or use the plugin's code as an example of how to automate enrolments.

U odgovoru na Mark Johnson

Re: Automating change of users roles in specific courses for a specific time

napisao/la Tim Hunt -
Slika Core developers Slika Documentation writers Slika Particularly helpful Moodlers Slika Peer reviewers Slika Plugin developers

Either that, or you could use the DB enrolment plugin in the same way.

Or you could write a custom enrolment plugin that does exactly what you want.

Documentation seems to be in enrol/README.txt in the code.