WordPress: Could user see their results without being logged in?
Hi,
this is a quite general question: we would like to use H5P for self assessment quizzes and tests on a wordpress site. The users should not be forced to log in, but they need to view the results of their own tests. As we will use quite different H5P content types we would need the possibility to show the results on different pages and a summary result.
We "as admins" are not interested in analyzing the results, so it's not necessary to store these in the database.
I thought to use javascript variables, as local browser storage or session storage would be sufficient for our needs. But as I can't find anywhere a "how to" or documentation of such an approach with h5p, I am afraid that this could not be possible at all?
Any help would be highly appreciated, thank you!
otacke
Fri, 08/16/2019 - 19:02
Permalink
Hi osa19!Should not be
Hi osa19!
Should not be difficult. You can catch the xAPI result statements that H5P emits and store them in the browser's local storage. They can then be retrieved and displayed as needed on other posts/pages.
It's nothing that H5P provides, but creating a WordPress plugin for this job isn't difficult. Feel free to rip H5PxAPIkatchu apart and reuse the code if you need to: https://github.com/otacke/h5pxapikatchu
Best,
Oliver
osa19
Mon, 08/19/2019 - 15:43
Permalink
Hi Oliver,thank you very much
Hi Oliver,
thank you very much for your quick reply and encouraging me to reuse your commented code. Good to know that "creating a WP plugin isn't difficult" - but I am afraid not possible for me with limited programming knowledge. I'll keep looking around, maybe I'll find a similar solution somewhere which I could further adapt for our needs.
Thanks again!
otacke
Tue, 08/20/2019 - 01:21
Permalink
Hi osa!I don't think you'll
Hi osa!
I don't think you'll find a solution where you just need to change a couple of lines.
That's why I mentioned H5PxAPIkatchu that already listens for xAPI statements within a plugin - instead of writing them to a database, you can filter them for results and put those into local storage.
The other half is adding a shortcode that you can put into pages or posts, cmp. https://codex.wordpress.org/Shortcode_API
Cheers,
Oliver
osa19
Tue, 08/20/2019 - 16:49
Permalink
Hi Oliver,although this is
Hi Oliver,
although this is quite a big effort for me - as being new both to xAPI and WordPress - I am still willing to do the next steps. Thanks to you preventing me turning into the wrong direction ... So I digged a little bit further into your code and as far as I understand this is my to do list:
I am not sure yet (but will see) how to resolve this with several H5P content types - for the beginning I just tried with true / false answer.
I have the feeling that you are a German programming freelancer, is that right? If so, would you generally be interested in being hired for this job from a German university? Although it is really fun for me to develop my programming skills I am sure that I will never be capable to code the WP plugin in the right clean way as it should. In addition my testing was only with two or three H5P content types but we will use far more of them in our project. I would need a clean code base which I could alter then for our needs by myself.
Just a side note: The "track the results of anonymous user" is already on the H5P "features requests" since two years, but obviously hasn't been realised so far. https://h5p.org/node/82264
Anyway, a big thank you for helping me so far - I really appreciate this kind of support very very much. Cheers. :)
otacke
Tue, 08/20/2019 - 20:54
Permalink
Hi osa!Yes, you can get rid
Hi osa!
I am a German IT freelancer, that's right. If there's a university that would fund this, sure. Just let them reach out to me (still need to set up a proper site for stuff like this, I guess :-D). However, don't give up just yet!!! If you finish your code, I'll gladly give it a review and suggest some improvements if I see anything "suspicious".
I think many people mistake filing in a feature request for putting something onto a "to do" pile. There's no guarantee that a feature request will ever be picked up by the H5P core team, a) because they focus on picking those requests that seem to benefit as many people as possible and, more importantly b) the feature requests are directed to the H5P community (as are questions in this forum). Anyone is welcome to pick them up, contribute to the main code base, develop complementary scripts and plugins, etc. That's what some people including myself do, but the more the merrier.
Cheers,
Oliver
osa19
Fri, 08/23/2019 - 17:02
Permalink
Hi again, Oliver,wow, I am
Hi again, Oliver,
wow, I am really impressed and grateful for your helpful support and efforts, thank you VERY much once again!
I considered your hints and developed my code a little bit further - kind of feeling two steps forward, one step back (better than vice versa ;).
I am not giving up yet but I will need some more time to understand your coding and all the xAPI and plugin stuff - or possibly aks you more questions. Thanks for the review offer. BUT I am feeling that you gave me already far more than I had expected and I will send you a pm to get in touch - and speak about the money for possible further support (and speak German :).
As for your final remark about the "feature request not being solved" - you are absolutely right. I didn't want to complain or to push someone to solve my problems. ;) I just felt a little confirmed with my wishes for that Wordpress H5P plugin because I am not the only one who missed that special feature. Thank you for explaining the "community thing". If one day we will have developed such a plugin I would be more than happy to publish it so that everyone who is interested can use it for his / her own needs.
To be continued via pm ...! :)
DiFE-Project
Sun, 08/13/2023 - 23:04
Permalink
Problem solved?
Hi osa & Oliver,
Even if your post is four years old...I have the same problem. Is there a solution for this? Unfortunately I have no idea about coding.
Regards
Tobias
otacke
Mon, 08/14/2023 - 21:24
Permalink
If you're using WordPress,
If you're using WordPress, you can download the zip file from https://github.com/otacke/h5p-user-score (green code button -> download zip) which will provide you with a plugin for WordPress that allows to display scores in pages and posts.