re: Multiple Accounts, same courses in one device

re: Multiple Accounts, same courses in one device

by Ey Marieb -
Number of replies: 5
Good day,

This is mainly for offline access of contents. Would there be an issue using the mobile app (even BMA) if say a class has one device only and multiple people will download the same course and access them offline?

I found I can easily change site on Moodle App, even without internet. Not sure if this will work with BMA and with those specific scenario in mind.


Average of ratings: Useful (1)
In reply to Ey Marieb

Re: re: Multiple Accounts, same courses in one device

by Marcel Santoso -
reviving old question.

I just tested your scenario --different approach, but the main goal the same: single device, multiple users, for the same single course. So far: no go.
With each user, the app creates a folder that holds the offline version of the course within /sdcard/Android/data/com.moodle.moodlemobile/sites (or the other package name if you are on BMA / customized). Yes, it's within the same site.

I am trying to search within the source code where this string is defined, but if you have some pointer, please do share.
In reply to Ey Marieb

Re: re: Multiple Accounts, same courses in one device

by Noel De Martin -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Each time you log into a site in the app it's treated as a different site, even if it was the same site with a different user. If you want to use it offline, you would need to download the course for each user, but otherwise it should work.

It works the same way with BMAs.

Average of ratings: Useful (1)
In reply to Noel De Martin

Re: re: Multiple Accounts, same courses in one device

by Marcel Santoso -
@Noel,
thanks for chipping in. I suspected / feared as much, and that's where my... challenge... is.

For an upcoming project, there is this need to prep 70 tablets (= 70 users) with tablets (Android) preloaded with a full offline-accessible course. The destination location will be remote where internet access is minimum and safe to say non existent, that's where I should prep these 70 units of tablets with the course, ready to go offline.

Seeing that you might be the expert on the Moodle app, is there any way that I can trick / modify the app (forked from github) to treat the site for each user to see to the same assets folder? The site's assets will be foremostly extracted SCORM files.

(I will also be attending the devjam next week monday, hoping to see if there are any likeminded during the event)

What I have in mind for now is the following:
1. create / import 70 users, password predefined
2. enrol them into the course (using the web admin interface)
3. login the 70 users into 1 tablet, one-by-one --and after each login, download the course(s) to be available offline
4. once downloaded, repeat with the next user, download the course(s) to be available online, etc.
5. after user no. 70, logout from the app
6. pull the assets from the tablet (adb pull /sdcard/Android/data/com.moodle.moodlemobile/sites)
7. make a backup of the app's database (adb backup com.moodle.moodlemobile -f backup.ab -apk -shared)
8. bulk install the moodle app .APK to the rest of the tablets (n= 69)
9. bulk restore the database
10. bulk push the assets
11. *HOPEFULLY* the all the 70 users can now login into the moodle app offline

What I would like to avoid is step no. 3 and 4. Is this something that I can achieve programatically?
In reply to Marcel Santoso

Re: re: Multiple Accounts, same courses in one device

by Noel De Martin -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

I think the use-case you're talking about is something that has been discussed in this forum before, and something I'm personally very interested in: custom app with preloaded content?.

As mentioned in that thread, with the current architecture of the app it's not possible to achieve something like this without doing what would be considered a partial rewrite. Although I do have some ideas I'd like to pursue at some point (maybe a DevJam would be the ideal situation for a proof of concept? :D).

But the ideas that I have come with some trade-offs. For example, I was thinking that it would be possible to create an APK with some content pre-loaded, but that content would be tied to a particular user. Which shouldn't be a problem, given that we're talking about an "offline APK" which would never synchronise with the Moodle site again.

In your case, why do you need 70 users? If the course contents are going to be used offline, wouldn't it be possible to create a "sample user" and have all the tablets using the same one?

If you're attending the DevJam, I encourage you to explore this problem there. Don't expect to solve it in a single day, but maybe it will be enough to understand the main issues and how to go about them.

Average of ratings: Useful (1)
In reply to Noel De Martin

Re: re: Multiple Accounts, same courses in one device

by Marcel Santoso -
I would very much welcome the idea of Devjam!

Well, the APK (and adb push whatever --which make the pre-loaded content / set / course) will need to be done by 70 different people, and at some point in the future, these people will be required to go online to sync their results in order to attain a certificate. But yes, if it will be forever offline, loading a single tablet with one user and clone this will work, but in this case they will need to sync back.

OK, at least I know now from 'the semi-official point of view' that what I would like to do is not (yet) possible with the current codebase. Thanks!

Maybe we'll see eachother at DevJam (not sure how big the crowd will be...)