Skip to content
This repository has been archived by the owner on Sep 11, 2019. It is now read-only.

Question set inside Boardgame shares activity id and title #3

Open
garemoko opened this issue Oct 21, 2015 · 14 comments
Open

Question set inside Boardgame shares activity id and title #3

garemoko opened this issue Oct 21, 2015 · 14 comments

Comments

@garemoko
Copy link

The board game includes a question set, however the question set inside has exactly the same xAPI activity id and title as the board game. (The only way you can tell is by looking at the category context activity). The result of this is that the board game appears to send two statements about completion duplicating the data, once at the end of the question set (with the wrong category) and once after the feedback video.

Where the board game contains multiple question sets, these all share the same id.

I think the best solution here would be to use a different activity id and title for each question set. Any thoughts on how to do this?

@garemoko
Copy link
Author

Note: I notice that questions within a questions et use a sub content id. Does this concept need to be extended to allow for 3 tiers?

@falcon-git
Copy link
Member

Boardgame is a content type that has received very little tlc after it's birth.

However the 0bject.id seems to be different for the Question Set compared to the boardgame? And the questionset doesn't have a title? ref https://h5p.org/boardgame

What seems to be missing to me is that the questionset doesn't have it's parent set.

Maybe you're using Wordpress? We might have a bug in the Wordpress plugin.

SubContent ids are uuids, so they should be unique for all sub content independent of how many tiers we have.

To fix the problems the QuestionSet will need a getTitle function I think. See for instance https://github.com/h5p/h5p-multi-choice/blob/master/js/multichoice.js#L672 - we might also add a title field to the questionset to have the author add a title. (In boardgame the title should ideally be based on the hotspot title)

And the id problem should already be ok, but it might be that we have a problem with the Wordpress plugin?

@garemoko
Copy link
Author

I am using the Wordpress plugin. None of that code touches the statement object though.

Or do you mean the main H5P plugin?

I'm more worried about the id than I am about the title.

@falcon-git
Copy link
Member

Yeah, the main H5P plugin. I don't see how that one should mess it up either, but you are talking about the object.id attribute? Can you confirm that it works as expected on https://h5p.org/boardgame ?

(you can do H5P.externalDispatcher.on('xAPI', function(event){console.log(event.data.statement);}); in console)

@garemoko
Copy link
Author

Yes. I am getting different object ids for the question sets there as desired. Where does that id come from to end up in the statement?

@falcon-git
Copy link
Member

https://github.com/h5p/h5p-editor-php-library/blob/master/scripts/h5peditor-library.js#L146

I think I orignally created this feature, but I suspect that it got broken in a merge or something. How old is the boardgame you are using? Maybe it didn't have the subContentId? It seems that this new code won't give old content a sub content id, but new content should probably always get a subContentId and keep it?

@garemoko
Copy link
Author

I installed the library and created the boardgame today.

Interestingly, if I download the game from https://h5p.org/boardgame, that works. I can't see anything in the settings that I'm missing.

@falcon-git
Copy link
Member

When you download it you get the same subContentIds as used on H5P.org. seems that the generation of new ones doesn't work on your site for some reason. I'll test on our main WP test site now.

@falcon-git
Copy link
Member

Are you seeing the problem in console or in your reports? On labs I got an id like this one:

http://labs.h5p.org/wp-admin/admin-ajax.php?action=h5p_embed&id=15?subContentId=f9fa5b70-d5d8-4d58-bbd1-f6e5eeb89a1d

This isn't a valid iri afaik so maybe the subContentId gets stripped away somewhere because of the extra "?" ?

@garemoko
Copy link
Author

It's wrong in the console and the LRS. The double question-mark is likely to cause problems, but I'm not even getting that far.

@garemoko
Copy link
Author

image

@falcon-git
Copy link
Member

How are you printing to console? Since console prints by reference code run after console.log for instance will change what the console.log shows.

I use console.log(JSON.parse(JSON.stringify()))

I have seen that the ADL standard script massages the statements, and sometimes in bad ways, especially if not used correctly

@garemoko
Copy link
Author

garemoko commented Nov 3, 2015

I was using the code above in this chain H5P.externalDispatcher.on('xAPI', function(event){console.log(event.data.statement);});

I'll take a look using H5P.externalDispatcher.on('xAPI', function(event){console.log(JSON.parse(JSON.stringify(event.data.statement)));});

@garemoko
Copy link
Author

garemoko commented Nov 3, 2015

Using H5P.externalDispatcher.on('xAPI', function(event){console.log(JSON.parse(JSON.stringify(event.data.statement)));}); the issue remains.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants