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

Quiz type not providing 'correct answer feedback' for every question #9

Closed
supriyarajgopal-spi opened this issue Aug 11, 2016 · 9 comments

Comments

@supriyarajgopal-spi
Copy link

Hi,

The option for selecting the chosen/not chosen feedback for each question in a quiz is available under 'Tips and Feedback' section only for Multiple Choice questions.

If I choose 'Drag and Drop' as the question type inside a question set, it doesn't give me any option to show some text after the user clicks on 'Check' for that particular question.

Any idea how to achieve this?

Kindly help!

@thomasmars
Copy link
Member

I think your best bet for achieving this is to look at how it is implemented in Multiple Choice and then try to apply it to 'Drag and Drop'. I think there are some complications in relation to designing this and how it would fit inside 'Drag and Drop'.

@supriyarajgopal-spi
Copy link
Author

@thomasmars , thanks for the suggestion. I will give it a try because I just need to get the functionality working. Theming & designing is something that the themer will bother, not me (Buhahaha...) >:) ;)

Thanks!

@supriyarajgopal-spi
Copy link
Author

@thomasmars ,

Just thought of updating you that I fixed this by using hook_h5p_semantics_alter() and calling updateFeedbackContent() from the .js file mentioned in hook_h5p_scripts_alter() in my custom .module file.
So, here's what I did:

  1. Changed the 'common' setting of 'Feedback text' to 'false'. This made the field to appear for every question.
  2. Now I needed another 'Incorrect feedback text'. I created this in hook_h5p_semantics_alter()
  3. Next I had to find out if the user answered correctly based on which I could replace the text across that star animation ('You scored 1 of 2 points' by default)
    3.a. For this, I mentioned my custom .js file in hook_h5p_scripts_alter()
    3.b. In the custom .js file, I captured the relevant xAPI events and called 'updateFeedbackContent()' depending on whether 'result.success' is true or false
  4. updateFeedbackContent() is defined in question.js file of H5P.Question library

Regards,
Supriya Rajgopal

@thomasmars
Copy link
Member

Cool, glad it worked out :) If you decide to create a pull request for this I would be glad to review it.

@supriyarajgopal-spi
Copy link
Author

Hello @thomasmars ,

Thank you :) I would like to create a pull request but since I have used H5P hooks, I will have to create a module also, no? Do I submit that also in the pull request?

I am a little new to GitHub, any guidance would be appreciated.

@thomasmars
Copy link
Member

You would have to translate your hooks into the library.
This means create the semantic fields in the semantic.json file, instead of in the hook, and add the necessary logic to H5P.DragQuestion script instead of through a hook

@supriyarajgopal-spi
Copy link
Author

Gotcha @thomasmars .
I may need your help in finding the exact place to write the JS logic in H5P.DragQuestion script, if I don't figure it out myself.
Thanks in advance.

supriyarajgopal-spi pushed a commit to supriyarajgopal-spi/h5p-drag-question that referenced this issue Sep 1, 2016
'Incorrect feedback text' field is added and showScore() is modified to show (in)correct feedback per drag-and-drop question.
Also made the 'common' setting as 'false' and changed the label for 'Feedback' field so that it appears on every drag-and-drop question instead of for the whole question set
@supriyarajgopal-spi
Copy link
Author

@thomasmars ,
I have created a pull request here. Please review and do the needful.

Thank you.

@thomasmars
Copy link
Member

Thanks, current release is full, so hopefully this can get reviewed for the release after this one.

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