Tuesday, January 17, 2017

Google Forms: Choose a Random Winner

From Alice Keeler's Blog - http://alicekeeler.com/2017/01/04/google-forms-choose-random-winner/ 

Google Forms: Choose a Random Winner

Choose a random winner from those who fill out your Google Form. Use this Add-on I coded in Google Apps Script to automatically select a winner, create a spreadsheet listing the winner and 19 runner ups and receive an email with the winner and links to the Form and spreadsheet.
If you are having participants at an event fill out an evaluation form you can use this Add-on to randomly select people for a drawing. Randomly select a student in class to share about their work.

Template

In order to use this template you must use the above link to create your Google Form or copy and paste my code from the script editor into the script editor of your existing Google Form. Note: Your form MUST automatically collect responses in order for this code to work.

Create Your Form

The link above will prompt you to make a copy of my Google Form template. Create your form questions just as you normally would.

Collect Responses

Just as you normally would, have people fill out the form.

Choose a Random Responder

At any point after collecting responses, use the puzzle piece icon in the Google Form to run the Add-on “Choose Random Responder.”
Choose random responder
The Add-on will randomly select a winner from all form responses. A pop-up will indicate who won, by email address. The pop-up will also tell you the response number.
pop up to indicate winner

Individual Responses

In the Google Form, click on “Responses” and then click on “Individual” to see the individual responses. There is a spot to arrow to each of the individual responses. You can type in the winner’s response number and press enter to jump to that person’s response.
individual responses

Spreadsheet of Winners

Each time you use the Add-on a spreadsheet is created. You will receive an email with the link to the winner spreadsheet. The Add-on chooses one random winner and 19 runner ups. (There may be duplicates, the formula does not take into consideration if someone has already been chosen.) Use the spreadsheet to view the 19 runner ups.

Add the Add-on to YOUR Google Form

If you already have a Google Form, you will need to copy and paste the code into your Form.
If you used my template you do NOT need to do these directions.
random winner google apps script by alice keeler
Open the code and use Control A to select all. Use Control C to copy.
In the Google Form, click on the 3 dots icon in the upper right. Choose “Script editor.” You will want to paste (Control V) the code into the script editor.
3 dots script editor

In the script editor you will need to do a few things.
  1. Suggestion to remove the default function already there. (Control A, delete).
    It does not matter if you leave it there, but you also don’t want it in the way of your code.
  2. NAME the script. What you name it is what shows up in the Add-on menu. I named mine “Choose Random Responder.”
  3. Click SAVE. It’s in the toolbar.
  4. Select the “onInstall” function from the toolbar. It probably says “Select function.”
  5. Run the script. You want to install the Add-on. Press the triangle icon in the toolbar.
  6. Close the script editor, you don’t need it anymore.
You need to do this PER FORM. This Add-on is NOT available in the market place.

No comments:

Post a Comment