suggested approach to implement buttons and score bar

otacke's picture
Forums: 

If I wanted to add a "check" button and a score bar just like some other content types do (possibly a "retry" button an a "show solution" button, too), which would be the suggested approach to go -- in keywords? I know that some UI related things have been changed and are about to change, so I think it's a good idea to ask.

tim's picture

Yup, you're right otacke - things have a changed slightly.

I would look at how Drag Text adds buttons:

https://github.com/h5p/h5p-drag-text/blob/master/src/scripts/drag-text.js#L389

And make sure you have the latest h5p-question and h5p-joubel-ui code. Make sure to pull from the release branch. 

otacke's picture

Thanks a lot, Tim!

otacke's picture

Do you already have some documentation about the types that can be registered using h5p-question or the library in general? In particular: What's 'introduction' and 'content'?

I am working on a content type that uses h5p-text-input-field. If I guess correctly, I should register the task description field as introduction and the textarea as content, right?

tim's picture

Yes, that should be fine. 

otacke's picture

Great! I guess I'll have enough time to finish a demo version this weekend then.