Talking to colleagues at Acquia, one of the reasons that we've sometimes used Survey Monkey as opposed to Webform when administering surveys on our website is that Survey Monkey is perceived to have better support for presenting possible answers in a randomized order (and thereby help avoid bias, etc).
Webform already provides this for the "grid" component (which is probably the most useful one), but seems like it would be pretty useful to provide it for the "select" component also?
So, I whipped up a patch to do this (attached). It really scares me how easy this patch was to write, which suggests that there's probably some kind of really obvious problem that I'm not thinking of, but anyway, it seems to work :)
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | webform_select_randomize.patch | 2.81 KB | quicksketch |
| #2 | webform_randomize_select_2.patch | 5.11 KB | David_Rothstein |
| webform_randomize_select.patch | 4.76 KB | David_Rothstein |
Comments
Comment #1
quicksketchThanks, this looks great! Seems like I caused a stir over there. ;-)
I'd say one of Webform's faults is how ridiculously simple its APIs are (or lack of APIs really), but it has the benefit that it's easy to grasp. It doesn't look like you missed anything at first glance. I'll give this a full review when I get the chance.
Comment #2
David_Rothstein commentedCool :)
I did notice one minor thing which was that I forgot to update the PHP docblock for one of the functions that changed. This is fixed in the attached patch (no changes to the actual code).
Thanks!
Comment #3
quicksketchMoving to the 3.x version for review.
Comment #4
quicksketchCommitted attached patch to the 3.x version. Thanks David, sorry this took so long. :-/
Comment #5
roball commentedI already make use of this useful new 3.x feature. Working fine!