Namespace: quizApi

Playbasis. quizApi

Playbasis Quiz Organize API

Methods


<static> answerQuestion(quizId, playerId, questionId, optionId, answer)

Answer question with option for quiz.

Parameters:
Name Type Description
quizId String

quiz id to answer to question

playerId String

player id

questionId String

question id to answer

optionId String

option id of question selected as answer

answer String

answer text

Returns:

Promise object

Type
Object

<static> detailOfQuiz(quizId, options)

Get detail of quiz.

Parameters:
Name Type Description
quizId String

quiz id to get detail from

options Object

(optional) options as object. It can include { player_id: String = player id as used in client's website }

Returns:

Promise object

Type
Object

<static> getQuestionFromQuiz(quizId, playerId, options)

Get a question with a list of options from a given quiz.

Parameters:
Name Type Description
quizId String

quiz id to get a question from

playerId String

player id

options Object

(optional) options as object. It can include { question_id: String = question id in quiz, if you need to get a specific question random: Number = 1 for Random | 2 for Not Random }

Returns:

Promise object

Type
Object

<static> getQuestionFromQuiz(quizId, playerId, options)

Get a question with a list of options from a given quiz, but with a reset timestamp of question that has timeout to answer.

Parameters:
Name Type Description
quizId String

quiz id to get a question from

playerId String

player id

options Object

(optional) options as object. It can include { question_id: String = question id in quiz, if you need to get a specific question random: Number = 1 for Random | 2 for Not Random }

Returns:

Promise object

Type
Object

<static> listOfActiveQuizzes(options)

Return list of active quizzes

Parameters:
Name Type Description
options Object

(optional) options as object. It can include { player_id: String = player id as used in client's website type: String = type of quiz which can be "quiz" | "poll" tags: String = tag(s) to find i.e. "foo,bar" }

Returns:

Promise object

Type
Object

<static> listPendingQuiz(playerId, limit)

List pending quiz by player

Parameters:
Name Type Description
playerId String

player id

limit Number

number of returned result

Returns:

Promise object

Type
Object

<static> listQuizDone(playerId, limit)

List quiz done by player

Parameters:
Name Type Description
playerId String

player id

limit Number

number of returned result

Returns:

Promise object

Type
Object

<static> quizStatistics(quizId)

Query a statistics of quiz done by all players

Parameters:
Name Type Description
quizId String

quiz id to query statistics from

Returns:

Promise object

Type
Object

<static> randomQuizForPlayer(playerId, options)

Randomly get one quiz from a list of active quizzes for player.

Parameters:
Name Type Description
playerId String

player id

options Object

(optional) options as object. It can include { type: String = type of quiz. It can be "quiz" | "poll" tags: String = tag(s) to find i.e. "foo,bar" }

Returns:

Promise object

Type
Object

<static> rankPlayersByScore(quizId, limit)

Rank players by their score for given quiz.

Parameters:
Name Type Description
quizId String

quiz id to rank score for players

limit Number

number of returned result

Returns:

Promise object

Type
Object

<static> resetQuiz(playerId, quizId)

Reset a quiz done by player.

Parameters:
Name Type Description
playerId String

player id

quizId String

quiz id to reset

Returns:

Promise object

Type
Object