Global

Members

LiveEventQuizEnd :String

The game id
Type:
  • String
Source:

Methods

calculateReadTime(str) → {Number}

calculateReadTime - Calculates a time for the question ready text to be read
Parameters:
Name Type Description
str String The text to calculate by
Source:
Returns:
The time in seconds for the text to be read
Type
Number

DataRequest(data)

DataRequest - Handles requests to get data. Responds with https://kahoot.js.org/enum/LiveEventBackup
Parameters:
Name Type Description
data Object The data from the server https://kahoot.js.org/enum/LiveDataRequest
Source:

EndGame() → {Promise.<Boolean>}

EndGame - Sends the message to end the quiz
Source:
Returns:
Whether the message was sent successfully
Type
Promise.<Boolean>

FeedbackSent(data)

FeedbackSent - Handles feedback
Parameters:
Name Type Description
data Object The feedback data. https://kahoot.js.org/enum/LiveFeedbackPacketContent
Source:

getPoints(type, question, choice, client, answer) → {Number}

getPoints - Returns an amount of points and updates various point-related data for players
Parameters:
Name Type Description
type String The type of the question
question Question The question
choice Number | String | Array.<Number> The choice of the player
client Client The client
answer Object The player's answer
Source:
Returns:
The points earned for the question
Type
Number

isCorrect(type, choices, choice, client) → {Boolean}

isCorrect - Calculates whether the player's answer was correct or not
Parameters:
Name Type Description
type String The question type
choices Array.<Object> The question choices
choice Number | String | Array.<Number> The player's choice
client Client The client
Source:
Returns:
Whether correct or not
Type
Boolean

KickPlayer(cid) → {Promise.<Boolean>}

KickPlayer - Kicks a player
Parameters:
Name Type Description
cid String The cid of the player to kick
Source:
Returns:
Whether the kick was successful or not
Type
Promise.<Boolean>

Lock() → {Promise.<Boolean>}

Lock - Locks the game
Source:
Returns:
Whether the lock message was sent successfully
Type
Promise.<Boolean>

PlayerJoined(data)

PlayerJoined - Handles players joining
Parameters:
Name Type Description
data Object The information about the player https://kahoot.js.org/enum/LiveEventPlayerJoined
Source:

PlayerLeft(data)

PlayerLeft - Manages players leaving the game
Parameters:
Name Type Description
data Object The player leave data https://kahoot.js.org/enum/LiveEventPlayerLeft
Source:

QuestionAnswered(data)

QuestionAnswered - Handles answers from players
Parameters:
Name Type Description
data Object The answer data https://kahoot.js.org/enum/LiveQuestionAnswered
Source:

ReadyQuestion() → {Promise.<Boolean>}

ReadyQuestion - Notifies players that the question is about to start
Source:
Returns:
Whether the message was sent successfully
Type
Promise.<Boolean>

ReplayGame() → {Promise.<Boolean>}

ReplayGame - Notifies players that the game is replaying
Source:
Returns:
Whether the message was sent successfully
Type
Promise.<Boolean>

RequestFeedback() → {Promise.<Boolean>}

RequestFeedback - Requests feedback from the players
Source:
Returns:
Whether the request was successful
Type
Promise.<Boolean>

ResetGame() → {Promise.<Boolean>}

ResetGame - Notifies the server that the game is reset and should kick all players
Source:
Returns:
Whether the message was successfully sent
Type
Promise.<Boolean>

ResetTwoFactorAuth() → {Promise.<Boolean>}

ResetTwoFactorAuth - Notifies that the two-factor auth was reset
Source:
Returns:
Whether the notice was sent successfully
Type
Promise.<Boolean>

SendQuestionResults() → {Promise.<Boolean>}

sendQuestionResults - Sends the end question data to the clients
Source:
Returns:
Whether the message was successful
Type
Promise.<Boolean>

SendRankings() → {Boolean}

SendRankings - Sends the final podium info to the players
Source:
Returns:
Whether the message was sent successfully
Type
Boolean

shuffle(array) → {Array}

shuffle - Shuffles an array
Parameters:
Name Type Description
array Array The array to shuffle
Source:
Returns:
The shuffled array
Type
Array

sleep(n) → {Promise}

sleep - Resolves after n seconds
Parameters:
Name Type Description
n Number The amount of seconds to wait
Source:
Returns:
Resolves after n seconds
Type
Promise

Start() → {Promise.<Boolean>}

Start - Notifies players that the quiz started
Source:
Returns:
Whether the message was sent successfully
Type
Promise.<Boolean>

StartQuestion() → {Promise.<Boolean>}

StartQuestion - Notifies players that the question started
Source:
Returns:
Whether the message was sent successfully
Type
Promise.<Boolean>

StartTeamTalk() → {Promise.<Boolean>}

StartTeamTalk - Notifies players that the team talk has started
Source:
Returns:
Whether the message was sent successfully
Type
Promise.<Boolean>

TeamSent(data)

TeamSent - Handles team members being sent
Parameters:
Name Type Description
data Object The team info https://kahoot.js.org/enum/LiveJoinedTeamPacket
Source:

TimeOver() → {Promise.<Boolean>}

TimeOver - Notifies players that the time is up
Source:
Returns:
Whether the message was sent successfully
Type
Promise.<Boolean>

TwoFactorAnswered(data)

TwoFactorAnswered - Handles two-factor answers
Parameters:
Name Type Description
data Object The two-factor answer data. https://kahoot.js.org/enum/LiveTwoStepAnswered
Source:

Unlock() → {Promise.<Boolean>}

Unlock - Unlocks the game
Source:
Returns:
Whether the game was successfully unlocked
Type
Promise.<Boolean>

Events

Disconnect

Emitted when the game is disconnected
Source:

FeedbackReceived

Emitted when feedback is received
Type:
  • Object
Source:
See:

FeedbackRequested

Emitted when feedback is requested
Source:

GameEnd

Emitted at the end of the quiz
Type:
Source:

GameReset

Emitted when the game resets
Type:
  • Quiz
Source:

GameStart

Emitted when the quiz starts
Type:
  • Quiz
Source:

PlayerJoined

Emitted when a player joins the game
Type:
  • Object
Source:
See:

PlayerLeft

Emitted when a player leaves
Type:
  • Object
Source:
See:

QuestionAnswered

Emitted when a player answered a question
Type:
  • Object
Source:
See:

QuestionReady

Emitted when the question is starting up
Type:
  • Question
Source:

QuestionResults

Emitted when the question has ended
Type:
Source:

QuestionStart

Emitted when the question starts
Type:
  • Question
Source:

Rankings

Emitted at the end of the game, before GameEnd
Type:
Source:

RecoveryDataRequested

Emitted when recovery data is requested
Type:
  • Object
Source:
See:

TeamReceived

Emitted when a team is sent
Type:
  • Object
Source:
See:

TimeOver

Emitted when the time is up
Source:

TwoFactorAnswered

Emitted when the two factor was answered
Type:
  • Object
Source:
See:

TwoFactorAuthReset

Emitted when the two factor resets
Type:
  • Array.<Number>
Source: