]> git.donarmstrong.com Git - debian-ctte.git/commitdiff
fix tally sheet generation for > 9 options (should be letters, not two digit numbers)
authorDon Armstrong <don@donarmstrong.com>
Tue, 14 Apr 2015 23:53:04 +0000 (16:53 -0700)
committerDon Armstrong <don@donarmstrong.com>
Tue, 14 Apr 2015 23:53:04 +0000 (16:53 -0700)
scripts/pocket-devotee

index 0888fbaa1c132901ae797f360e9759ad18ca45ea..5fb9fdcd48daff9cf94ea9350716a45065a4d2de 100755 (executable)
@@ -216,7 +216,7 @@ sub winner {
           }
           $vote = '';
           for my $opt (@options) {
-              $vote .= exists $option_rank{$opt->{key}} ? $option_rank{$opt->{key}} : '-';
+              $vote .= exists $option_rank{$opt->{key}} ? $number_to_option{$option_rank{$opt->{key}}} : '-';
           }
           print {$RESULTS} "V: $vote $voter\n";
 
@@ -305,12 +305,12 @@ EOM
       foreach my $i (0..($max_choices - 2)) {
           if ($K > $Beat_Matrix[$i][$max_choices - 1]) {
               $Drop{$i}++;
-              print {$RESULTS} "Dropping Option", $order_to_options{$i + 1}{key}, 
+              print {$RESULTS} "Dropping Option ", $order_to_options{$i + 1}{key}, 
                   " \"", $order_to_options{$i + 1}{name},
-                  "\" because of Quorum\n";
+                  "\" because of Quorum ($K > $Beat_Matrix[$i][$max_choices - 1])\n";
           } else {
               print {$RESULTS} "Option ", $order_to_options{$i + 1}{key},
-                  " Reached quorum: $Beat_Matrix[$i][$max_choices - 1] > $K\n";
+                  " Reached quorum: $Beat_Matrix[$i][$max_choices - 1] >= $K\n";
           }
       }
       print {$RESULTS} "\n\n";