If you run the following code with the nid of a multichoice question, the question will lose its answer and feedback text:

$node = node_load($nid);

node_save($node);

This is extremely confusing if you are trying to create any sort of module that needs to directly manage these nodes.

I have attached a patch that fixes this issue. All the patch does is loads the alternative values for the node in the same format as the node add form submits them. This is how every other question type already works.

Comments

ganesan g’s picture

Issue summary: View changes
Status: Needs review » Closed (fixed)

@michaelk I didn't find such error in version 7.x-4.0-beta2. I suggest you to upgrade the quiz module to recent version instead of applying this patch.

  • Commit d59f8e2 on 7.x-4.x, 7.x-5.x authored by michaelk, committed by paalj:
    Issue #1843128 by michaelk: Calling node_save After Loading A...

  • Commit d59f8e2 on 7.x-4.x, 7.x-5.x, quiz-pages authored by michaelk, committed by paalj:
    Issue #1843128 by michaelk: Calling node_save After Loading A...

  • Commit d59f8e2 on 7.x-4.x, 7.x-5.x, quiz-pages, 2269219 authored by michaelk, committed by paalj:
    Issue #1843128 by michaelk: Calling node_save After Loading A...

  • Commit d59f8e2 on 7.x-4.x, 7.x-5.x, 2269219 authored by michaelk, committed by paalj:
    Issue #1843128 by michaelk: Calling node_save After Loading A...