Thursday, April 19, 2012

How to do Google Docs Polls - Part 2

This is Part 2 of a multipart series on doing simple polls with Google Docs. Anyone can put together a poll in Google Docs, but with this set up you can eliminate voter fraud and ballot box stuffing.

Voter ID

Choosing a Voter ID is important. If you have access to a unique identifier for your voters then you can use that to record votes. A problem arises in that voting is not anonymous and if the Voter ID can be guessed then voter fraud can occur.

The solution to this problem is to generate random, anonymous Voter IDs and distribute them to our voters via email. To do this we are going to take our spreadsheet from Part 1 and add yet another sheet. In this sheet we will add the email address of all of our voters. We are then going to create a named range for this array of addresses that will be used by the script we are about to create to generate our Voter IDs.

Let's outline what the script needs to do:
  1. Read the array of voters from the spreadsheet
  2. Randomize the order of the array
  3. Loop through the array of randomize email addresses and generate a Voter ID token, email that token to the voter and record that token in the list of valid Voter IDs
Once this script has been run we can delete the sheet with the voter email addresses. Some caveats, in the spreadsheet for this part I have kept the length at 100 rows. For efficiency's sake you should have the same number of rows as voters. The size of the VOTERIDS range must match the size of the VOTEREMAILS.

Resources:
Movie Poll - Part 2 spreadsheet with script

The script in these sample files must be edited to work in your project. In the future I will add a generic script into the gallery that you can include manually. It may also be nice to pull the emails from a contact group instead of making you create them. Finally all the extra pages and charts can be generated by the script.

In the last part of this series I am going to show you how to remove the Voter ID field from the form.

No comments:

Post a Comment