Playbasis Quiz Organize API
Methods
-
<static> answerQuestion(quizId, playerId, questionId, optionId, answer)
-
Answer question with option for quiz.
Parameters:
Name Type Description quizIdString quiz id to answer to question
playerIdString player id
questionIdString question id to answer
optionIdString option id of question selected as answer
answerString answer text
Returns:
Promise object
- Type
- Object
-
<static> detailOfQuiz(quizId, options)
-
Get detail of quiz.
Parameters:
Name Type Description quizIdString quiz id to get detail from
optionsObject (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 quizIdString quiz id to get a question from
playerIdString player id
optionsObject (optional) options as object. It can include {
question_id: String = question id in quiz, if you need to get a specific questionrandom: 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 quizIdString quiz id to get a question from
playerIdString player id
optionsObject (optional) options as object. It can include {
question_id: String = question id in quiz, if you need to get a specific questionrandom: 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 optionsObject (optional) options as object. It can include {
player_id: String = player id as used in client's websitetype: 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 playerIdString player id
limitNumber number of returned result
Returns:
Promise object
- Type
- Object
-
<static> listQuizDone(playerId, limit)
-
List quiz done by player
Parameters:
Name Type Description playerIdString player id
limitNumber 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 quizIdString 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 playerIdString player id
optionsObject (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 quizIdString quiz id to rank score for players
limitNumber number of returned result
Returns:
Promise object
- Type
- Object
-
<static> resetQuiz(playerId, quizId)
-
Reset a quiz done by player.
Parameters:
Name Type Description playerIdString player id
quizIdString quiz id to reset
Returns:
Promise object
- Type
- Object