John Dong [Tue, 14 Aug 2007 20:51:15 +0000 (16:51 -0400)]
* Changed XMLRPC API to use arrays of ID's to report results
* Add a list of names and ID's to the results struct, for future translation purposes to canonical names
Fixed choices_positions to use GruffGraff class. Initialize method now had a way of
dealign with multiple data arrays being passed in. Next need to compensate for giving each set of data it's own name, possible a hash with "name" => data as the key, value pairs...
Added the choices position and get_posititons_info to graph controller. Right now, since
the graph graphs a different set of data for each candidate, the data function has to be
called multiple times and I'm not sure how to do it/if it's possible within the class
definition. As such, I've defined everything within the choices_position method for now.
I'll be trying to figure out the kinks next. Overall, the graph is very confusing and
might not be very useful in the end, but the data it uses is.
Added a new bar graph, that counts how many points the borda system of
voting has asssigned to every candidate, it shows the margins fo victory
and loss clearly. Also had to make modifications to the RubyVote libary.
There was an error in BordaVote that prevented it from working correctly,
which has been fixed. Also added an attr_reader to BordaResult for
ranked_candidates. About to delete the Gruff Plugin v 0.1.2 and replace it
with Gruff gem v 0.2.8.
Removed the two methods from Application controller which were redundant -
the main version are in the graph controller. Started to add a borda bar
graph results method, when it came to our attention that the borda method
was most likely broken, counting only the most recent vote. Have added an attr_reader :election to Class Electionresults in rubyvote. About to attempt to fix the Borda method.
Updated the "votes_per_day" method in graph controller to work better and
read easier. Also, with Mako's insistence and help, wrote the "votes_per_interval" method (and helpers) in graph controller. The worst part of that
method is when I assign names to the labels_hash, ideas welcome, but it
works for now. Even though the graph uses fixed intervals and is named
"votes_per_interval" it actually shows votes over time (per interval),
so I may rename it in the near future (in fact I would've renamed it for
this commit, but I didn't think till I was writing this statement.)
<mako@atdot.cc> [Tue, 7 Aug 2007 23:23:05 +0000 (19:23 -0400)]
Modified QuickVote table to work by object type and not by the weird
TinyInts so that we can take advantage of the single table inheritence
magic in AR.
The user model has been modified so that it stores the user object itself in the session[:user]. Session[:user_id] fulfills the purpose of holding the specific id. the test files were also modified to account for the changes. In addition, a couple lines in the SiteController#index method were updated tp utilize new funtionality of ActiveRecord. The changes I made to the Authenitcated user library is available here:http://technoweenie.stikipad.com/plugins/show/Storing+the+User+Model+in+the+Session.
Changed the Selectricity header into a link, and modified the config/routes.rb file to include a new named route: "graph." Use graph_url syntax to call a Gruff method from the graphs controller. Currently about to troubleshoot the user system.
Modified the methods in graphs controller so they would work for Selectricity, but can't get them to successfully display yet. It seems that the 'url_for' helper might not be able to handle a :controller an argument. It doesn't throw an error, just displays nothing. I also removed various deprecated methods and replaced them with their updated counterparts in site_controller, and in some of the views. In addition I modified the confirm method in the QuickVote controller to save the time of the vote. I also changed what the voter.ip was logging because it wasn't working. Currently it says request.env["BLAH"] because I'm trying to vote multiple times in the same election for testing (not sure that jsut cahgnign the ip save feature is allowing that) but it will have to be request.env["REMOTE_ADDR"] in the long run. This is on line 108 of the QuickVote controller.
Well, it seems I forgot to add the acts_as_authenticated to the repository on my last commit, but they're there now. Also, I recently added the Gruff graphing plugin, and created a new controller for the graphs, with a method I ported from pollarize to chart how many people have voted per day. The basic_login page works, and the create user sstem works, but is unpolished and still points to a poem as the index page, so if you read a poem, it's supposed to happen. The quickvote creation from the homepage is NOT working however, and is about to be investigated. I'm not sure how much else isn't working. I noted details abotu acts_as_authenticated adn Gruff in the README.
I have added the acts_as_authenticated plugin to code, and have gotten VERY BASIC functionality. This isn't my last addition fortoday but I wanted to commit before my battery died. A lot of the detailed documentation about where to find help with acts_as_authenticated is in the README, the website is here :http://technoweenie.stikipad.com/plugins/show/Acts+as+Authenticated. The acts_as_authenitcated generator also heavily modifed the user class (model) but I kept theo original lines as well. I havne't begun tothrow anyting out yet, because im using it as a refernce to get the new system running.
In the process, I had to completely gut the login engine which means
that parts of the site that require logins will not work at all. This
should be fixed ASAP.
<mako@atdot.cc> [Thu, 12 Oct 2006 13:40:47 +0000 (09:40 -0400)]
Made a large number of mostly cosmetic fixes after a detailed
run-through of quickvotes. Also added support for tracking IP addresses
into the database.
<mako@atdot.cc> [Wed, 11 Oct 2006 05:34:23 +0000 (01:34 -0400)]
Added initial support fo QuickVotes. There is support for the creation
of quickvotes in the database. There is not yet support for voting in
quickvotes.
* Contiue with upgrade to Rails 1.1
* Large variety of fixes to various bits and pieces.
* Rudimentary (and broken) support for email in two different areas.
* Much improved list screen for elections.
* Initial voter-based interface based around tokens.
* New uniq_token regenerating library.
Left things a little bit unstable including:
* uniq_token should be refactored to provide only a class method.
* voter list review page is unwritten
* rankings are committed to the database but some sort somewhere seems
to be botching things.
Initital scaffolding of the website plus initial work on the adding and
editing general information for votes and list of candidates. The first
steps toward importing voters has also been added.