Skip to content
Branch: master
Go to file
Code

Latest commit

Andy Hurd authored and stringham committed 483e708 Nov 21, 2019
Add option to remove winners from drawing and other improvements
Other improvements include:
* keeping dark color when points go above the number of colors enumerated
* import tab separated data with points via function available in console
* fixing random logic for raffle with points to be more evenly distributed

Files

Permalink
Failed to load latest commit information.

README.md

Raffle

HTML and Javascript Raffle System

Demo here.

How To Use

In js/names.js you can add a pre-made list of names to be used in the raffle. You do this by defining an array of JSON objects. Each JSON object must contain a name, and can optionally contain points.

var imported = [
	{
		name: 'Fred',
		points: 3
	},{
		name: 'Ryan',
		points: 2
	},{
		name: 'Sherry'  //no points defaults to 1
	},{
		name: 'Amanda',
		points: 3
	}
];

Otherwise when you load index.html it will have a text field in which you can enter names separated by new lines.

Once the raffle has been loaded you start it by clicking anywhere on the page!

Using a Google Form

Create a google form that collects the First Name and Last Name, or just the Name of participants (along with whatever other information you want to collect)

Example form: form.

View the responses of the form as a google spreadsheet and go to file->publish to the web. Click the publish button.

Get the spreadsheet key, which is after the /d/ in the url. In the example form the spreadsheet backing the responses has a spreadsheet key of:

1yCcGRUa6Q4vJN9MCleEozuJvADHMb8AXnHwm3o8ZdQ0

Put that key in the query string of the raffle page as the key, for example:

http://stringham.me/raffle?key=1yCcGRUa6Q4vJN9MCleEozuJvADHMb8AXnHwm3o8ZdQ0

Whenever someone submits to the form they will be automatically added to the raffle when the page is loaded. Awesome.

You can’t perform that action at this time.