Run code after finish training

Run code after finish training

by Çağrıhan GÜNAY -
Number of replies: 2
I want a small piece of code to be run by my students after they complete the training I give. How can I do this easiest?
Average of ratings: -
In reply to Çağrıhan GÜNAY

Re: Run code after finish training

by tim st.clair -
Picture of Particularly helpful Moodlers Picture of Plugin developers

What is the "code" - javascript, php, something else? Is it run by the user, or automatically?

If you are asking for the user to be able to click a button or such after the course is completed, you could do this using restrictions on a URL activity so that it isn't made available until after your course is completed (either by adding all the same activity conditions that compete your course, or by using a restriction plugin to hook off the course completion (https://moodle.org/plugins/availability_coursecompleted). The user could then click the activity to go to the url that executes the code.

If you are asking for a hook that runs on a course completion event (in the background, without user interaction), I have a plugin that observes a few typical course events https://github.com/frumbert/nosey_notifications which posts the event data to an external URL that you can then use in your own custom way.