Enrolment script running on app

Enrolment script running on app

by Joe Downes -
Number of replies: 1

Hello, I am just looking for some advice. 

On our Moodle site whenever users login they are redirected (by javascript in the Additional HTML field) to a PHP script page which checks their user profile, checks their enrolment and enrols if necessary using API functions. It then redirects them to the dashboard page.

This all works fine on the web version of the site but I wondered whether something similar could be established on the app. Maybe an enrolment script that runs on app sync?

I am just not sure where I would start with this or whether it is currently possible on the app at all.

Thanks for any help you can give. 

Joe

 

Average of ratings: -
In reply to Joe Downes

Re: Enrolment script running on app

by Dani Palou -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Hi Joe,

you could create a Moodle plugin that is adapted to the app (here's some documentation about it). This plugin wouldn't have any template or anything, just some Javascript code to call a WebService or to open a certain page in the browser or in InAppBrowser. It depends on your use case, but I'd go for something like this smile

Cheers,
Dani