API Docs for: 1.0.1
Show:

QuizResult Class

Defined in: src\quizlib.js:258

Quiz Result class that holds score information

Constructor

QuizResult

()

Defined in src\quizlib.js:258

Methods

setResults

(
  • questionResults
)

Defined in src\quizlib.js:297

Calculates score information from an array of question results and updates properties

Parameters:

  • questionResults Array

    Array of question results where the index is the question number and the value is whether the question was answered correctly. e.g. [true, true, false]

Properties

results

Array

Defined in src\quizlib.js:265

Array of booleans where the index is the question number and the value is whether the question was answered correctly. Updated by setResults

score

Number

Defined in src\quizlib.js:277

Number of questions answered correctly. Updated by setResults

scorePercent

Number

Defined in src\quizlib.js:283

Percentage score between 0 and 1. Updated by setResults

scorePercentFormatted

Number

Defined in src\quizlib.js:289

Formatted score percent that's more useful to humans (1 - 100). Percent is rounded down. Updated by setResults

totalQuestions

Number

Defined in src\quizlib.js:271

Total number of questions. Updated by setResults