Git Product home page Git Product logo

jeophpardy's Introduction

JeoPHPardy

This is a simple PHP/Javascript Jeopardy-like board that I've used to run some trivia games in the PHP community.

It has suited my needs well, along with my Wireless Eggspert buzzer system, and I've had requests that I publish the source, so that they could use it as well. I can't offer any guarantees that it'll work though, since I have put absolutely no work into making it work anywhere but on my computer and for my needs.

If you end up using it and making any improvements, please consider sending me a PR.

Requirements

This is what I used to develop/run the game. It may work in other browsers or operating systems, but I have not tested it anywhere but my laptop.

  • Mac OS X Mavericks
  • Google Chrome (up-to-date)
  • PHP 5.4+ w/ built-in PHP server
  • Fonts (download, install, and license yourself)

Features

  • Supports 5 categories
  • Supports 5 question levels (e.g., 200, 400, 600, 800, 1000)
  • Questions are loaded from a PHP array
  • Base score can be configured, so that Double Jeopardy rounds can be scheduled
  • Scoreboard with 6 players
  • Players can be named
  • On question screen, players can be given points (or have points taken away) by clicking on their name (or shift+clicking for negative). There is also a skull button which is used to reveal the answer if no player gets it correct.
  • There is one Daily Double randomly assigned to one of the $800 or $1000 dollar questions.
  • Final Jeopardy is supported, but is a separate file.

Limitations

  • There is always 6 players
  • There is always 1 Daily Double
  • I wrote this code quickly, and I'm not very good with JavaScript.
  • Don't refresh the page
  • Final Jeopardy is a separate file and does not hook into the scores at all.
  • No music or sound effects

How to use

First you must create a round using empty-round.php as a template. It looks like this:

<?php return [
	'pointScale' => 200, // Change this to adjust point values
	'categories' => [
		[
			'name' => 'xx', // e.g., Potent Potables
			'questions' =>  [
				[
				 	'question' => 'xx', //e.g., This is my name.
				 	'answer'   => 'xx', //e.g., What is Jeremy?
				],
				[
				 	'question' => 'xx',
				 	'answer'   => 'xx',
				],
				[
				 	'question' => 'xx',
				 	'answer'   => 'xx',
				],
				[
				 	'question' => 'xx',
				 	'answer'   => 'xx',
				],
				[
				 	'question' => 'xx',
				 	'answer'   => 'xx',
				],
			]
		],
		// Repeated for each category...

Next, make sure play.php is set to load your round.

$game = include 'my-round.php';
include 'template.php';

Then, start a PHP server in the directory containing the index.html, and go to it in your browser. Yay!

Final Jeopardy

To setup final jeopardy, create a file similar to my-round.php using final-empty.php as a template. Then load it up in final.php by referencing it:

$game = include 'my-final.php';

Finally, load up final.php in your browser and click anywhere in the screen to proceed from category through to thanks.

License

The MIT License (MIT)

Copyright (c) 2014 Jeremy Lindblom

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

jeophpardy's People

Contributors

jeremeamia avatar sgolemon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

jeophpardy's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.