[Server-devel] Offline moodle notes in moodle.org

Tony Anderson tony_anderson at usa.net
Fri Oct 10 07:59:34 EDT 2008


Unfortunately my activity on offline Moodle has been put on the back 
burner in order to support the schoolserver inplementation in Nepal.

The next steps are (1) to implement a offline/online button similar to 
that in Google Docs and (2) to reimplement the static resources using 
ajax + php code to access the resources in the moodledata folder.

Currently greasemonkey is a required crutch to convert the moodle pages 
to use ajax requests instead of form actions so that they can be 
intercepted by javascripts when offline.

Later we should be able to move the greasemonkey functionality to php 
scripts server-side. In particular, I think the go_offline button should 
invoke a php script which generates the pages requested in the manifest 
with the ajax requests. It should be possible to make most of this 
invisible to the existing moodle.


Ludo (Marc Alier) wrote:
> Gears sounded like a exciting way to go right when Martin L told me on 
> Skype two weeks ago. That's why I've committed a talented guy like Ruben 
> to dig on this task. We are starting to work on it, and it might even 
> work guiño
> BUT, in I've been working on a WS architecture for Moodle that can allow 
> SOME features of Moodle to be taken out to offline clients (I'm thinking 
> about Java 
> <http://moodle.org/mod/glossary/showentry.php?courseid=5&concept=Java> 
> Phones, iPhones and other no Gears powered machines.
> As Martin L. says some things move so fast we will not keep up to, BUT 
> maybe we can choose a part of moodle that makes sense to have in a 
> limited device like a phone or an ipod or nintendo ds, and bring it 
> there. This way will never aspire to take out all the features (due to 
> the development rithms that wise ML tells me ) like the gears 
> approach... but hey! is worth a try. So I will put people on both bets. 
> And we are working on WS for other purposes as important as this one 
> http://tracker 
> <http://moodle.org/mod/resource/view.php?id=125>.moodle.org/browse/MDL-12886 
> <http://moodle.org/browse/MDL-12886>
> Sleeping is optional, sure :p
> On Fri, Oct 10, 2008 at 11:18 AM, Martin Langhoff 
> <martin.langhoff at gmail.com <mailto:martin.langhoff at gmail.com>> wrote:
>     Posted on moodle.org <http://moodle.org>
>     http://moodle.org/mod/forum/discuss.php?d=107920
>     Hi all! I have been away for a while working on other olpc stuff, but
>     now my attention is returning to Moodle, and offline moodle is
>     definitely in my roadmap.
>     In the AU and NZ moot I had good chances to talk with Dan and MartinD
>     about a cunning plan to get a Gears-based offline moodle going.
>     When we disscussed architecture for the current moodle-on-a-stick
>     (MoaS) based we also talked quite a bit about a Gears-based approach.
>     At the time, it looked huge and risky. Google had just released GG,
>     and was talking about upgrading Reader to use it.
>     So there many things stacked against it: Noone had seen Reader doing
>     the offline thing yet, Gears had a somewhat restrictive license, and
>     it seemed that we'd have to implement a significant chunk of Moodle as
>     an AJAX application.
>     Things have changed between then and now. Google has made things much
>     simpler now with a BSD license and Reader shows it can make the
>     offline thing work very well.
>     Reimplementing Moodle as an AJAX app was still a big monster in my
>     head until recently. But a volunteer approached me recently saying he
>     could take a stab at it, and I thought "what would be the simplest
>     thing that could possibly work?"
>     The answer was suprisingly simple: store the damn HTML, CSS and JS in
>     the sqlite DB that Gears provides.
>     So from the course page, we can "go offline" by
>     - Storing the html+css in sqlite -
>     - Requesting a special 'manifest of resources that are ok to use
>     offline' - published by the course-format page...
>     - Retrieving those offline resources. Initially, just mod/resource
>     contents. Later we can extend this support to work with other modules.
>     - When we use the course homepage later while offline, we'll walk the
>     DOM to show CSS blocks 'disabled' (by graying them out) and we will
>     disable links to resources we cannot support offline.
>     - As the user browses the content we do have offline, the JS code
>     keeps track of resources visited. Upon reconnection to the moodle
>     site, we push back the collected logs to mdl_log(*)
>     - Other modules (mod/forum for example) can be supported with ob magic
>     and/or more explicit/AJAXy use of JS.
>     * - we'll need to review the log handling code. So far we've never had
>     "out-of-sequence" log entries, and this will introduce them for the
>     first time. I'm sure there'll be a few gotchas there.
>     Hearing this, MartinD suggested that - as long as we go the "store
>     html" way (supported with output buffering tricks if needed) then we
>     can add the ability to produce a plain old zipfile with a course
>     homepage + static resources. I think it's a good secondary goal to
>     have -- though I'm not sure what limits we'll have with this.
>     Tony Anderson - the volunteer who sparked this - has been working on a
>     proof-of-concept implementation. It currently uses Gears and
>     GreaseMonkey, and requires a few manual tweaks. Unfortunately, I don't
>     think that code can be merged directly - we will want to refine the
>     approach to avoid GreaseMonkey and other inconveniences. My take is
>     that we can either adapt it, or use it as a reference for a more
>     moodlish implentation -- Tony is not a moodle dev, so he's not
>     necessarily familiar with our odd style smile ).
>     Tony's code is here
>     http://lists.laptop.org/pipermail/server-devel/2008-September/002101.html
>     together with some discussion around it.
>     I also hear noises from Barcelona -- Ludo and Ruben may be able to get
>     involved. This could start getting interesting.
>     Getting this from a PoC to something shippable will take a bit of
>     work. Right now I still have a ton of work to do on other aspects of
>     Moodle that are more urgent for OLPC, but I will find the time to work
>     on this working with Tony, Ludo and Ruben. Sleeping is optional,
>     right? wink
>     Once the urgent infrastructure stuff for olpc is sorted, I'll be keen
>     on bringing this to completion -- at least of an initial stage.
>     --
>      martin.langhoff at gmail.com <mailto:martin.langhoff at gmail.com>
>      martin at laptop.org <mailto:martin at laptop.org> -- School Server Architect
>      - ask interesting questions
>      - don't get distracted with shiny stuff  - working code first
>      - http://wiki.laptop.org/go/User:Martinlanghoff
> -- 
> ---
> Ludo ( Marc Alier)
> UPC - granludo at gmail.com <mailto:granludo at gmail.com> - Tel. +34-934137885
> http://orangoodling.blogspot.com - http://www.dfwikilabs.org -
> http://ososdeviaje.dfwikilabs.org - http://mossegalapoma.cat

More information about the Server-devel mailing list