通过播放器接口显示问答题目

接口说明

针对某些需要以相对灵活的方式显示问答题目的场景,可以通过显示问答题目的播放器接口来实现。

使用方式

<script src="//player.polyv.net/script/polyvplayer.min.js"></script>
<div id="plv_02bfeb00e2ba940698c54cdf517aa9b6_0"></div>
<script>
var player = polyvObject('#plv_02bfeb00e2ba940698c54cdf517aa9b6_0').videoPlayer({
    'width':'600',
  'height':'338',
    'vid' : '02bfeb00e2ba940698c54cdf517aa9b6_0'
});
window.s2j_onPlayerInitOver = function (params) {
    var questions = [{"examId":"45","question":"第1个问题:6 x 6 = ?","choices":[{"answer":"1"},{"answer":"2","right_answer":1},{"answer":"3"},{"answer":"4"}],"answer":"","wrongAnswer":"","skip":true,"wrongTime":25},{"examId":"23","question":"第2个问题:22 x 3 = ?","choices":[{"answer":"1","right_answer":1},{"answer":"2","right_answer":1},{"answer":"3"},{"answer":"4"}],"answer":"","wrongAnswer":"","skip":false,"wrongTime":-1}] //questions必须是一个数组,包含多个问答题目的话会依次显示。
    player.sendQuestion(questions);
}
</script>

参数说明

参数名称 是否必填 默认值 描述
examId - 生成规则:Long.toHexString(System.currentTimeMillis()),11位的字符串,比如:1699e49ffeb,传值后可通过答题记录查询接口查询记录。
question - 题目
choices - 选项
right_answer - 正确答案
answer - 回答正确后的解答
wrongAnswer - 回答错误后的解答
wrongTime -1 回答错误后退回第几秒,-1代表不回退
skip true 能否跳过题目继续播放视频
以上内容是否对您有帮助?根本没有帮助文档较差文档一般文档不错文档很好
Loading...