New filter - SIMILE Timeline Widget

New filter - SIMILE Timeline Widget

by Nick Freear -
Number of replies: 31

Hi,

I've created a filter to embed an MIT SIMILE Timeline Javascript interactive widget. You and your class can use it to visualize temporal/ historical data. The data source can be a static XML file, or a dynamic Moodle Database activity (currently Moodle 1.9 only).

Upload a timeline XML, then the minimal syntax is:

[Timeline]
dataUrl = COURSE_ID/simile-invent.xml
[/Timeline]

And a screenshot of the included inventions example:

Screenshot of inventions timeline

Feedback welcome. Enjoy!

Nick

Average of ratings: -
In reply to Nick Freear

Re: New filter - SIMILE Timeline Widget

by Geoffrey Rowland -
Picture of Plugin developers

Hi Nick

A big thanks for this work and making the code available. It has a lot of potential for anything from geological and historical timeframes to, say, project management. I'll certainly give it a spin on Moodle 2.

As you are aware, David Hicks started work on integrating SIMILE back in 2006 but, for whatever reason, interest/development waned.

http://moodle.org/mod/forum/discuss.php?d=58038#p276684

If you have not already found his original code (and it is farly well hidden) it is still available here:

http://www.sansay.co.uk/?q=node/9 

May still be some useful stuff in it.

There is some related info from the ULCC on using timelines in Moodle

http://moodle.ulcc.ac.uk/mod/resource/index.php?id=81

I'm also aware of a SIMILE-based course format and a course reports plugin, but have not tried either of these

http://moodle.org/mod/forum/discuss.php?d=133701

http://www.dfwikilabs.org/course/view.php?id=24

Will report back experiences of your new code

Cheers

Geoff

Average of ratings: Useful (1)
In reply to Geoffrey Rowland

Re: New filter - SIMILE Timeline Widget

by Geoffrey Rowland -
Picture of Plugin developers

Hi again Nick

A quick follow up ..

Works for me on Moodle 1.9.11 cool

Though the bottom link to the XML data is not working for me

I'm getting a link like http://[moodleaddress]/course/4/simile-invent.xml

whereas I guess it should be more like

http://[moodleaddress]/file.php/4/simile-invent.xml

 

Not yet had any luck with Moodle 2.1 alpha. Will also try Moodle 2.0.3

I presume you need to set up 'Legacy course file' to get this to work with Moodle 2

In reply to Geoffrey Rowland

Re: New filter - SIMILE Timeline Widget

by Geoffrey Rowland -
Picture of Plugin developers

The following fixed the XML link for me (on Moodle 1.9.11)

In filter.php around line 124

$alt_link ='<p><a class="tl-widget-alt xml" id="tlw-end" href="'.$CFG->wwwroot.'/file.php/'.$config->dataUrl.'" type="application/xml" title="'.$label.'">'.$config->title.'<abbr class="accesshide"> XML</abbr></a></p>';

Probably have to do something similar for the JSON link though I have not tried this

In reply to Geoffrey Rowland

Re: New filter - SIMILE Timeline Widget

by Nick Freear -

Hi Geoffrey,

Thanks for giving it a go and reporting back.

I'll work on a fix for the XML link - it needs to behave slightly differently for Moodle 1.9 and 2, so not just a one-liner unfortunately. Thanks for the report.

Also, those links are useful. I was aware of the 2006 work on a timeline plugin, but never found a link to the code. I'll take a look when I have mo.

And, I'd come across the Timeline course format, but had not twigged that it used SIMILE - its not mentioned in the plugins entry!

For your interest, CONTRIB-2502 is the issue-report under which I've been working so far. Michael de Raadt has been providing much useful feedback.

Thanks again,

Nick

In reply to Nick Freear

Re: New filter - SIMILE Timeline Widget

by Ger Tielemans -

Hi Nick,

I will continue here, so moved my comments to this place:

Picture of Ger Tielemans Ger Tielemans - 18 May, 17:15
 
What a beautiful implementation of the MIT Timeline! Thanks!

The tag under the timeline gives me this: http://www.taalkit.org/moodle/mod/resource/4/timeline/simile-invent.xml
instead of: http://www.taalkit.org/moodle/file.php/4/timeline/simile-invent.xml

Picture of Ger Tielemans Ger Tielemans - 18 May, 17:18
I like your choice to make it available as a filter. Everywhere  a student has access to an edit box (assignment, forum, wiki...) he/she could add a timeline. So it could become a very intersting alternative way of homework assignment.
 
But how can students add a timeline to a forum? I must somewhere store the file before I can add it to the filter...
 
... I tried to attach an xml to a message, reopen that message and then attach the link to that xml to the timeline in the message.... but it gives an error and I can no longer edit/kill this message, because the writing hand is also gone... (Only the admin must delete the message in the database.)
 
 Picture of Ger Tielemans Ger Tielemans - 20 May, 11:11
Of course the admin can remove this wrong forum message from the database, but not accepting an empty or wrong XML file would be better.

By the way, to make it possible for teachers to edit this XML file in the files directory of a course, I made a modification to /files/index.php
(line 848 in moodle 1.9.12 and 1.9.11):
was:
if ($icon=="text.gif" || $icon=="html.gif) {
now:
if ($icon=="text.gif" || $icon=="html.gif" || $icon=="xml.gif") {
(I do not know where to change it in Moodle 2.0 and higher)
In reply to Ger Tielemans

Re: New filter - SIMILE Timeline Widget

by Ger Tielemans -
Nick, can you replicate this problem and do you already have a soluition?
In reply to Nick Freear

Re: New filter - SIMILE Timeline Widget

by Sue Holtz -

This widget looks very promising. Can it be an interactive activity, i.e., can the class work on developing the timeline together, and has anyone tried it in 2.0?

Average of ratings: Useful (1)
In reply to Sue Holtz

Re: New filter - SIMILE Timeline Widget

by Nick Freear -

Hi Sue,

Sorry I haven't replied sooner. Thanks for the enquiry.

Yes, the timeline can be generated from a Moodle Database activity, so that your class can collaborate to create the timeline. See an example further down the Readme (substitute a value for the 'DATA_ID').

This feature is not yet available for Moodle 2, though I've created an issue in the tracker for the task. Feel free to watch the issue report, and I'll also report back here.

Many thanks,

Nick

In reply to Nick Freear

Re: New filter - SIMILE Timeline Widget

by Sue Holtz -

Nick,

Sorry for sounding ignorant here, but is it just the widget that does not work in 2.0.3 or the Timeline itself? The page at the beginning of this post mentions a download for 2.0, which I tried. I got the database started, but then I got stuck on the install instructions. (Not really a programmer).

Many of the courses we teach are historical in nature, so it would be really neat to use the timeline.

If the timeline itself does work in 2.0.3 could someone please simplify the instructions for me, or point me in the direction where I could find them?

Thanks

 

Sue

In reply to Sue Holtz

Re: New filter - SIMILE Timeline Widget

by Sue Holtz -

I am playing with this in my 1.9 install using the database option. The timeline shows up as does a link to my data(base)source, but the data do not show on the timeline. When I click on the link to the data, I am taken to the database. What am I doing wrong?

In reply to Sue Holtz

Re: New filter - SIMILE Timeline Widget

by Sue Holtz -

I got it to work when I read your notes on the bottom of the README file. I changed the DATE field to text and used the ISO 8601 format and now my timeline works. Thanks!

Now if I could only get the title to work on the top of the timeline.

One more question, can the students download and keep the timelines they develop in class?

In reply to Sue Holtz

"Can students download...?" Re: New filter - SIMILE Timeline Widget

by Nick Freear -

Hi Sue,

Interesting question regarding downloads!

The timeline is a mixture of HTML, Javascript, CSS and images (the filter is mostly PHP). So a true 'download' would need to package this up.

So, currently no. I can look at an <iframe> embed as a hack - so the student could download a small HTML file, which embedded the timeline. Would that help?

I'll note all these requests, and review them.

Cheers,

Nick

 

BTW, I'll keep repeating this! - the entry in the new Plugins database,

http://moodle.org/plugins/view.php?plugin=filter_timelinewidget

In reply to Nick Freear

Re: New filter - SIMILE Timeline Widget

by Sue Holtz -

I hate to be a pest on this, but I have the timeline working in 1.9 using the database option so students can enter information. I figured out to use the ISO formatting for the dates, but now am stuck on what to do when the date is BC. My research says that you just put a - before the year, but the date did not register on the timeline. Any ideas. This is such a wonderful product, we would love to be able to figure out how to use it for the BC era.

Thanks again for all of your hard work. I know I could not do the programming.

Average of ratings: Useful (1)
In reply to Sue Holtz

Re: New filter - SIMILE Timeline Widget / BC dates

by Nick Freear -

Hi Sue,

I'm sorry it's taken so long to respond. (I've been completing a book, about Moodle).

BC dates are tricky. There are potentially limitations in Javascript, and in the MIT Simile libraries. I'm putting a question to the author of this page on the SIMILE Wiki, RonanKER,

I know I had a play with,

intervalUnit = MILLENIUM

-- Events tended to be 'lost' because they were generally too short, relativly speaking (I thought of archaeology as an interesting use-case).

I'll report back when I know more. Thanks for your interest and patience,

Nick

 

BTW, the entry in the new Plugins database,

http://moodle.org/plugins/view.php?plugin=filter_timelinewidget

In reply to Sue Holtz

Links to 'research' - Re: New filter - SIMILE Timeline Widget

by Nick Freear -

Hi Sue,

Sorry forgot to ask - would you mind posting any links related to the 'research' you mention?

You may have found something useful! (If you can remember/ find the links - months...)

Thanks, Nick

In reply to Nick Freear

Re: Links to 'research' - Re: New filter - SIMILE Timeline Widget

by Sue Holtz -

Nick,

Sorry, I did not save the research, or my notes on this. I would think, though, that I searched on the ISO date standard.

Sue

In reply to Nick Freear

Re: New filter - SIMILE Timeline Widget

by Dan Fenske -

Please forgive my lack of codingn skills.  I would like to use this filter with a Moodle Database.  When you refer in the ReadMe to :

substituting an appropriate integer in place of DATA_ID (mod/data/view.php?d=N): 

I'm afraid I don't know what the appropriate integer is.

How do I know what to put here?

Average of ratings: Useful (1)
In reply to Dan Fenske

Re: New filter - SIMILE Timeline Widget

by Dan Fenske -

Just wondering if anyone is still following this thread.  I am pretty much stuck.  I need to know how to find the values specific to my database.  If there is help out there, I would really apprciate it.

In reply to Dan Fenske

Re: New filter - SIMILE Timeline Widget

by Nick Freear -

Hi Dan,

Sorry for the delay in responding (this filter features in a book I've been writing, and it's been a mad dash to finish the book - details in my user profile).

This is a very useful question.

If we imagined for a minute that the Books database on Moodle.org had the appropriate fields ('start', 'end', 'title' etc. as mentioned in the Readme), and that the Timeline Widget filter worked with the Database module in Moodle 2+ (which it may not yet - it's on my list of todos), then we take this URL:

    http://moodle.org/mod/data/view.php?d=55

And use the value of 'd', 55, like so in a Moodle resource:

[Timeline]
dataSrc = mod/data
dataId = 55
; other parameters ...
[/Timeline]

Note don't use the 'id' (you may have to put example data in your DB, and browse around to find 'data/view.php?d=M&r=N'. 'd' database, 'r' record.) I hope that helps.

Many thanks for your interest and comments,

Nick

In reply to Nick Freear

Re: New filter - SIMILE Timeline Widget

by Roger Emery -

Hi,

I'm also struggling with getting database data to display in 1.9.14

 

The timeline filter is working OK, there are no errors, however I have nothing displayed on the timeline.

Please can you clarify the Database field types. I've named them exactly as per the readme, start and end are type date, what type should the others be? i.e. is link field of type text or URL?

my embed code is:-

[Timeline]
dataSrc = mod/data
dataId = 487
date = 2011
intervalUnit = MONTH
intervalPixels= 75
[/Timeline]

 

This is an excellent tool! If only I could get it to work - I'm sure I'm missing something simple.

Kind Regards

Roger

In reply to Roger Emery

Re: New filter - SIMILE Timeline Widget

by Nadav Kavalerchik -
Picture of Core developers Picture of Plugin developers Picture of Testers Picture of Translators

I expiriencing similar issue, not able to see any entries on the time line, though every thing seems to function fine, without errors.

In reply to Nick Freear

Re: New filter - SIMILE Timeline Widget

by Darcy Christ -

Hi Nick, great plugin! I've used Timeline before and noticed your development on the forums and just yesterday one of my colleagues requested some kind of timeline. Perfect timing!

Anyway, I am experiencing an error with Moodle 2.1.1. The error i

filter_timelinewidget/errorindataurl, loaded into the iframe. The URL for the iframe is:

http://<my domain>/moodle/filter/timelinewidget/widget.php?conf[title]=My+timeline&conf[date]=1900&conf[intervalUnit]=DECADE&conf[intervalPixels]=35&conf[dataUrl]=3%2Fsimile-invent.xml

3 is my course id and i have a file with title and filename are 'simile-invent.xml'. It is available with this URL:

http://<my domain>/moodle/pluginfile.php/86/mod_resource/content/3/simile-invent.xml

what might I be doing wrong?

In reply to Darcy Christ

Re: New filter - SIMILE Timeline Widget

by Darcy Christ -

According to the documentation, the link to the timeline data should look like 2/timeline-invent.xml, but according to the code (regular expressions), it is expecting the url to include either content or user/draft

lines 37 - 55

// Handle relative URLs. They must start with a course/resource ID, eg. '2/timeline-invent.xml'
        if (0!==strpos($config->dataUrl, '/')
          && 0!==stripos($config->dataUrl, 'http://')) {
          if (file_exists("$CFG->dirroot/draftfile.php")) {
              // Moodle 2.x.
              if (preg_match('#\d+\/[a-z_]+\/content\/\d+\/.+\.#', $config->dataUrl)) {
                //dataUrl = 60/mod_resource/content/1/simile-invent.xml
                $config->dataUrl="$CFG->wwwroot/pluginfile.php/$config->dataUrl";
              }
              elseif (preg_match('#\d+\/user\/draft\/\d+\/.+\.#', $config->dataUrl)) {
                //dataUrl = 14/user/draft/403117530/simile-invent.xml
                $config->dataUrl="$CFG->wwwroot/draftfile.php/$config->dataUrl";
              } else {
                  print_error('errorindataurl', 'filter_timelinewidget');
              }
          } else { // Moodle 1.8-1.9.x
              $config->dataUrl = "$CFG->wwwroot/file.php/$config->dataUrl";
          }
        }
In reply to Darcy Christ

Re: New filter - SIMILE Timeline Widget

by Darcy Christ -

indeed, the URL required should look more like:

86/mod_resource/content/4/simile-invent.xml

So perhaps this is just a documentation issue.

In reply to Darcy Christ

Re: New filter - SIMILE Timeline Widget

by Veronica Brandt -

I'm hoping to get this working in Moodle 2.2, but the dataURL is not finding the xml file.

I'm guessing the paths have changed since Moodle 2.0.

Yet another reason to go and start over again in Moodle 1.9

Did you get Timeline working in 2.1?

In reply to Veronica Brandt

Re: New filter - SIMILE Timeline Widget

by Veronica Brandt -

Also I'm noticing the url of the xml file keeps changing - it's dynamic so maybe that's the problem.  There is no static url you can pass for sure.

Though I'm not 100% sure, it might be similar to the difficulties holding back the Task Chain plugin: http://moodle.org/mod/forum/discuss.php?d=196679

Any hope for this working in 2.3?  I guess we have to wait till June to know that.

In reply to Veronica Brandt

Re: New filter - SIMILE Timeline Widget

by Veronica Brandt -

I can't seem to get it to work in Moodle 1.9.15 either.

Database or xml.

the xml file is at: http://brandt.id.au/education/file.php/2/simile-invent.xml

but the timeline widget is looking for: http://brandt.id.au/education/mod/resource/2/simile-invent.xml - which just gives a 404 error.

In reply to Nick Freear

Re: New filter - SIMILE Timeline Widget

by David Cheung -

Hi Nick,

I am currently trying to make this filter on my Moodle 2.5.3+ (Build: 20131224) website but not succeed. I have followed your instruction stated in your github README procedure.

  • 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 (i.e. /mod_resource/content/1/simile-invent.xml)

In reply to David Cheung

תשובה ל: Re: New filter - SIMILE Timeline Widget

by Irith Herman -

Did you get some answer to thr problem?

it is not workong for me also

Irith