[David Hicks wrote]
> exactly how you get tests or anything that writes to the markbook (or any
> other >part of the database...) to work looks to me like a hard problem.
[Martin Yelland wrote]
> Could the users results be cached localy then next time the client application
> is syncronised with the Moodle server, the test results are uploaded to the
Yes. Now all you have to do is write the code
The tricky part would be dealing with database tables that could be written to by more than one person - the classic lost update problem. User A syncs with the server, goes away and works offline. User B comes along, works online, does something that writes changes to the database. User A turns up again, syncs their changes back to the main database, wipes over user B's data.
This problem is completly solveable - the classic solution to this classic problem is to provide some kind of locking mechanism (as with source code control systems, WebDAV
file systems, "monitor" code sections
, etc, etc) that ensures that only one user/process can write to a particular chunk of memory at a time. The issue with Moodle is the way its database is designed - i.e. pretty much at random, with different developers adding bits on here and there as needed. This, of course, is one of Moodle's great advantages - you can add to and extend it without too much fuss. It does present problems when it comes to maintaining a coherant design, though.
The best way to go about putting a consistant interface on top of a database that is going to be constantly changing is to implement some kind of API. This seems to be exactly what the Moodle Hub project is dealing with - producing an web-based (I assume) API that allows Moodle servers to synchronise with each other. A good chunk of the functionality to allow offline working has probably already been implemented, and if not then this would seem like the logical place to work to add that functionality. Code written would be extending current cross-platform Moodle PHP code, not starting from scratch - Moodle already installs on Windows, Mac, Linux, etc. Okay, technically, to run a "local" copy of Moodle that synchs offline with a given server you're going to need to install a web server, database, etc, and configure Moodle - rather beyond a home user who just wants to do their homework. A "home user" installer file would come in handy - click on an executable, let the computer get on and configure stuff for you. That strikes me as something worth working on, whereas I think a compiled executable to re-implement existing functionality would be more effort than is really practical.
All the above is strictly my opinion only - I could completly have the wrong idea about the Moodle Hub functionality. Someone do please say if I've got the wrong end of the stick.