0

我正在尝试使用此处由 SCORM.com / Rustici ( https://scorm.com/scorm-explained/technical-scorm/run-time/ ) 提供的 SCORM API 从 Brightspace LMS 中检索一些值。

我感兴趣的值是学生的姓名、学生的部分(在 Brightspace 术语中是学生的班级)和课程名称。从 API 参考(https://scorm.com/scorm-explained/technical-scorm/run-time/run-time-reference/)中,我看到可以使用 cmi.core.student_name 提取学生的姓名。

问题:如何使用 SCORM API 提取学生的部分和课程名称?

4

1 回答 1

0

根据您运行的 SCORM 版本,您需要从https://scorm.com/scorm-explained/technical-scorm/run-time/api-discovery-algorithms/复制并粘贴代码

完成此操作后,对于 sCORM 1.2

var API = getAPI();

if (API) {
   var studentName = API.LMSGetValue("cmi.core.student_name");
   console.log(studentName);
}
else {
    console.log("Failed: Did you run this course directly and not via the LMS?");
}

对于 SCORM 2004

getAPI(window);

if (API) {
   var studentName = API.GetValue("cmi.core.student_name");
   console.log(studentName);
}
else {
    console.log("Failed: Did you run this course directly and not via the LMS?");
}

代码略有不同。您最好使用https://pipwerks.com/laboratory/scorm/api-wrapper-javascript/来查找 SCORM API 并使用此包装器来处理版本中的细微差异。

至于课程名称 - 如果您正在运行特定的课程,您已经知道该课程的名称,因为您当前正在运行它。

于 2021-10-07T15:35:23.973 回答