UNPKG

kahoot.js-latest

Version:
4,317 lines (1,110 loc) 61.3 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JSDoc: Class: Client</title> <script src="scripts/prettify/prettify.js"> </script> <script src="scripts/prettify/lang-css.js"> </script> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css"> <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css"> </head> <body> <div id="main"> <h1 class="page-title">Class: Client</h1> <section> <header> <h2><span class="attribs"><span class="type-signature"></span></span>Client<span class="signature">(options)</span><span class="type-signature"></span></h2> </header> <article> <div class="container-overview"> <h4 class="name" id="Client"><span class="type-signature"></span>new Client<span class="signature">(options)</span><span class="type-signature"></span></h4> <div class="description"> constructor - Create a Kahoot! client. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>options</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="description last">Sets up the client. Options can control what events and methods are available to the client. By default, all options are enabled, besides proxies.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="kahoot.js.html">kahoot.js</a>, <a href="kahoot.js.html#line17">line 17</a> </li></ul></dd> </dl> </div> <h3 class="subsection-title">Namespaces</h3> <dl> <dt><a href="Client_data.html">data</a></dt> <dd></dd> <dt><a href="Client_defaults.html">defaults</a></dt> <dd></dd> <dt><a href="Client_quiz.html">quiz</a></dt> <dd></dd> </dl> <h3 class="subsection-title">Methods</h3> <h4 class="name" id=".defaults"><span class="type-signature">(static) </span>defaults<span class="signature">()</span><span class="type-signature"> &rarr; {class}</span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="kahoot.js.html">kahoot.js</a>, <a href="kahoot.js.html#line59">line 59</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> Returns a new Client constructor which uses new defaults </div> <dl> <dt> Type </dt> <dd> <span class="param-type">class</span> </dd> </dl> <h4 class="name" id=".join"><span class="type-signature">(static) </span>join<span class="signature">()</span><span class="type-signature"> &rarr; {Object}</span></h4> <h5 class="subsection-title">Properties:</h5> <table class="props"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>client</code></td> <td class="type"> <span class="param-type"><a href="Client.html">Client</a></span> </td> <td class="description last">The newly created client joining the game</td> </tr> <tr> <td class="name"><code>event</code></td> <td class="type"> <span class="param-type">Promise.&lt;<a href="LiveEventTimetrack.html">LiveEventTimetrack</a>></span> </td> <td class="description last">See <a href="Client.html#join">Client#join</a></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="kahoot.js.html">kahoot.js</a>, <a href="kahoot.js.html#line77">line 77</a> </li></ul></dd> <dt class="tag-see">See:</dt> <dd class="tag-see"> <ul> <li><a href="Client.html#join">Client#join</a></li> </ul> </dd> </dl> <h5>Returns:</h5> <div class="param-desc"> Returns the <a href="Client.html">Client</a> instead of a Promise. </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Object</span> </dd> </dl> <h4 class="name" id="answer"><span class="type-signature"></span>answer<span class="signature">(choice)</span><span class="type-signature"> &rarr; {Promise.&lt;<a href="LiveEventTimetrack.html">LiveEventTimetrack</a>>}</span></h4> <div class="description"> Answer a question </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>choice</code></td> <td class="type"> <span class="param-type">Number</span> | <span class="param-type">String</span> | <span class="param-type">Array.&lt;Number></span> </td> <td class="description last">The answer to the question - defaults: - 1 answer, number: 0 - multi answer: [0,1,2,3] - "undefined"</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="modules_answer.js.html">modules/answer.js</a>, <a href="modules_answer.js.html#line9">line 9</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> Resolves when answer is received. </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.&lt;<a href="LiveEventTimetrack.html">LiveEventTimetrack</a>></span> </dd> </dl> <h4 class="name" id="answerTwoFactorAuth"><span class="type-signature">(async) </span>answerTwoFactorAuth<span class="signature">(steps<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;<a href="LiveEventTimetrack.html">LiveEventTimetrack</a>>}</span></h4> <div class="description"> Answer the Two Factor Authentification </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th>Default</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>steps</code></td> <td class="type"> <span class="param-type">Array.&lt;Number></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> [0,1,2,3] </td> <td class="description last">A list of four numbers (0,1,2,3). Each number represents one of the four colors in the two-factor code (red,blue,yellow,green) respectively</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="kahoot.js.html">kahoot.js</a>, <a href="kahoot.js.html#line92">line 92</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> Resolves when the message is sent and received. Rejects if the message fails to send. </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.&lt;<a href="LiveEventTimetrack.html">LiveEventTimetrack</a>></span> </dd> </dl> <h4 class="name" id="join"><span class="type-signature">(async) </span>join<span class="signature">(name, team<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;Object>}</span></h4> <div class="description"> Join a game. Also joins with team members. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th>Default</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>name</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last">The name of the player</td> </tr> <tr> <td class="name"><code>team</code></td> <td class="type"> <span class="param-type">Array.&lt;String></span> | <span class="param-type">Boolean</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> ["Player 1","Player 2","Player 3","Player 4"] </td> <td class="description last">The team member names. if false, the team members will not be added automatically.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="kahoot.js.html">kahoot.js</a>, <a href="kahoot.js.html#line122">line 122</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> Resolves when join + team (if applicable) succeeds The resolved object should contain information about twoFactor, namerator, and gameMode If joining fails, this will reject with the error </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.&lt;Object></span> </dd> </dl> <h4 class="name" id="joinTeam"><span class="type-signature">(async) </span>joinTeam<span class="signature">(team<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;<a href="LiveEventTimetrack.html">LiveEventTimetrack</a>>}</span></h4> <div class="description"> Send team members </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th>Default</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>team</code></td> <td class="type"> <span class="param-type">Array.&lt;String></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> ["Player 1","Player 2","Player 3","Player 4"] </td> <td class="description last">A list of team members names</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="kahoot.js.html">kahoot.js</a>, <a href="kahoot.js.html#line224">line 224</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> Resolves when the team members are sent. Rejects if for some reason the message was not received by Kahoot!'s server. </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.&lt;<a href="LiveEventTimetrack.html">LiveEventTimetrack</a>></span> </dd> </dl> <h4 class="name" id="leave"><span class="type-signature"></span>leave<span class="signature">()</span><span class="type-signature"></span></h4> <div class="description"> leave - Leave the game. </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="kahoot.js.html">kahoot.js</a>, <a href="kahoot.js.html#line252">line 252</a> </li></ul></dd> </dl> <h4 class="name" id="next"><span class="type-signature"></span>next<span class="signature">()</span><span class="type-signature"></span></h4> <div class="description"> next - Go to the next part (challenge) </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="util_ChallengeHandler.js.html">util/ChallengeHandler.js</a>, <a href="util_ChallengeHandler.js.html#line328">line 328</a> </li></ul></dd> </dl> <h4 class="name" id="reconnect"><span class="type-signature"></span>reconnect<span class="signature">(pin<span class="signature-attributes">opt</span>, cid<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4> <div class="description"> reconnect to a game </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>pin</code></td> <td class="type"> <span class="param-type">Number</span> | <span class="param-type">String</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last">The gameid to connect to</td> </tr> <tr> <td class="name"><code>cid</code></td> <td class="type"> <span class="param-type">String.&lt;Number></span> | <span class="param-type">Number</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last">The client id to reconnect as</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="modules_reconnect.js.html">modules/reconnect.js</a>, <a href="modules_reconnect.js.html#line9">line 9</a> </li></ul></dd> </dl> <h4 class="name" id="sendFeedback"><span class="type-signature"></span>sendFeedback<span class="signature">(fun, learn, recommend, overall)</span><span class="type-signature"> &rarr; {Promise.&lt;<a href="LiveEventTimetrack.html">LiveEventTimetrack</a>>}</span></h4> <div class="description"> Send feedback to the host </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>fun</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last">1-5. Rating for how fun the quiz was</td> </tr> <tr> <td class="name"><code>learn</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last">0/1. Whether the client learned anything from the quiz</td> </tr> <tr> <td class="name"><code>recommend</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last">0/1. Whether the client would recommend the quiz</td> </tr> <tr> <td class="name"><code>overall</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last">1 - 1. The overall feeling of the client.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="modules_feedback.js.html">modules/feedback.js</a>, <a href="modules_feedback.js.html#line28">line 28</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> Resolves when the feedback has been sent. </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.&lt;<a href="LiveEventTimetrack.html">LiveEventTimetrack</a>></span> </dd> </dl> <h3 class="subsection-title">Events</h3> <h4 class="name" id="event:Disconnect">Disconnect</h4> <div class="description"> Emitted when the client is disconnected. Emits a String with the reason the client was disconnected. </div> <h5>Type:</h5> <ul> <li> <span class="param-type">String</span> </li> </ul> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="kahoot.js.html">kahoot.js</a>, <a href="kahoot.js.html#line286">line 286</a> </li></ul></dd> </dl> <h4 class="name" id="event:Feedback">Feedback</h4> <div class="description"> Emitted when the host requests for feedback </div> <h5>Type:</h5> <ul> <li> <span class="param-type">Object</span> </li> </ul> <h5 class="subsection-title">Properties:</h5> <table class="props"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>quizType</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="modules_feedback.js.html">modules/feedback.js</a>, <a href="modules_feedback.js.html#line16">line 16</a> </li></ul></dd> </dl> <h4 class="name" id="event:GameReset">GameReset</h4> <div class="description"> Emitted when the host presses "play again" or continues to the next quiz in the list. </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="modules_gameReset.js.html">modules/gameReset.js</a>, <a href="modules_gameReset.js.html#line14">line 14</a> </li></ul></dd> </dl> <h4 class="name" id="event:Joined">Joined</h4> <div class="description"> Emitted when the client joins the game </div> <h5>Type:</h5> <ul> <li> <span class="param-type">Object</span> </li> </ul> <h5 class="subsection-title">Properties:</h5> <table class="props"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>challenge</code></td> <td class="type"> <span class="param-type">String.&lt;function()></span> </td> <td class="description last">The challenge function. (Pointless)</td> </tr> <tr> <td class="name"><code>namerator</code></td> <td class="type"> <span class="param-type">Boolean</span> </td> <td class="description last">Whether the game has the friendly name generator on.</td> </tr> <tr> <td class="name"><code>participantId</code></td> <td class="type"> <span class="param-type">Boolean</span> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>smartPractice</code></td> <td class="type"> <span class="param-type">Boolean</span> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>twoFactorAuth</code></td> <td class="type"> <span class="param-type">Boolean</span> </td> <td class="description last">Whether the game has twoFactorAuth enabled</td> </tr> <tr> <td class="name"><code>gameMode</code></td> <td class="type"> <span class="param-type">String</span> | <span class="param-type">undefined</span> </td> <td class="description last">If the gameMode is 'team,' then it is team mode, else it is the normal classic mode.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="kahoot.js.html">kahoot.js</a>, <a href="kahoot.js.html#line184">line 184</a> </li></ul></dd> </dl> <h4 class="name" id="event:NameAccept">NameAccept</h4> <div class="description"> Emitted when the server has validated the client's name </div> <h5>Type:</h5> <ul> <li> <span class="param-type">Object</span> </li> </ul> <h5 class="subsection-title">Properties:</h5> <table class="props"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>playerName</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">The player's name (may have changed from original value due to filter)</td> </tr> <tr> <td class="name"><code>quizType</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>playerV2</code></td> <td class="type"> <span class="param-type">Boolean</span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="modules_nameAccept.js.html">modules/nameAccept.js</a>, <a href="modules_nameAccept.js.html#line16">line 16</a> </li></ul></dd> </dl> <h4 class="name" id="event:Podium">Podium</h4> <div class="description"> Emitted at the end of the game (After "QuizEnd") </div> <h5>Type:</h5> <ul> <li> <span class="param-type">Object</span> </li> </ul> <h5 class="subsection-title">Properties:</h5> <table class="props"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>podiumMedalType</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">A string about the podium medal. "gold", "silver", "bronze" are possible values. May be nonexistent or null.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="modules_podium.js.html">modules/podium.js</a>, <a href="modules_podium.js.html#line14">line 14</a> </li></ul></dd> </dl> <h4 class="name" id="event:QuestionEnd">QuestionEnd</h4> <div class="description"> An event emitted at the end of the question. Contains ranking information. </div> <h5>Type:</h5> <ul> <li> <span class="param-type">Object</span> </li> </ul> <h5 class="subsection-title">Properties:</h5> <table class="props"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>choice</code></td> <td class="type"> <span class="param-type">Number</span> | <span class="param-type">Array.&lt;Number></span> | <span class="param-type">String</span> </td> <td class="description last">The answer from the client</td> </tr> <tr> <td class="name"><code>type</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">The question type</td> </tr> <tr> <td class="name"><code>isCorrect</code></td> <td class="type"> <span class="param-type">Boolean</span> </td> <td class="description last">Whether the client answered the question correctly</td> </tr> <tr> <td class="name"><code>text</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">The text content of correct answers</td> </tr> <tr> <td class="name"><code>receivedTime</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last">The time (ms) when the answer was received</td> </tr> <tr> <td class="name"><code>pointsQuestion</code></td> <td class="type"> <span class="param-type">Booean</span> </td> <td class="description last">Whether the question offered points</td> </tr> <tr> <td class="name"><code>points</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last">The amount of points earned from the question</td> </tr> <tr> <td class="name"><code>correctAnswers</code></td> <td class="type"> <span class="param-type">Array.&lt;String></span> </td> <td class="description last">A list of the text content of the correct answers</td> </tr> <tr> <td class="name"><code>correctChoices</code></td> <td class="type"> <span class="param-type">Array.&lt;Number></span> </td> <td class="description last">A list of the indexes of correct choices (used in multi select quizzes)</td> </tr> <tr> <td class="name"><code>totalScore</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last">The total score of the client</td> </tr> <tr> <td class="name"><code>rank</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last">The current position of the client</td> </tr> <tr> <td class="name"><code>pointsData</code></td> <td class="type"> <span class="param-type"><a href="PointsData.html">PointsData</a></span> </td> <td class="description last">Extra information about the points data</td> </tr> <tr> <td class="name"><code>nemesis</code></td> <td class="type"> <span class="param-type"><a href="Nemesis.html">Nemesis</a></span> </td> <td class="description last">The nemesis</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="modules_questionEnd.js.html">modules/questionEnd.js</a>, <a href="modules_questionEnd.js.html#line14">line 14</a> </li></ul></dd> </dl> <h4 class="name" id="event:QuestionReady">QuestionReady</h4> <div class="description"> Emitted when the question is about to start </div> <h5>Type:</h5> <ul> <li> <span class="param-type">Object</span> </li> </ul> <h5 class="subsection-title">Properties:</h5> <table class="props"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>questionIndex</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last">The question index</td> </tr> <tr> <td class="name"><code>gameBlockType</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">The question type</td> </tr> <tr> <td class="name"><code>gameBlockLayout</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">The question layout</td> </tr> <tr> <td class="name"><code>quizQuestionAnswers</code></td> <td class="type"> <span class="param-type">Array.&lt;Number></span> </td> <td class="description last">An array of numbers, signifying the number of answer choices in each question</td> </tr> <tr> <td class="name"><code>timeLeft</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last">The time in seconds before the quiz starts</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="modules_questionReady.js.html">modules/questionReady.js</a>, <a href="modules_questionReady.js.html#line14">line 14</a> </li></ul></dd> </dl> <h4 class="name" id="event:QuestionStart">QuestionStart</h4> <div class="description"> Emitted when the question starts </div> <h5>Type:</h5> <ul> <li> <span class="param-type">Object</span> </li> </ul> <h5 class="subsection-title">Properties:</h5> <table class="props"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>questionIndex</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last">The question index</td> </tr> <tr> <td class="name"><code>gameBlockType</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">The question type</td> </tr> <tr> <td class="name"><code>gameBlockLayout</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">The layout of the question. May be nonexistent</td> </tr> <tr> <td class="name"><code>quizQuestionAnswers</code></td> <td class="type"> <span class="param-type">Array.&lt;Number></span> </td> <td class="description last">An array of numbers, signifying the number of answer choices in each question</td> </tr> <tr> <td class="name"><code>timeAvailable</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last">The time available in the question.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="modules_questionStart.js.html">modules/questionStart.js</a>, <a href="modules_questionStart.js.html#line14">line 14</a> </li></ul></dd> </dl> <h4 class="name" id="event:QuizEnd">QuizEnd</h4> <div class="description"> Emitted when the quiz ends. </div> <h5>Type:</h5> <ul> <li> <span class="param-type">Object</span> </li> </ul> <h5 class="subsection-title">Properties:</h5> <table class="props"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>rank</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last">The rank of the player</td> </tr> <tr> <td class="name"><code>cid</code></td> <td class="type"> <span class="param-type">String.&lt;Number></span> </td> <td class="description last">The player id</td> </tr> <tr> <td class="name"><code>correctCount</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last">The number of correct answers</td> </tr> <tr> <td class="name"><code>incorrectCount</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last">The number of incorrect answers</td> </tr> <tr> <td class="name"><code>isKicked</code></td> <td class="type"> <span class="param-type">Boolean</span> </td> <td class="description last">Whether the player was kicked?</td> </tr> <tr> <td class="name"><code>isGhost</code></td> <td class="type"> <span class="param-type">Boolean</span> </td> <td class="description last">Whether the player is a ghost.</td> </tr> <tr> <td class="name"><code>unansweredCount</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last">The number of unanswered questions.</td> </tr> <tr> <td class="name"><code>playerCount</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last">The number of players in the game.</td> </tr> <tr> <td class="name"><code>startTime</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last">The date (ms) when the quiz started.</td> </tr> <tr> <td class="name"><code>quizId</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">The quiz uuid</td> </tr> <tr> <td class="name"><code>name</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">The name of the player</td> </tr> <tr> <td class="name"><code>totalScore</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last">The final score of the player.</td> </tr> <tr> <td class="name"><code>hostId</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>challengeId</code></td> <td class="type"> <span class="param-type">null</span> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>isOnlyNonPointGameBlockKahoot</code></td> <td class="type"> <span class="param-type">Boolean</span> </td> <td class="description last">Whether the kahoot is only non-point questions?</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="modules_quizEnd.js.html">modules/quizEnd.js</a>, <a href="modules_quizEnd.js.html#line14">line 14</a> </li></ul></dd> </dl> <h4 class="name" id="event:QuizStart">QuizStart</h4> <div class="description"> Emitted at the start of the quiz </div> <h5>Type:</h5> <ul> <li> <span class="param-type">Object</span> </li> </ul> <h5 class="subsection-title">Properties:</h5> <table class="props"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>quizType</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>quizQuestionAnswers</code></td> <td class="type"> <span class="param-type">Array.&lt;Number></span> </td> <td class="description last">A list of numbers stating how many answers are in each question.</td> </tr> </tbody> </table> <dl class="details">