There are a number of conditions that will cause multichoice_validate to let improper values through.
For example, create a question, add two answer choices, and then select the correct checkbox in a later (empty answer) row. When you click Preview, the validation routine will think that there is a correct choice, and that empty row will show up in the preview pane, although that row isn't actually inserted into the table when you click Submit.
The following patch cleans up these problems, and adds a check for text in the feedback cell without a corresponding answer.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | multichoice_validatation.patch | 2.28 KB | kscheirer |
| #2 | multichoice_validate_corrects_patch_0.txt | 812 bytes | kscheirer |
| multichoice_validation.patch.txt | 2.06 KB | kthagen |
Comments
Comment #1
add1sun commentedThis should be addressed before a stable release so marking this for 5.x-1.x
Comment #2
kscheireralso, you can check "multiple answers" but select only 1 correct answer. This patch adds a test for that situation.
Comment #3
add1sun commentedthe original patch doesn't apply anymore so a new patch combining these will be need to be rolled. will get to that later today.
Comment #4
kscheirerThis is a combined patch of the above.
kthagen's original patch decided not to issue a warning if you marked an empty choice as correct, but I figured why not.
Also I didn't include the change to multichoice_render_question(), since thats covered here.
Also added periods at the end of some warnings, so they are all consistent.
Comment #5
kscheirerComment #6
add1sun commentedThanks Karl! worked fine for me - added to 5 and HEAD.
Comment #7
(not verified) commented