ndunand / moodle-mod_choicegroup

Moodle "Group Choice" plugin
https://moodle.org/plugins/mod_choicegroup
34 stars 57 forks source link

Support offline usage in choicegroup in the Moodle app #137

Closed dpalou closed 4 years ago

dpalou commented 4 years ago

Hi Nicolas,

I'm Dani, one of the developers of the Moodle app. In my last project week I worked on adding offline support to your plugin, and here's the result. I chose your plugin because it already had mobile support and because it's quite similar to the choice activity, so I could reuse a lot of code.

Now other plugin developers will have an example if they want to add offline support to their plugins :)

Hopefully in the future there'll be a way to program this using ES9 or so, but for now it needs to be ES5 to make it work on old devices.

If you want to test this, just open a choicegroup activity in the app, go offline and answer or delete the answer. The app should display a message saying there is data to synchronize, and that data can be synchronized manually (using the top-right menu) or automatically after a few minutes. Please notice you need the Moodle app 3.8.1 or higher in order for this to work.

Cheers, Dani

ndunand commented 4 years ago

Hi Dani,

Thanks, this look brilliant. Your testing instructions were very clear and I've just tested it on a test site: it works as designed.

I have a couple questions:

I am asking especially because we here don't have the ressources to maintain these extra features if a future Moodle update breaks them. In a worst case scenario where this would break in say Moodle 4.0, I would then have to disable this feature, which I'm very reluctant to consider.

dpalou commented 4 years ago

Hi Nicolas,

these changes don't affect the current plugin compatibility, most of he code added is Javascript that runs on the app, so it doesn't affect Moodle.

It should also keep working in the foreseeable future. The Moodle system to support plugins in the app hasn't changed much since it was introduced in Moodle 3.5, we basically added new features but we haven't modified or removed any because we don't want to affect plugin developers. The same goes for the app's code, we try not to change any API that could affect plugin developers, we mostly add new APIs and features.

Cheers, Dani

ndunand commented 4 years ago

Hi Dani,

Sorry for the delay. Thank you for your answer and thanks again for sharing your work. I'll release a new version including your feature asap.