Schlagwort-Archive: Programmieren

Add an H5P-Timer to your assignments, maybe?

A while ago, I noticed that the memory game of H5P uses a timer that is tied to the library closely. It cannot be used for anything else. I decided to create something like a general purpose timer for H5P and here it is! You can  check it out it on github.

What is it good for?

The timer is not intended for time critical applications, but it can easily be used to keep track of time in games, to set a time limit for tasks, or to create other innovative content libraries that need triggers based on time. What about a mod-player that can handle ProTracker files for example? ;-) Also, it might reduce some redundancies across different h5p libraries under the hood.

You could build a stopwatch with the H5P-Timer

What can the H5P-Timer actually do?

First of all, the H5P-Timer can can count up and down. Wow, right? :-) Additionally, it can be paused. Really! More interestingly, it keeps track of three different types of counters:

  • clock time (can be modified even if running, e.g to give a time bonus)
  • playing time (the amount of time that the clock has been ticking when not paused)
  • running time (the total running time ignoring pauses)

I am not sure if there’s a use proper use case for all of them, but maybe you have something in mind?! Furthermore, the timer offers three types of notifications using callback functions. All three counter types can be used as a trigger. You can set up:

  • a notification at a particular point in time,
  • a notification after a certain time period has passed, and
  • recurring notifications in fixed intervals.

For example, you could set up a two minute warning for a countdown with a notification at a particular point in time. Or you could remove special powers that were granted a game character after 30 seconds have passed. Or you might just add a ticking noise to a clock every single second. It’s up to you! Apropos clock: the timer can use milliseconds internally but only „displays“ tenths of seconds and above. Everything else wouldn’t make too much sense, I guess.

Hmm, what else can the timer do? It will dispatch events for play, pause, stop and reset. You might want to listen for them.

Finally, the timer offers some static utility functions. You can

  • check if something is a timecode,
  • convert timecodes to milliseconds and vice versa,
  • extract single time elements like days or seconds from timecode or milliseconds.

Help, I need sombody, help!

I think that someone else should have a closer look at the H5P-Timer because it may still contain some bugs. While I have not completed my documentation, I hope that my comments are good enough to guide you. Your feedback is highly appreciated! Also, please let my know in the comments what content libraries you can imagine to use the H5P-Timer for!

„Apparently it started learning at a geometric rate until it became self aware.“

Ich finde, es ist mal wieder an der Zeit, mich auch formal etwas weiterzubilden – und zwar durchweg online. Eigentlich sollte man sich dazu auch mal Dinge suchen, die einem eher nicht liegen. Nach einigem Überlegen habe ich das allerdings hinten angestellt und bin bei etwas gelandet, was mir nicht so ganz fremd ist. Im vergangenen Jahr habe ich den Onlinekurs Machine Learning auf Coursera absolviert und setze nun noch einen oben drauf: Ich belege in Kürze das Nanodegree-Programm Machine Learning Engineer auf Udacity.

Originalfoto (von mir beschnitten): Skynet von Tom Bullock (CC BY 2.0)

Originalfoto (von mir beschnitten): Skynet von Tom Bullock (CC BY 2.0)

Zum einem mag ich das Thema Maschinenlernen, zum anderen ist das gerade gefühlt der heißeste Scheiß in der IT-Welt überhaupt. Damit kann man Skynet bauen! Oder J.A.R.V.I.S.! Aber auch ohne Flachs: Ich glaube, das Feld ist wirklich zukunftsträchtig. Als Deutschem winkt mir zwar keine Neuer-Job-oder-Geld-zurück-Garantie wie Leuten aus den USA, aber das ist gerade auch nicht mein Ziel ;-) Immerhin bekomme ich auch in Good Old Germany die Hälfte der Gebühren von 200 € pro Monat erstattet, sollte ich innerhalb eines Jahres fertig werden.

Angesetzt ist das Programm mit 420 Stunden – oder 14 ECTS, falls jemand mit dem hiesigen Hochschulsystem vergleichen möchte. Wenn ich das innerhalb eines Jahres durchziehen möchte und noch einen Sicherheitspuffer einbaue, sollte ich etwa 10 Stunden pro Woche einplanen. Das ist neben meinem Job durchaus eine kleine Herausforderung, wenn ich weiterhin an H5P schrauben möchte, endlich neue Videos für YouTube produzieren will – und mir vielleicht auch endlich wieder etwas Bewegung gönne

In den nächsten Tagen werde mir daher ein paar Gedanken machen, wie ich mich organisiere. Vermutlich werde ich mir das Curriculum vorknöpfen und in Anlehnung an’s agile Projektmanagement mit 2-Wochen-Sprints arbeiten, ein öffentliches Kanban-Board und öffentliche Burn-Down-Charts pflegen, github mit Quelltext befüllen, usw. Wir werden sehen, was nachher tatsächlich davon passiert ;-) Warum schreibe ich das hier? Weil mir etwas soziale Kontrolle sicher auch gut tut. Wenn ihr also ab und zu nachhaken wollt: gerne!

Teaching H5P to present automatically

Have you stumpled upon a nice piece of software called H5P yet? It allows you to embed a large variety of interactive content into websites running Drupal, WordPress or moodle. You should definitely have a look at all the fine examples.

One of the content types of H5P is called Course Presentation. It allows you to combine slides with videos, multiple choice quizzes, and some other shenanigans. This is the standard example:

Hier klicken, um den Inhalt von h5p.org anzuzeigen

Last Wednesday, someone asked if it was possible to go to the next slide automatically after a certain amount of time. It is not. So no scenarios such as Pecha Kucha with H5P? Luckily, the software is open source and I had some spare time to kill this weekend :-)

With my contribution you can activate an auto presentation mode that will show each individual slide as long as you want to – or you simply set a global time period like 20 seconds for Pecha Kucha. You can also decide whether you want the presentation to loop indefinitely or not.

Where is it then? Well, it’s not totally finished. You can already get it from github and use it, but the presentation editor still lacks the option to set a time period for a slide conveniently. Until now, you will have to edit the H5P file manually if you need individual settings. But, when that is done, you may be able to create something like this… Isn’t that nice?