I decided that I’d spend the final day trying to write some code, so I began trying to implement the Google Docs Viewer idea from Day 1.
I started off trying to write a Moodle Filter plugin to change file download links into iframes. However it quickly became apparent that the link I wanted to change wasn’t actually processed by the filter, so I had to try something else.
I moved on to modifying the Moodle File Resource plugin – it currently attempts to embed PDF files if it can, so I used that as a starting point. However due to the previous 2 days of information being stuffed in my head, I didn’t do things in any logical order and ended up in a bit of a mess. I really need to start again with the following approach:
* Create a new table in Moodle’s database to hold single-use tokens against a file’s path
* Create a copy of Moodle’s file.php that allows you to request a file without logging in, but only if requested with a token that’s stored against that file’s path.
* Get this page working so that Google Docs Viewer can request the test file with the test token and display it.
* Change the code that attempts to embed PDFs to embed any file type supported by Google Docs Reader
* Get the embed code working for the test file with the test token
* Implement code to generate and store a single-use token when the resource page is requested, pass it to Google via the embed code and delete it after the file is requested once. Also implement a cron job to clean up expired tokens if they aren’t used.
I finished off the afternoon by having a chat with Ian Tasker from SchoolsICT (who also sponsored the event), and James and Nigel from ULCC who produce the Moodle ILP plugin. The discussion we had gave me a great insight into what their system is capable of, and I’m looking forward to get to grips with writing some plugins for it myself.
The second day of Dev8D started with my Moodle Plugins workshop. It was reasonably well attended and the people who were there seemed to find it useful. I certainly found it an enjoyable experience.
The project zone had a brilliant demo of the “ghetto touch-table” from the University of Southampton – basically a home-made Microsoft Surface-style set-up. The thing that really interested me about it was it’s simplicity – a sheet of Perspex with IR light shining through it, and a camera to pick up light that gets reflected down by an object touching the surface. It only had a few purpose-built apps that could use the touch functionality, but I’d love to see it again once they’ve got it controlling the OS.
Dev8D 2012 has come and gone this week. The event’s so intense that I tend to forget each day what I did the previous day, so this post will try and order my thoughts a bit and make sure I remember what happened.
In Alex Bilbie’s packed HTML5 talk, I finally understood that you really can start using HTML5 now. html5shiv adds support for new block elements like <section> and <article> to old versions of IE, which means you can semantically mark up a page’s structure without having to resort to a million <div> elements.
In the Unix and Vim surgery I learnt that using lines selected visually in Vim can be reselected by typing gv which I’ll be using a lot.
I was planning to enter the Jorum API challenge. Jorum is a repository for open educational resources, and I thought it would be a cool idea to try and implement a Moodle repository plugin to pull in resources from Jorum. However, the Jorum API needs some serious re-engineering to make it useful – it just returns too much data. You need to be able to search for keywords within a collection, request details of an item within the results, and request individual files within that item. Currently, trying to do this gives you all sorts of data pertaining to an object’s parents, children and siblings, to the extent that you can’t even work out what needs to be thrown away to end up with just what you wanted. Until a better API is available, I won’t be looking at it any further.
During the Afternoon I had a chat with the Moodle developers from the University of Sussex. They showed me Google Docs Viewer which lets you embed any PDF or MS Office file in a web page, even without a Google Docs account. This would have seriously cool applications if used in conjunction with Moodle resources, as it could be used to allow a lot of files that currently require office software to view to be viewable right in the Moodle page. There’s a bit of work to do making this work securely, but I think it’s feasible.