Find the Hotspot xAPI event misses result

Michael Dajewski's picture

The xAPI event statement misses result part. 
This was working with version 1.8.13 - it was fine for as long as I can remember. 
After updating the library to version 1.8.17, the issue is present. 

BTW.: Was the version 1.8.17 meant to be released? I do not see it at: https://h5p.org/post-hub-releases 

Best regards, 
MichaelD

Content types: 
BV52's picture

Hi Michael,

I'm not sure what is causing the issue for you. However I will check with the developers if they have any suggestions.

Lastly the version 1.18.17 was released around the end of May. The person that is tasked to update the release page has not updated it due to some pressing matters.

-BV

otacke's picture

Hi all!

That seems to have been removed accidentally when moving around some of the code. I have created a fix and started a pull request.

Cheers,
Oliver

Michael Dajewski's picture

Oliver, 

Thank you very much. 

MichaelD 



I opened up an H5P file which had this Content type and added the code from your pull request into the H5P file and repackaged it and checked on the Console with H5P.externaldispatcher. since I did this on Moodle, before doing this I deleted the Find the Hotspot content type from the library.

The other 4 Statements are coming, but not Result.

Wondering (a) is it that this kind of  approach I folowed doesn't work to update a CT? or (b) the extra lines of code you have added on the pull request dont work...

Wondering how to solve this problem as this has been lingering since the 1st June H5P release.

Attachments: 
otacke's picture

Hi chaavi!

The code works just fine - hey, a little trust! :-) If you really deleted that library, this approach should work. Have you checked if some cache is actually serving the old files?

Best,

Oliver 

No full trust is there :-) I did mention in point (a) that maybe the approach I followed may have some flaw due to which the Result xAPI didnt come. The cache maybe that flaw.

Meanwhile I played the H5P that wasn't giving Result xapi on Moodle, using h5p-standalone and the very same H5P gives the Result xapi without any change!

otacke's picture

Hi chaavi!

It really sounds like something strange is going on. But we can track it down...

In the latest version of "Find the hotspot" that has been released, a separate handler for triggering the "answered" statement was introduced. The former scoring part was replaced by it, but unfortunately the new handler doesn't contain the score anymore. It's fired (or you would not get an xAPI statement at all), but it doesn't contain the results property. That is what my pull request adds.

The problem that you face in Column now stems from the aforementioned issue. Column counts the number of tasks that it contains and waits for their results. When the number of completed tasks equals the number of tasks available, only then does Column report its own overall "completed" statement. Given that the xAPI "answered" statements of Find the Hotspot currently do not have a results property, Column skips those statements and the number of completed tasks never reaches the number of tasks available.

If you have trouble using a patched version on moodle, I'd check a couple of things:

  1. Can you confirm that we're talking about the same libraries? H5P.ImageHotspotQuestion-1.8.17 is the latest one that has been released. You'll have to replace that one. If you're using the H5P plugin for moodle, then you'll need to set the plugin into development mode temporarily before uploading your patched version. Otherwise the H5P plugin will not install the library, because it can see that it's already installed. If you're running moodle's custom H5P integration, you will have to delete the 1.8.17 library first (and all existing contents using it, but you should not be able to delete the library otherwise) and then upload your patched version, because moodle's integration does not have a development mode. And if you have both the H5P plugin for moodle and moodle's custom integration, know that they do not share libraries. Content that's added as an activity using the H5P plugin will use the H5P libraries that were installed by the H5P plugin. Content that's created via the content bank uses the H5P libraries that were installed via moodle's integration including the cron job.
  2. Take care of caches. Caches can lure in every corner. The moodle platform may have one and serve the old file, H5P can (but the library upload feature functions should take care of that), there may be proxies in between somewhere on the web, browsers may use some (use Ctrl-F5 to reload), ...

Cheers,
Oliver

Thanks for the comprehensive reply. This clarifies for me why things may not have worked for me after applying the code change. 

" you will have to delete the 1.8.17 library first (and all existing contents using it"

I had deleted the library but not all the H5P using the library. I have 100s of H5P files using the library and so deleting all of that is not an option at the moment. So possibly when I deleted the library and added the new one from a patched H5P and I played the old pre-existing H5P it didnt work for this reason. (Or it could be one of the many caches.)

But I can now understand what the specific bug was and how your code resolves it. Once H5P folk pull your code and the new library is updated on Moodle via H5P Hub, does the old H5P files still have to be deleted?

otacke's picture

Hi!

Hmm, technically, H5P should not allow you to delete a library if some content is still using it - it's required and content would break. So, I assume that you may have deleted an older version of that library maybe?

No, the regular upgrade will, of course, not require to delete content. A later version of a library will have a higher version number than the one installed and H5P will replace the old one.

Best,

Oliver