Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The idea for this would be that on multiple choice, true/false, and perhaps drag/drop, feedback could be provided immediately via javascript/jquery.
#893312: Next question below the former is somewhat related.
This is different from the concept of ajax_quiz.
Comment | File | Size | Author |
---|---|---|---|
#14 | quiz-immediate-feedback-5x-2231031-14.patch | 10.57 KB | nielsonm |
#10 | reviewoptions.png | 29.25 KB | djdevin |
#10 | inline.png | 30.14 KB | djdevin |
#5 | immediate-feedback-2231031-05.patch | 9.26 KB | jhedstrom |
Comments
Comment #1
jhedstromHere is a proof-of-concept for a single question type (true/false). It uses the Form States API to display the feedback as the user answers the question.
I wanted to post this initial patch here for feedback since it is somewhat of a departure from how the other feedback works.
I am going to tackle multiple choice next.
Comment #2
jhedstromThis patch adds multiple choice support. Since multichoice allows 2 feedbacks per alternative, the inline feedback can get a little convoluted (eg, an 'incorrect' answer will display the 'not chosen' feedback from another 'incorrect' answer, and this is considered 'correct' feedback.
I have been basing this work against 4.x since 5.x was not being actively updated, but now given #2220635: co-maintainer request for djdevin and new activity on 5.x, I wonder if I should be developing against that branch? This work will need to go live in May or June, that's another reason all my patches had been coming in against 4.x.
Marking as needs review, not because I think it is ready, but because I would like review on the initial proof-of-concept implementation.
Comment #3
jhedstromThis patch abstracts out the inline feedback into a separate method, rather than further complicate the getAnsweringForm method.
Comment #4
jhedstromThis patch adds support for multiple choice checkboxes (where more than one answer can be selected).
Comment #5
jhedstromThis patch moves the feedback into the answering table for multichoice questions. It also fixes the jquery to trigger a change on the checkbox element (which the States API depends on) when a user clicks a row in the table instead of the checkbox itself.
Comment #6
djdevinHi,
Can you see if 5.x has this already?
We already have immediate feedback for all question types and a LOT of other review configurations. AJAX immediate feedback is still on the back burner but it should be easier to implement there as well without having to change the question type API in 5.x
Comment #7
jhedstromI will check out 5.x--is there currently an upgrade path? We're pretty deep into a 4.x deployment at this point, and to switch, would need that to be fairly solid (something we can work on if it does not yet exist).
Comment #8
djdevinYeah there's an upgrade path from 4.x-dev, irreversible of course but I'm positive that when 5.0 is out it will be a safe migration at least for all the core Quiz functionality.
Comment #9
jhedstrom@djdevin are there details on how to setup immediate feedback? I am playing around with 5.x, and am not seeing an option to show feedback as the user answers questions.
Here is a screenshot of how this patch is currently working to display feedback inline:
If that sort of feedback isn't already available in 5.x, I can probably start working on porting this to 5.x.
Comment #10
djdevinIt's functionally the same but yours is prettier. However in 5.x is works for all question types that implement question feedback. So, any feedback that was visible at the end of the quiz is now visible after the question as well, with the ability to turn off/on certain parts like score, points, feedback, etc
In 5.x, when creating a Quiz check off "repeat until correct"
Also under the "Review" section, under "After the question" turn on the pieces of information you would like to see. Also note I think this is only available in 5.x-dev
Comment #11
nielsonm CreditAttribution: nielsonm commentedRe-rolled a patch as a first attempt for 5.x. YMMV.
Comment #12
nielsonm CreditAttribution: nielsonm commentedOOps it looks like the multichoice selectors have changed, re-rolling.
Comment #13
nielsonm CreditAttribution: nielsonm commentedQuiz question answering form error fixed, trying again.
Comment #14
nielsonm CreditAttribution: nielsonm commentedAdded states selector for true false questions.
Comment #15
nielsonm CreditAttribution: nielsonm commentedChanging version.
Comment #16
djdevinThanks for your effort - this is a great feature and I think it's important for Quiz 7.x-5.x and might even replace the ajax_quiz module.
However I don't like the idea that every question type will have to provide an AJAX-enabled response form in addition to a regular response form. Currently only multichoice is supported in the patch.
I'm going to hold off on this patch until we are done with #2328657: Uniform Quiz question result, feedback, icons which may open up the functionality to do this across all question types and then we can revisit it.
Comment #17
bobojo CreditAttribution: bobojo commentedHey! It looks like #2328657: Uniform Quiz question result, feedback, icons is complete now; what needs to happen to make more progress on this issue now? Can I still apply the patches included above, or does a new one need to be written? I'm interested in contributing if I can!
Comment #18
Sebastian_Campanella CreditAttribution: Sebastian_Campanella commentedHello, can I use this patch? and is compatible to 7.x-5.0-alpha4 version?
Comment #19
djdevinSee #3044883: is Ajax quiz ready for production?