Polyv Help Center

Help Center

Answer Sheet

Updated: 2021-10-14 17:47:17

Feature Overview

This SDK primarily includes features such as launching answer sheets and managing the answer sheet question bank. The following operations are only supported for users with the role of Instructor/Guest/Teaching Assistant/Administrator.

  • Answer sheets can be divided into Quick Q&A and Regular Answer Sheets.
    • Quick Q&A only supports single-choice and multiple-choice question types, with no specific option content, and can have up to 5 options.
    • Regular Answer Sheets support question types including: single-choice, multiple-choice, rating, and voting, with up to 15 options. Regular Answer Sheets also allow setting a time limit for answering; after the countdown ends, answering will automatically stop and results will be sent.
  • The Answer Sheet Question Bank is used to manage multiple sets of Regular Answer Sheets.
    • The default question bank is displayed by default and cannot be deleted. It supports application and download.
    • Provides a question bank upload feature. You can download the default question bank template, edit it, and re-upload it.
    • After applying a question bank, the answer sheets within it will retain their sent status. Re-applying the question bank will automatically reset the sent status to unsent.
  • Launching Answer Sheets
    • Answer sheet data can be uploaded directly by the user via the question bank and applied, or saved after editing on the page.
    • If you leave the page during an answer session and re-enter, you can retrieve the answer status within the room via the API.
    • After answering ends, call the result sending API, and all users in the room will receive the message.

Code Example

Note: Global initialization settings must be completed before starting the following steps. Please refer to the documentation.

Basic Flow

const app = new AnswerCard();

// 订阅事件监听。
app
  .on('start', () => {})
  .on('stop', () => {})
  .on('answer', () => {})
  .on('show-result', () => {});

// 发起答题卡。操作成功后,'start' 事件会被触发。
app.start(startOptions);
// 期间如有观众提交答题,'answer'事件会被触发。

// 结束答题卡。操作成功后,'stop' 事件会被触发。
app.stop(questionId);

// 发送答题统计结果。操作成功后,'send-result'事件会被触发。
// 如需要显示统计结果,可以在事件回调中调用 `getQuestionStatistics()` 获取统计结果数据
app.sendResult(result);

Multi-Role Synchronization

Supports synchronization of answer sheet progress among multiple roles, including Instructor/Guest/Teaching Assistant/Administrator.

// 登录聊天室房间后,查询当前答题卡进行情况
const ongoingStatus = await app.getOngoingStatus();
if (ongoingStatus.isOngoing) {
 // 正在进行答题
}
联系客服,在线咨询