互动题插件结构图
2020-07-20 16:19:20 0 举报
互动题插件
作者其他创作
大纲/内容
interactive-question-mobile.html
url=?roomId=1&...&signalType=101020signalParams={ questionId: '123',}
发题
Plugin...
show()
HybridInteractiveQuestionController
- bridge:HybridChannel
- initBridge(url)- initEvents() // 绑定bridge的信令转发事件,判断收题时走onQuestionOver- onQuestionOver(questionId) // 接收webview的信令转发,如果是收题版,通知h5- onClose(action) // 接收h5答题结束动作,通知webview关页面- onTapBlank() // 点击空白区域事件,通知webview
student.html
url=?roomId=1&...&plugins=[{ name: 'InteractiveQuestion', theme: 'black'}]
H5Plugings 结构
PluginsManager
- status: loading/error/loaded
- getConfigFromUrl(location.search):pluginsConfig- loadPlugins(pluginsConfig)+ onStatusChange(status)
WebInteractiveQuestionController
- mq: 信令对象
- initMq()- initEvents() // 订阅信令收发题动作- onQuestionPush() // 收到推题信令,设置questionId属性- onQuestionOver() // 收到收题信令
h5Plugings-manager
Native-Bridge
http://npm.aixuexi.com/-/web/detail/@aixuexi/vue-exercise
MQ
InteractiveQA (npm)
+ questionData:QuestionData =null
+ close()+ submitAnswer(params)+ submitCorrect(params)+ showModalAnimation(result)
LiveInteractiveQuestion
+ questionId: string = '' //vue watch此属性变化调用getQuestionData- show:boolean = false- questionData:object
+ onClose(action) // 自动关闭or手动关闭事件绑定+ onQuestionOver(questionId) // 老师收题事件绑定,调用submitAnswer- getQuestionData(questionId):questionData // 获取成功,show=true- submitAnswer(ans): result // 提交答题结果- showResult(result)- close() // 关闭题版
PluginB
onClose
Store.Global
+ roomId: string+ token: string+ ... 其他公共参数
HybridChannel
+ platform:ios/andriod- sender
Plugin互动题
收题
收藏
0 条评论
下一页