Adding Ajax functionality to a plugin

Adding Ajax functionality to a plugin

by Ryan-Neal Mes -
Number of replies: 2

I am writing an activity plugin that integrates with completion tracking.

I need to be able to click a button and flag the activity as completed. I have read the documentation on completion tracking and creating plugins. It's all pretty straight forward on how to do this, but it I am not really sure how to do this via ajax.

Is there any documentation someone could point me to for this? Would I use the Web External functions API to achieve this? Expose a URL then ping that via Ajax?

Any help appreciated. 

Thanks.

Average of ratings: -
In reply to Ryan-Neal Mes

Re: Adding Ajax functionality to a plugin

by Justin Hunt -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Maybe the attached plugin is useful. It does what you mention. Please check the readme.

I would not do it the same way if I was writing it again. But its a good start.