Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could we expose more informations about QuestionSet? #17

Open
cornelles opened this issue Sep 8, 2017 · 8 comments
Open

Could we expose more informations about QuestionSet? #17

cornelles opened this issue Sep 8, 2017 · 8 comments

Comments

@cornelles
Copy link

var initialParams = $.extend(true, {}, defaults, options);

I would like to be able to add an event on the start button if the introPage is enabled, for this I would need to expose the button, initialParams or params to get details about configuration of the QuestionSet.

What do you think?

@icc
Copy link
Member

icc commented Sep 15, 2017

Could you provide an example of what you'll be using it for?

At the top of my head, it sounds like triggering a custom start event on the question set it self might be a better idea but it really depends on the use-case.

@cornelles
Copy link
Author

cornelles commented Sep 15, 2017

Not the event is my problem, the problem its actually object definition, the QuestionSet, I want to add semantics to the object, lets say a checkbox, and my logic, where I process the event, will be dependent on that checkbox value.

@icc
Copy link
Member

icc commented Sep 15, 2017

Which platform are you on? All platforms should offer a hook or action that allows you to modify the semantics (recipe of the editor form).

Check out the Hiding/disabling fields from the authoring tool section for an example: https://h5p.org/documentation/for-developers/authoring-tool-customization

@cornelles
Copy link
Author

cornelles commented Sep 15, 2017

I'm using drupal 7 and I can add the semantic, the problem is in the scope of the callback I get access to H5P.QuestionSet which doesn't expose the "options" where my semantic value is, or maybe I'm handling this wrong.
https://h5p.org/events - I've played a little with resize event

Another example its like in drag-question
https://github.com/h5p/h5p-drag-question/blob/master/src/drag-question.js#L26
where they expose "options", I was expecting to have something like this in question-set too

@icc
Copy link
Member

icc commented Sep 15, 2017

Ah, I'm not sure why this is hidden for Drag and Drop. You only need the custom value you've added and not to change it?

We're hoping to be able to provide a plugin API soon that will make it easier to override stuff.

@cornelles
Copy link
Author

cornelles commented Sep 15, 2017

Answering your question; Yes!
Having the plugin api; it would be lovely :)

@icc
Copy link
Member

icc commented Sep 18, 2017

A bit of an ugly hack, but to get it working right away you could try accessing the H5PIntegration.contents object. The parameters should be stored there as JSON.

@cornelles
Copy link
Author

Thanks for your reply @icc
I have already made a workaround for this, I opened this issue just for a nice to have thingy

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

No branches or pull requests

2 participants