Attached is a patch that will allow the order of answers to be randomized when the poll is viewed. There is a checkbox on the node add/edit screen that allows the creator/editor to specify whether the answers are to be randomized for the particular poll.

Comments

anarcat’s picture

Priority: Normal » Critical
Status: Active » Needs work

Thank you for your contribution to the project! I think this feature would be a great addition, and barring any major issue in testing, I think it should go in. I have some nitpicking over the patch here, and I need to test it before committing it, but it's otherwise a very welcome addition that I hope will make it in the next release.

Here's the quick code-wise review.

+++ decisions.install	10 Sep 2009 21:28:12 -0000
@@ -113,6 +114,16 @@ function decisions_update_5() {
+function decisions_update_6() {

this should be update_6000, since we're in D6 now

+++ decisions.module	10 Sep 2009 21:28:12 -0000
@@ -1086,7 +1086,6 @@ function decisions_load($node) {
-  $decision->choices = count($decision->choice);

why is that necessary? i remember this assignment was necessary for the form display...

wonder95’s picture

Status: Needs work » Needs review
StatusFileSize
new7.08 KB

I think you looked at the wrong function, because I did have decisions_update_6(). Changed it to decisions_update_6000().

I'm not sure why I had that line removed, so I added it back.

Also noticed I was missing an update for selections.module, and my update and insert queries in decisions.module weren't quite right.

Re-rolled patch is attached.

wonder95’s picture

StatusFileSize
new7.43 KB

Did some more cleanup:

  1. Added more comments to _decisions_randomize_options()
  2. Removed commented out dsm() call from _decisions_randomize_options()
  3. I had the number of options hardcoded to 5, so added $num_choices to call to _decisions_randomize_options() from ranking_decisions_voting_form() and selection_decisions_voting_form()
anarcat’s picture

Status: Needs review » Fixed

Committed thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.