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.
Hi
Running Quiz 7.4-4.0-beta1. I've added some alternatives to a multichoice question and now I need to remove one alternative. I can't see an option anywhere. Am I missing something, or is the module missing something?
Thanks
David
Comments
Comment #1
kyuubi CreditAttribution: kyuubi commentedHi!
I am having the same problem and the website is already live?
Is this a bug?
Comment #2
garphy CreditAttribution: garphy commentedI think its a feature not currently implemented.
Raising to major as it seems that the module won't leave beta state without this feature.
Comment #3
djdevinCan someone give this a try with the 5.x version?
Comment #4
duynguyen CreditAttribution: duynguyen commentedI've a patch for this issue. hopeful it can help you guys
Comment #5
duynguyen CreditAttribution: duynguyen commentedre #4. the variable choice_count need to store in $form_state
Comment #6
somersoft CreditAttribution: somersoft commentedThe attached patch works with the 7.x-5.x-dev code.
Comment #7
djdevinComment #8
Da_Cloud CreditAttribution: Da_Cloud at INDICIA commentedI've applied the patch on the current dev release, but when I try to use the Remove button I'll end up with an AJAX error.
Watchdog logs the following:
Comment #9
GlennDW CreditAttribution: GlennDW as a volunteer and commentedI have changed it so that if you delete a choice and then save the node it will work. So if you delete a choice and refresh the page the choice will be back but if you delete it and then save the node it will work
Comment #10
GlennDW CreditAttribution: GlennDW as a volunteer and commentedComment #12
djdevinYour patch looks good, it just has to be re-rolled because it includes your sites/all/modules/contrib path.
Do you think you could add a test case too?
Comment #13
GlennDW CreditAttribution: GlennDW as a volunteer and commentedI have changed it
Comment #14
GlennDW CreditAttribution: GlennDW as a volunteer and commentedComment #16
GlennDW CreditAttribution: GlennDW as a volunteer and commentedremade the patch
Comment #17
drupov CreditAttribution: drupov commentedWork for me with 7.x-5.x-dev functional, but there is a php notice:
Notice: Undefined index: id in MultichoiceQuestion->getCreationForm() (line 584 of /home/d2x7a/www/sites/default/modules/quiz/question_types/multichoice/multichoice.classes.inc).
Comment #18
djdevinComment #19
lintxa CreditAttribution: lintxa at Metadrop commentedThe notice occurred because the multichoice_remove_alternative_submit function did not return the ids of the alternatives when rebuilding the $form_state.
Once added it seems to work correctly.
Please review.
Comment #20
lorenzs CreditAttribution: lorenzs at Cegeka commentedTested in 5.2 and we use it for several months now in production.
Probably this could use an additional test but technically it's fine.
Comment #21
djdevinI added a test.
Comment #22
Da_Cloud CreditAttribution: Da_Cloud at INDICIA commentedTested the patch on a clean install and it correctly adds the remove button.
So based on comment #20 and the fact that there are also working test cases I'd say this patch is ready to be committed.
Comment #24
djdevinThanks! Fixed.