A web-based platform for live quizzes.
It consists of a master client, one or more player clients and a server to handle the communication between them.
- The master resets the game state and asks a question.
- The players who want to answer subscribe to the question (like if they pressed a buzzer button).
- The first player who subscribes can give the answer, while the other players are added to a queue.
- If the answer is wrong, the master skips to the next player in the queue until either the answer is right or the queue is empty.
$ npm install --save quizjs
The package contains a basic socket.io server that can be run with:
$ node implementations/socket.io/quizjs-socket.io.js
The socket.io player and master clients are built into the dist
directory by simply running:
$ grunt
There are no UI components included included in this package.
Here you can find a simple player implementation.
Registers a new player to the QuizJs server and returns its ID.
Subscribes a player to the current question.
Passes the turn to the next subscriber.
Empties the current subscriber queue and allows all the players to subscribe for a new question.
The QuizJs server also implements the following methods of events.EventEmitter: on
, once
, removeListener
, removeAllListeners
.
Sent when a player is registered to the QuizJs server.
Sent when the QuizJs server state is reset.
Sent when the QuizJs server state is updated.
MIT © Alberto Congiu