Different Games items state

Forums: 

Hi, I'm using "Memory" game, how can I know what image was flipped?
Also where ca I found some documentation on different games events, so that I will not ask this question on every game?

otacke's picture

Hi thank you for your response but can you be more specific? 

I looked at the Memory game code but still can't get the data in the 'xAPI' event listener

otacke's picture

Hi Alex!

I'll gladly help you if you have a specific question that I can answer, but without you sharing how you tried to get hold of the xAPI events that Memory Game sends out, I can't. Using the "ExternalDispatcher" for xAPI is described at https://h5p.org/documentation/x-api. That's different from listening for internal events that some class of a content type migth use (those are usually not dispatched to the "outside") - so if you put that listener on the content type instance and listened for "interacted", that won't work.

Best,
Oliver

Hi Oliver!
Thank you for your help, I'll try be more specific, I want to keep track in the "Memory" game on every card spin and to get information of the card, this is for anlytics reasons, I want to know the number of errors, meaning the number of unsuccessful card spins.
I know that listening to event "xAPI" is agreat way to "catch" the flip event but my problem is that I can't get the "spined" card object and therefor I don't know wich card was spined.
The only thing that can see is that in DOM the class name of the turned card was changed to "h5p-flipped" but is there other way?
Thank you!

 

otacke's picture

Hi Alex!

The xAPI event doesn't tell you what card was flipped. That'd require an extension (what e.g. Course Presentation uses to add the slide number to the progressed statement) or using some other xAPI statement on top, so for both the code would need to be changed. Since Memory Game instances do not seem to expose their internal variables, I don't think there's an easier way than checking the DOM.

Cheers,
Oliver