Offline attendance with Moodle mobile app

Re: Offline attendance with Moodle mobile app

by SHIV CHARAN SHARMA -
Number of replies: 5
Hi Dan Marsden ,

I have a query:-
Why this newer method does not provide support for offline access ? Is there any technical constraints or it is purposefully left out ?

As Attendance plugin use CoreCourseModuleDelegate in newer method to add support in moodle mobile app.
CoreCourseModuleDelegate has option for offlinefunctions, where we can specify list of function to prefetch the module. Thus we can pre download the views of attendance for offline purposes.
(Also we can create our own prefetch handler to determine what needs to be download)

What is your opinion to use offlinefunctions option to provide offline support ?

After prefetching of views, if teacher is offline, the attendance response will be stored in SQLite database (it is already used in moodle app) untill teacher is offline.
When teacher got internet, attendance will be synchronise with moodle site database.

What is your opinion about this approach ?
Is their any other approach better than above?
If yes please let me know.

Any suggestion will be highly appreciated.
Also please let me know if I missed anything.

Thanks and Regards

In reply to SHIV CHARAN SHARMA

Re: Offline attendance with Moodle mobile app

by SHIV CHARAN SHARMA -
Hello everyone,

I would like to do this project under GSOC 2020.
I have discussed some queries and an approach to implement this project in my previous message. Please review it smile
Please provide your valuable feedback/suggestions with respect to it?

I have also discussed about this project on Moodle mobile forum, here is link of my discussion:
https://moodle.org/mod/forum/discuss.php?d=395116#p1592971


Thanks and regards
--
Shiv Charan
https://github.com/ShivCharanSharma
https://codebuddy.code.blog/
In reply to SHIV CHARAN SHARMA

Re: Offline attendance with Moodle mobile app

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
'Why this newer method does not provide support for offline access ? Is there any technical constraints or it is purposefully left out ?'
It's mainly PHP based and the mobile app does not have an internal system for processing PHP. You would probably need to write a solution in ES6 (the latest version of Javascript). Your proposal looks reasonable , though there are people far more expert than me who can give an opinion.
In reply to SHIV CHARAN SHARMA

Re: Offline attendance with Moodle mobile app

by Dan Marsden -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators
Hi Shiv,

I haven't looked into the way the app currently deals with the "offline views" but I assumed they were just read only / cached pages with no ability to make them dynamic or write to the internal SqlLite db. My assumption would be that to facilitate offline access with the ability to store data into the sqllite db we would need to either develop a remote add on like I mentioned above, or develop this functionality within the Moodle app codebase, however I'm willing to see my assumptions proved wrong! smile

If you'd like to improve the ability for offline pre-fetched pages in the app to be dynamic or store information within the sql lite db, I'd suspect you would need to dig into that process a bit more than I have to find out how much work might be involved in adapting the app to support this.

As mentioned earlier - I'm not convinced that I would want to maintain a remote add on within the Attendance plugin db - anything that lands in the plugin becomes my problem to maintain in future, so if you decided to go this route you would need to work extremely hard to convince me of the benefits and of your ability to knock this out as part of GSOC.

thanks!
In reply to Dan Marsden

Re: Offline attendance with Moodle mobile app

by SHIV CHARAN SHARMA -
Hi Dan and Marcus,
Thanks for your reply,
As the general structure of implementation of offline feature will be almost same for offline attendance as in offline quiz.
So, I have read the implementation of offline feature of quiz in moodle mobile app.
For offline feature, quiz module use TypeScript code written in "moodleapp/src/addon/mod/quiz/providers/" folder. Here TypeScript code handle all function such as prefetch, quiz,saving of response, synchronisation etc.
We can also use similar approach.
In order to add offline functionality for attendance in moodle mobile codebase moodle mobile app community's opinion is very crucial. But unfortunately I did not get any response from 29 December to till now sad
Now I am working on more details of working of offline quiz and offlinefunctions option of moodle mobile app. And also waiting for moodle mobile app community's response smile

Thanks and Regards,
--
Shiv Charan
https://github.com/ShivCharanSharma
https://codebuddy.code.blog/
In reply to SHIV CHARAN SHARMA

Re: Offline attendance with Moodle mobile app

by Dan Marsden -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators
Hi Shiv,

Sounds like you have made some good progress investigating this - great!!

FYI I am a volunteer GSOC mentor, and I volunteer time working on a number of plugins (like Attendance) so I won't always have time to respond quickly.

The Quiz activity is built into Moodle core, where-as the Attendance plugin is a 3rd party plugin - typically only "core" plugins are supported directly within the app, so there might be a barrier getting attendance specific code built-into the core Moodle app. Typically the remote add on option is used for this - and I don't really want to maintain a remote-add within the Moodle code-base unless a client funded my time to do this with the intention of helping with the maintenance costs.

If you could improve the existing app in a generic way that allows for plugins to make better use of offline capabilities without having to build specific plugin code within the app that might be more acceptable to the mobile app team.