Timeline with database integration

Hi guys,

I love the timeline instrument. I was using the timeline js from Knightlab and with google docs there was a way to integrate it with databases.

Is it possible to do it also with the h5p timeline?

Thank you for your awesome job.
Alessandro

Content types: 
0
0
Supporter votes Members of the Supporter Network can vote for feature requests. When the supporter network has generated sufficient funding for the top voted feature request it will normally be implemented and released. More about the H5P Supporter Network
BV52's picture

Hi Alessandro,

The Timeline that H5P uses was originaly created by Knightlab. It was actually the first version and what you have used is the upgraded version. The core team is currently maintaining this but only for bug fixes. Although if someone in the community is willing to contribute the code they are more than welcome to.

-BV

Hi and thank you.

So I imagine that right now is not possible to connect it to a database. :(

Once that I have the .h5p file, is it possible to see the source code of the file. (not the source code of the tool that is on Github).

otacke's picture

Hi!

You could write json data to the _filtered_ column of the contents' database table (not recommended though because it skips validation of the semantics). And you can simply unzip/change/rezip H5P files.

Best,

Oliver 

Hi!

Wow, that's the info I was searching for. I didn't think about changing the extension from .h5p to .zip. 

My intention is to allow people to contribute to the timeline. I was thinking to make a form, writing everything in a database and to use the information from the database to build the timeline and the table that you can see here. https://www.9minuti.it/barbero-time-tutti-i-video-ordinati/ Righn now I'm doing everything manually and it's very time-consuming.

Is there a better way to reach the same result?

Thank you
Alessandro

 

otacke's picture

Hi Alessandro!

I didn't think about changing the extension from .h5p to .zip. 

No need to on decent operating systems ;-)

If you know what you're doing, then updating the database table of content is the quickest way, but altering the filtered column is probably also the dirtiest. You'd have to validate the input yourself, so the content type won't recieve anything that it's not supposed to receive (injected JavaScript in particular).

Cleaner, but you'd still take care of validation: I think you could also use the alter_parameters hook to completely override the parameters from the database with your own, but I've never tried to do that.

You could also write a script that takes your table input, and creates a valid content.json file that you can replace the one in a content file with - or you could even fully automate that including zipping. Then you'd only have to replace the file by uploading the new one.

Best,
Oliver

Hello otacke, 

I know... but decent operative systems don't support the Adobe suite nor Fusion 360. Soon or later I'll definitely cancel Windows from my life.

Thank you for the suggestions, and yeah, I should be definitely really careful about js injections. 

I have another question related to xapi. I'm new to this system and I see that there are not xapi for the time line. So this means that there is no way to know if the user 'completed' the time line, right?

Thank you again.
Alessandro

BV52's picture

Hi Alessandro,

You are correct regarding timeline not having xAPI statements. Unfortunately Knight Labs the developer of this content type has stopped actively developing this.

-BV

otacke's picture

Hi all!

It could be simple to add some "completed" xAPI statement though. The xAPI code is pretty standard, and all that'd be left to do is check if there's some trigger that can be listened to by injecting a listener to the DOM without touching the original code, just amending the wrapper code.

Best,

Oliver