我正在尝试为SCORM2004编写一个JavaScript集成,并添加了以下代码来截取任何分数值。我去了一个快速的,但没有得到分值。
SetValue = (name, value) => {
// see if name is 'cmi.score.min|max|raw|scaled'
}我的目标是获取分值并将其发送到后端,我想知道分值何时可用?有没有可能会有一个没有分数值的测验(虚拟测验...)?最后,如何在挂起时捕获完成百分比?
我不认为我是唯一一个尝试编写这些函数的人。所以我真的不想重复发明轮子。有没有针对这些的库或助手函数?
谢谢
发布于 2020-07-19 02:40:35
这对我很有效,我之前在网上找到的。
if( this.aiccgroup ) {
LMSSetValue( this.name, lmsVal )
if( this.name == 'cmi.score.raw' ){
var scaled = this.value / 100
LMSSetValue( 'cmi.score.scaled', scaled )
LMSSetValue( 'cmi.score.min', 0 )
LMSSetValue( 'cmi.score.max', 100 )
LMSCommit( "" );
}啊,真灵。
visit this link complete view... i got this on solution on here
https://stackoverflow.com/questions/62819142
复制相似问题