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

接口说明

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

使用方式

<div id="player"></div>
<script src="//player.polyv.net/script/player.js"></script>
<script>
var player = polyvPlayer({
    wrap: '#player',
    width: 800,
    height: 533,
    vid: '88083abbf5bcf1356e05d39666be527a_8',
});
player.on('s2j_onPlayerInitOver',function(e) {
    var questions = [{"examId":"45","showTime":10,"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","showTime":15,"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,传值后可通过答题记录查询接口查询记录。
showTime - 题目出现时间,单位:秒
question - 题目
choices - 选项
right_answer - 正确答案
answer - 回答正确后的解答
wrongAnswer - 回答错误后的解答
wrongTime -1 回答错误后退回第几秒,-1代表不回退
skip true 能否跳过题目继续播放视频
illustration - 问答图片
以上内容是否对您有帮助?根本没有帮助文档较差文档一般文档不错文档很好
Loading...