Scoring points when using h5p in a quiz (Drupal)

This question is related to the integration of h5p into the quiz module for Drupal ( https://www.drupal.org/project/quiz_h5p ).

I created a quiz (version 5) containing only h5p questions. The h5p questions are of different question types (interactive video, single choice, multiple choice) and everything works like a charm, except scoring points.

I can't figure out how to get the points that a quiz-taker earns to appear as scores in the quiz. I included a screenshot where you can see that all answers score 0 points, while the answers given were all correct, should have scored 7 points there. I tested this with a quiz containing only "native'" question types included in the quiz module, and scoring points works fine then.

When I look into the code for https://www.drupal.org/project/quiz_h5p , I can see that the classes contain far less code than corresponding classes for "native" question types in the quiz module. This is also the case when I look into the code for version 4 of the quiz module (this version contains the h5p question type).

Does this mean that we can not use the quiz module (version 5) to make quizzes with h5p questions that allow a user to score points? Do we need to write this integration ourselves or does anyone know where to find an example of how this is done perhaps?

Any help with this will be greatly appreciated!! Thanks!

thomasmars's picture

I just created a Quiz with Fill in the blanks and Multichoice using the H5P Quiz integration and it seems to work well for me.

Make sure you add the H5Ps through the "Manage questions" tab, not as a shorttag. Hope this helps you out, let me know if you have further problems.

Hi Thomas,

Thanks for your reply! I did some more testing (with a vanilla install) and noticed that the scoring of h5p questions in Quiz 5 works as designed when I turn off the Bootstrap theme and make Bartik theme the default theme again.

I did some searching and found this post https://h5p.org/node/2136 where a similar problem with using Bootstrap theme and h5p quistions in Quiz 5 together is adressed (although I have the problem on all types of devices, not only on touch devices as is the case in the post referred to).

Do you have any advice on where to start if want to use the Bootstrap theme and h5p questions together in Quiz 5? In the post referred to above, I read about turning off different libraries, is that what I should do? Or is there maybe a patch in the works somewhere?

Since Bootstrap is so popular in it's use, it seems only logical to be alble to use it without bugs like not evaluating scores correcltly. In this case the use of Bootstrap is also a client requirement since the project is an addition to an existing Drupal site that already uses Bootstrap, making this a real problem for me.

Any advice would be more than welcome! Thanks!!

  

 

thomasmars's picture

Sorry for the wait, was away for easter.

It seems that this issue stems from jQuery error in Bootstrap. Disabling the "Enable popovers" option in bootstrap settings -> javascript -> popovers fixed it for me. A more elegant way to fix it would be to update your drupal jQuery version as suggested here: https://www.drupal.org/node/1058168

Hope that helps :)

- Thomas

I got h5p questions working perfectly now in Quiz 5 by adjusting the jQuery version with jQuery Update. Good to know this is where the trouble was, we could clearly see some javascript functions not working properly in the console when using the default jQuery version. I can confirm that everything works fine now while using bootstrap theme...

Thanks again for your reply!!

Cheers Marco