Closed (fixed)
Project:
Decisions
Version:
6.x-1.2
Component:
Code
Priority:
Critical
Category:
Feature request
Assigned:
Reporter:
Created:
2 Aug 2009 at 04:20 UTC
Updated:
9 Nov 2009 at 21:00 UTC
Jump to comment: Most recent file
Add Condorcet voting, display, and calculation to the ranking.module.
Have the results display as a pairwise matrix, and have the rankings determined by Shultze method.
This issue is being created at the request of the maintainer after I mentioned to them that I was working on a patch that did this.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | decisions-537804-6.diff | 15.41 KB | Gauntlet-1 |
| #2 | decisions-537804-1.diff | 12.54 KB | Gauntlet-1 |
Comments
Comment #1
Gauntlet-1 commentedComment #2
Gauntlet-1 commentedOK, so this is my first-ever attempt to use CVS, or Eclipse, or this commenting tool. I can't count the number of things I'm probably doing wrong. Here goes.
Oh, and one thing. I'm diffing from the latest version, but it was actually developed against 0.1 beta three. I've tried to accommodate any changes, but it may show up.
Comment #3
Gauntlet-1 commentedComment #4
anarcat commentedA quick review:
Please respect existing indentation.
same here. That code should also be made themable, see: http://api.drupal.org/api/function/theme_table/6 This will also make the code more readable.
I haven't reviewed the actual algorithms.
Isn't that just a reimplementation of strcmp?
Do you have experience with unit testing? I would love to get this in to make sure Condorcet actually works and that it works even when we change things around it... See:
http://drupal.org/handbook/modules/simpletest
http://drupal.org/project/simpletest
http://www.lullabot.com/articles/introduction-unit-testing
http://www.lullabot.com/articles/drupal-module-developer-guide-simpletest
I know I haven't got a single test in yet, but now is as good time as any! ;) I *will* still accept your patch without unit tests however, so don't worry about that.
Thank you very much for your patch, keep up the good work!
Comment #5
Gauntlet-1 commentedI'll look into all of the above. Also, I've found at least one case where the algorithm goes loopy, so it's going to need some tweaking before it's ready for the light of day. Thanks for your patience and help.
Comment #6
Gauntlet-1 commentedOK, with the exception of unit testing, which is going to require a whole other level of learning for me, I think I've addressed all your concerns, and the circumstances of which I'm aware in which ties were screwing things up.
Until I learn more about unit testing, I don't know where to go from here except getting people to try it.
Comment #7
anarcat commentedAlright! You rock!
I will commit this patch shortly, but I would like you to make some adjustments, mostly on the documentation side. Mainly, the results display says this:
I don't see numbers in squares. In the results. I think that's all, this will be part of the next release!
Note that to test the patch, I have (painfully) inputed the voting results described on the wikipedia page (and they match) here:
http://decisions.test.koumbit.net/node/4
To fill in the results, I used this dummy SQL request I was tuning as I went along:
This is the kind of things I would like a simple test unit to do...
Comment #8
anarcat commentedPatch committed to head, thanks! Just figure out the "number given in square" issue and we can close this.
Comment #9
Gauntlet-1 commentedHey, anarcat. Sorry for disappearing off the face of the earth, there. School started.
I think you just need to change the sentence to "The table below indicates the number of voters who preferred the row to the column."
If I try to make a diff for that I'm going to screw it up. Easier for you to copy and paste, probably. :)
Comment #10
anarcat commentedAlright, I'll try to push this in the next release, thanks!
Comment #11
anarcat commentedCommitted a fix, thanks!