Timeline Widget filter
Requirements: tested with Moodle 1.9.7 and 2.0.2 (all Moodle 1.9.x should work, Moodle 2.0.x - static XML only).
parse_ini_string function (see compat.php).
This plugin was initially developed to support the book "Moodle 2 for Teaching 4-9 Year Olds", by Nicholas Freear, published 2011 by Packt Publishing [isbn:978-1-84951-328-9] http://bit.ly/packt-moodle4-9-book
- Download and uncompress the code files. Copy the renamed
timelinewidgetdirectory to the
filterdirectory on the server, eg.
- Log in to Moodle as admin, visit Site Administration | Plugins | Filters | Manage Filters. Scroll down and click on the icon for Timelinewidget to enable it.
- Try one of the Usage examples below.
Try one of the two modes:
XML: Upload a timeline XML file to your course (see the
exampledirectory). Then, type the following in a resource using Moodle's rich-editor (note, line-breaks, which can be represented by
<br />are required). Substitute an appropriate integer in place of
COURSE_IDand adjust the other parameters as needed. Minimal syntax:
[Timeline] dataUrl = COURSE_ID/simile-invent.xml [/Timeline]
NOTE: it would appear that the path has changed, so if you are using Moodle 2.x, the path to the XML should look like:
dataUrl = 60/mod_resource/content/1/simile-invent.xml (ie. <resource_id>/mod_resource/content/<course_id>/simile-invent.xml)
You will probably wish to replace the defaults for
date and so on:
[Timeline] ; A comment. title = Important inventions dataUrl= COURSE_ID/simile-invent.xml ; The date on which to centre the timeline initially. This can ; be just a year, or a full date, eg. 20 January 1870. date = 1870 ; UPPER-CASE! minute,hour,day,week,month,year,decade,century,millenium. intervalUnit = CENTURY ; How wide should the unit defined above be? In pixels. intervalPixels= 75 [/Timeline]
mod/data: Create a Moodle Database activity, with fields named 'start' (date), 'end' (date), 'title', 'description', 'image' and 'link', and add a record. Then, type the following in a Moodle resource, substituting an appropriate integer in place of
[Timeline] ;title = Important inventions dataSrc= mod/data dataId = DATA_ID date = 1870 intervalUnit = CENTURY intervalPixels= 75 [/Timeline]
- Moodle plugin entry: http://moodle.org/plugins/view.php?plugin=filter_timelinewidget
- Discussion: http://moodle.org/mod/forum/discuss.php?d=175875
- Bugs: http://tracker.moodle.org/browse/CONTRIB/component/11032
- Code, Git: https://github.com/nfreear/moodle-filter_timelinewidget
- (Code, Hg: https://bitbucket.org/nfreear/timelinewidget)
- (Old plugin page: http://moodle.org/mod/data/view.php?rid=4802)
- Demo: http://freear.org.uk/moodle
Todo: fix the XML link below the timeline - see Geoffrey Rowland's suggestion.
Todo: find a way to reject empty/incorrect XML files, eg. attached to forum - Ger Tielemans.
Todo: downgrade the print_error for missing dataUrl - Michael de Raadt.
Todo: deal withas well as
when parsing INI syntax - Michael.
Ger made change to Moodle 1.9.x, /files/index.php so admins can edit the XML file - ?
Todo: ensure that the filter's mod/data mode works with Moodle 2.0.
mod/data: If the start and end dates for a timeline will be less than ~2000 (or > ?), then they need to be text, not date fields in the Database activity.
mod/data: If PHP < 5.2, then dates less than ~1970 should be written as ISO 8601 dates (2010-11-06T14:11..). If PHP >= 5.2 then date_parse handles '6 November 2010...'.
The filter currently creates a very simple timeline, with only one band!
There is a skip-link for accessibility.
The filter is internationalized and (mostly) Moodle 2 ready.
Filter. Copyright (c) 2010-2011 Nicholas Freear.
Thanks to Darcy Christ (@1000camels) for the fork and fixes.
SIMILE. Copyright (c) Massachusetts Institute of Technology and Contributors 2006-2009 ~ Some rights reserved.