我正在尝试在我自己的学习管理系统中使用 .NET TinCan 库。我在我的应用程序中包含了 TinCan 0.0.2 Nuget 包并上传了 GolfExample_TCAPI 测试课程。在本地测试时,GolfExample 课程会在以下 URL 加载:
https://127.0.0.1/TINCAN/MYCOMPANY/GolfExample_TCAPI%20(1)/index.html?
在查看启动文档时,我发现似乎至少需要传入端点、身份验证和参与者,因此我尝试在我的视图模型中使用如下 dll 来执行此操作。
var lrs = new RemoteLRS("https://cloud.scorm.com/tc/public/", "<username>", "<password>");
var actor = new TinCan.Agent();
actor.name = "John Paul Mc Feely";
actor.mbox = "jpmcfeely@hsl-data.com";
TINCANStartPage = HttpContext.Current.Request.Url.Scheme + "://" + @HttpContext.Current.Request.Url.Host + ":" +
@HttpContext.Current.Request.Url.Port + HttpContext.Current.Request.ApplicationPath + this.Course.BlobURL + "/index.html" + "?endpoint=" + lrs.endpoint + "&auth=" + lrs.auth + "&actor=" + actor.ToJSON();
调试时,我可以看到这为启动窗口创建了 URL,如下所示:
"https://127.0.0.1/TINCAN/MYCOMPANY/GolfExample_TCAPI (1)/index.html?endpoint=https://cloud.scorm.com/tc/public/&auth=Basic anBtY2ZlZWx5QGhzbC1kYXRhLmNvbTpwbGFzbWExMQ==&actor={\"objectType\":\"Agent\",\"name\":\"John Paul Mc Feely\",\"mbox\":\"jpmcfeely@hsl-data.com\"}"
根据我可以看到的文档,这看起来像是正确的格式,但是当我继续时,窗口会使用以下 URL 启动:
https://127.0.0.1/TINCAN/MYCOMPANY/GolfExample_TCAPI%20(1)/index.html?endpoint=https://cloud.scorm.com/tc/public/&auth=Basic%20anBtY2ZlZWx5QGhzbC1kYXRhLmNvbTpwbGFzbWExMQ==&actor={"objectType":"Agent","name":"John%20Paul%20Mc%20Feely","mbox":"jpmcfeely@hsl-data.com"}
然后我收到如下警告消息:
[警告] 与学习记录存储通信出现问题。(400 | 声明 3bd49829-dc0b-4daa-a689-71a84c44e6ad 没有分配演员。)
如果有人能在这里看到我做错了什么,将不胜感激。