Quest evidence
Quiz evidence
API type: quiz. Graded questions with no media; each answer is checked on the server.
On this page
Answer one question at a time
A quiz needs an SDK that declares the quiz capability (the bundled SDK does); other clients never see quiz quests. Start with requiresTimer: false and call session.getQuestions(). Send each answer with session.answer(questionId, optionId) in the order the server asks. A first miss comes back with correct: false and the question is asked again after the others; a second miss rejects the attempt. The last right answer submits the attempt.
Answer a quiz
const session = await client.startQuest(questId, { requiresTimer: false });
let queue = await session.getQuestions();
while (queue.length > 0) {
const question = queue.shift()!;
const outcome = await session.answer(question.id, selectedOptions[question.id]); // the option the participant picked
if (outcome.done) {
const result = outcome.result; // accepted: settled, pending, or rejected after a second miss
break;
}
if (outcome.correct === false) queue.push(question); // asked once more at the end
}Verify before publishing
- A wrong answer must not show the right one; the question comes back at the end.
- A second miss on the same question ends the attempt with no reward.
- Every right answer pays nothing on its own: the reward is paid once, after the last one.
- Refresh mid-quiz: the attempt resumes on the question the server is waiting for.