Moodle Plugin Development

Moodle Plugin Development

by Scott Dellinger -
Number of replies: 3

Apologies if this is the incorrect forum for this question, but after searching around for a while it seemed to be the one that was most appropriate.

I am a developer that has an online ID verification and participation proctoring app that can be installed on any web site by simply adding a script tag (that points to our servers). 

While this is easy if you have access to the code and the desire to modify your Moodle installation, I'd like to create a plugin that would allow the admin to add this service to any course/page/etc. I'm not sure which plugin type would be best suited for this. Again, this would simply add a Javascript script tag to the bottom of the course/page/etc. It would need to access the course participant's first and last name, plus their user/course ID information (however Moodle stores this). It would also need some sort of method for the admin to set their Integrity Advocate (our product) information (API Key, etc). What sort of plugin type would you recommend I use for this?

Additionally, we also provide an API that allows LMS systems to interact with/pull the data for sessions that have been recorded. I would like to create a plugin that would allow the admin to install this within the Admin section of Moodle. What sort of plugin type would be best for this?

If a plugin isn't the way to go, what other options would I have?

Thanks in advance for any advice you may have!

Average of ratings: -
In reply to Scott Dellinger

Re: Moodle Plugin Development

by Luis de Vasconcelos -

For the "add a Javascript script tag to the bottom of the course/page/etc" requirement you could do that via your Moodle theme.

For the "Integrity Advocate information" part a Local plugin would probably be best - https://docs.moodle.org/dev/Local_plugins.

Average of ratings: Useful (1)
In reply to Luis de Vasconcelos

Re: Moodle Plugin Development

by Scott Dellinger -

Thanks for the response, Luis! I've done a lot more reading since posting and I agree that the Local Plugin will be the best for accessing the API data.

I'm not sure what you mean for using my theme. I'd like to make this available to all Moodle installations, regardless of what theme they're using. I was thinking something like a block, but I'm not sure if a block can add a script tag to the page. Thusfar my experiments are not working out. 

If I modify the page code itself, I can get this to work:

$PAGE->requires->js( new moodle_url('https://integrityadvocate.com/Integrity/Embed?apikey=XXXXX-XXXXX-XXXXX') );

Is there perhaps a way to get that to work in a custom block plugin? That way the Moodle admin could choose which pages/courses the script would show up on.

In reply to Luis de Vasconcelos

Re: Moodle Plugin Development

by Scott Dellinger -

Hi again, Luis! Your reply actually made me Google some additional information and I figured out how to get the block to include the script I needed it to!

Thanks again!