Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jhedstrom’s picture

Status: Active » Needs work
FileSize
3.59 KB

Here 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.

jhedstrom’s picture

Status: Needs work » Needs review
FileSize
2.8 KB
6.29 KB

This 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.

jhedstrom’s picture

FileSize
9.29 KB
6.69 KB

This patch abstracts out the inline feedback into a separate method, rather than further complicate the getAnsweringForm method.

jhedstrom’s picture

FileSize
3.03 KB
7.23 KB

This patch adds support for multiple choice checkboxes (where more than one answer can be selected).

jhedstrom’s picture

FileSize
4.02 KB
9.26 KB

This 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.

djdevin’s picture

Hi,

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

jhedstrom’s picture

I 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).

djdevin’s picture

Yeah 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.

jhedstrom’s picture

FileSize
49.21 KB

@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.

djdevin’s picture

FileSize
30.14 KB
29.25 KB

It'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

nielsonm’s picture

Re-rolled a patch as a first attempt for 5.x. YMMV.

nielsonm’s picture

OOps it looks like the multichoice selectors have changed, re-rolling.

nielsonm’s picture

Quiz question answering form error fixed, trying again.

nielsonm’s picture

Added states selector for true false questions.

nielsonm’s picture

Version: 7.x-4.x-dev » 7.x-5.x-dev

Changing version.

djdevin’s picture

Status: Needs review » Active

Thanks 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.

bobojo’s picture

Hey! 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!

Sebastian_Campanella’s picture

Hello, can I use this patch? and is compatible to 7.x-5.0-alpha4 version?

djdevin’s picture

Status: Active » Closed (outdated)