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

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

Anwesh Mishra -
Atsakymų skaičius: 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.

Įvertinimų vidurkis: -
Atsakymas į Anwesh Mishra

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

Mark Johnson -
Core developers paveikslėlis Particularly helpful Moodlers paveikslėlis Peer reviewers paveikslėlis Plugin developers paveikslėlis

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.

Atsakymas į Mark Johnson

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

Tim Hunt -
Core developers paveikslėlis Documentation writers paveikslėlis Particularly helpful Moodlers paveikslėlis Peer reviewers paveikslėlis Plugin developers paveikslėlis

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.