I am using the jquery plug-in Joyride to create a tour of our Moodle site and have it working correctly. Now I want to control WHEN students see it. Currently it begins every time a student views the Dashboard, and I want it to only begin the first time a student views the Dashboard. I know I could use a cookie to control whether or not it plays, but I want Moodle to remember whether or not the student has already seen it, even when he switches to another device.
I'm thinking perhaps I could create a custom profile field which Moodle could write to when the tutorial has been completed. Ideally, I would like Moodle to record "viewed" for each step of the tutorial, so that if a student only clicked through the first half of the tutorial, the 2nd half would still begin the next time the student views the Dashboard.
What do I need to do in my javascript to make Moodle write something to a custom user profile field? For example, the profile field could be called "Tutorial Steps Watched" and Moodle would write "Step 1" after the student has clicked in the 1st Step, and "Step 2" after the student has clicked in the 2nd step, etc.