Create Content Type for QuestionSet


I want to make the Content Type "H5P.ImageMultipleHotspotQuestion-1.0" work within a QuestionSet-1.13 as all the other QuestionSet-Enabled Content Types. So I nowhere found any information about what xAPI-Functionality has to be implemented or which other requirements have to be met to accomplish this. 

Can someone give me a link to the documentation or give me a little todo-List? I would love to contribute the newly QuestionSet-Enabled ImageHotspot Library to the community of Questionset users but at the moment I just don't know how.

Thanks in advance, Julian!

PS: If this is a duplicate - sorry, I couldn't find my first posting in the forum.

Content types: 
thomasmars's picture

To accomplish this you must have some developer experience. This requires changing the data structure of Question Set. You can start by looking into the content type development guide. When you feel comfortable with understanding how H5P content types work and how they're structured you can look for where libraries are defined in semantics.json of Question Set, and add multiple image hotspots to that list by its machine name. You also must add "multiple image hotspots" as an editor dependency to Question Set, so you can actually make the image hotspots content in the Question Set editor.

Be aware that if you make changes directly in the code of the library these changes will be overwritten whenever a new version of Question Set is released, so it is more robust to create a pull request for the Question Set library, so that everyone can get this feature.

Good luck, Thomas

Hi Thomas,

what you wrote is quite exactly the stuff I alrady managed to get worked. I can successfully add a ImageHotspot to the quiz and edit it and save it. This is the QuestionSet-Part. But thanks anyway for making this clearer.

But Problems occur when Playing the Quiz with an ImageHotspot inside: Theres "go to next question" no "finish quiz" and none of the QuestionSet functionality anymore and my guess is, that the Cotent Type ImageHotspot doesn't fire all the (xAPI) events that are necessary in order to make the QuestionSet know about the State, the Question (ImageHotspot) is in and other probably necessary stuff. And the latter is just guessing for me at the moment because I don't know what QuestionSet stuff has to happen within the QuestionType during solving the quiz in the frontend.


thomasmars's picture

Hi Julian,
You are indeed correct that ImageHotspot doesn't implement everything that Question Set requires, but it is not xAPI events. Question Set requires content types used within it to implement a set of contracts. These are not present for ImageHotspot so they must be implemented before Image Hotspot can be used within Question Set, among them are for instance getAnswerGiven(), which must return true for the current content type to show the "next" and "finish" buttons. You can read more about the contracts and how to implement them in the contracts and addons guide.