- 确保TinCan课程已正确设置完成状态以及完成状态所依据的标准。
- 检查LMS集成设置中的TinCan配置是否正确。
- 确认使用的TinCan版本是否与LMS版本兼容。
- 检查TinCan API连接是否正确设置。
- 确保LMS中课程的课程ID和TinCan调用中使用的课程ID一致。
- 检查LMS日志以确定任何错误或故障。
以下是可能可用的代码示例,用于将TinCan完成状态发送到Cornerstone LMS:
var endpoint = 'insert LRS endpoint here';
var auth = 'insert LRS auth here';
var lrs = new TinCan.LRS({
endpoint: endpoint,
authentication: auth
});
var actor = new TinCan.Agent({
mbox: 'mailto:user@email.com'
});
var activity = new TinCan.Activity({
id: 'insert course ID here',
definition: {
name: {
'en-US': 'Course Name'
}
}
});
var statement = new TinCan.Statement({
actor: actor,
verb: 'completed',
target: activity,
context: {
contextActivities: {
category: [{
id: 'insert category ID here'
}]
}
}
});
lrs.saveStatement(statement, {
callback: function (err, xhr) {
if (err !== null) {
console.log('Failed to save statement: ' + err);
return;
}
console.log('Statement saved');
}
});