dongtan6336 2017-01-25 13:54
浏览 45
已采纳

Tin Can PHP库:Person对象

My question relates to the Tin Can PHP API library's Person object and what use may be made of it.

The library's Person object is (so far as I understand) an implementation of the Agents Resource in Part 3 Section 2.4 of the xAPI specification (link: https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Communication.md#24-agents-resource). The specification recognises a Person object and indicates that the purpose of the object is to

provide combined information about an Agent derived from an outside service, such as a directory service

It seems from that description, and from the developers of the library (see link), that the specification's Person object is intended to provide a means of collecting, within the one object, information about a person which is dispersed among a number of different Agent objects.

I have had difficulty following the examples in the library but the following (oversimplified) code seems to work in the SCORM Cloud LRS:

...
$agent1 = new TinCan\Agent();
$agent1
    ->setMbox('david.jones@somehospital.gov.au')
    ->setName('Dr David Jones');

$agent2 = new TinCan\Agent();
$agent2
    ->setMbox('d.jones@medicalorg.org.au')
    ->setName('David Jones');

$person = new TinCan\Person();
$person
    ->setMbox([$agent1->getMbox(), $agent2->getMbox()])
    ->setName([$agent1->getName(), $agent2->getName()]);
...

Is the library's Person object intended to be saved to the LRS? If so I have not been able to find any means of doing so using the library's Statement object. If not, what is its intended use?

I would be grateful for clarification. Thank you.

  • 写回答

1条回答 默认 最新

  • dqstti8945 2017-01-25 20:50
    关注

    The API does not provide a means to save this object. It is intended for the LRS to use whatever means it can to assemble multiple Agents that represent the same entity into the Person object. The intended purpose is to allow systems accessing the statement stream to be able to combine those streams for multiple Agents to get a fuller picture of that person's overall activity.

    For example, I may have 3 (or X) identifiers that represent me as a person, let's assume they are:

    • mailto:dave.personal@example.com
    • mailto:davelastname@work.example.com
    • {"name": "@dave11785","homePage": "https://twitter.com"}

    Passing any one of those Agent identifiers (as a full Agent representation) to the Person read only resource will return a Person object that includes all of them assuming sufficient knowledge by the LRS to map them together. For a reporting system therefore, it would be possible while it is reading the statement stream to request the Person object for each new Agent it sees and then coordinate statements with disparate actor properties (for instance) into a single record of that person's complete activity. The key here is that the LRS has to have been developed (or integrated) in such a manner that it has the requisite knowledge to associate Agents together.

    TinCanPHP provides the full range of data model objects because in theory it could be used to write an LRS just as much as to communicate with one as an LRP. The key implementation detail here is that it provides the GET /agents readonly resource via the TinCan\RemoteLRS class which will provide back a TinCan\Person object. Since your code is not interacting with an instance of the TinCan\RemoteLRS class it isn't actually communicating with the LRS so SCORM Cloud's LRS is irrelevant in this case. If you were to interact using the available resource you would get a Person object returned that includes only the Agent you passed into it because (at least at the time of writing) Cloud does not know how to associate multiple Agents, but it does know that the default is the Agent provided to it.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 软件定义网络mininet和onos控制器问题
  • ¥15 微信小程序 用oss下载 aliyun-oss-sdk-6.18.0.min client报错
  • ¥15 ArcGIS批量裁剪
  • ¥15 labview程序设计
  • ¥15 为什么在配置Linux系统的时候执行脚本总是出现E: Failed to fetch http:L/cn.archive.ubuntu.com
  • ¥15 Cloudreve保存用户组存储空间大小时报错
  • ¥15 伪标签为什么不能作为弱监督语义分割的结果?
  • ¥15 编一个判断一个区间范围内的数字的个位数的立方和是否等于其本身的程序在输入第1组数据后卡住了(语言-c语言)
  • ¥15 Mac版Fiddler Everywhere4.0.1提示强制更新
  • ¥15 android 集成sentry上报时报错。