adlnet / xAPI-Spec

The xAPI Specification describes communication about learner activity and experiences between technologies.
https://adlnet.gov/projects/xapi/
901 stars 405 forks source link

Actor object: properties where ObjectType is Group #1005

Closed GrantBailey closed 7 years ago

GrantBailey commented 7 years ago

The xAPI specification (at https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#2422-when-the-actor-objecttype-is-group) indicates that in the Actor object, where the ObjectType is Group, the 'member' property is required for both anonymous groups and identified groups.

The requirement for a member in the anonymous group type appears to be inappropriate, given the definition of an anonymous group as 'a cluster of people where there is no ready identifier for this cluster'.

The following code example (which uses the PHP API) should not work according to the specification but throws no error:

$actor = new TinCan\Agent ( [ 'objectType' => 'Group', 'name' => 'Tin Can group', 'mbox' => 'mailto:user@example.com' ] );

garemoko commented 7 years ago

Hey @GrantBailey.

The member property is only required for annoymous groups and not for identified groups. That actor is a valid identified group.

The reason that members are required for an annoymous group is that because if would it, the group has no identifying characteristics at all. You are essentially saying "1 or more people" did this. This isn't the best way to say that; instead...

If the Learning Record Provider is concerned about revealing personally identifiable information about an Agent or Group, it SHOULD use an opaque account name (for example an account number) to identify all Statements about a person while maintaining anonymity.

The purpose of anonymous groups is groups where a collection of identified people did a thing, but there's no ready identifier for the group. It's not designed for groups of anonymous people.

Does that help?

Andew

GrantBailey commented 7 years ago

Andrew,

Many thanks for setting me straight as to the difference between anonymous groups and identified groups. My only remaining question is why the following anonymous group throws an error in the PHP API:

$actor = new TinCan\Agent ( [ 'objectType' => 'Group', 'name' => 'Tin Can group', 'member' => [ 'objectType' => 'Agent', 'name' => 'Jim Sample', 'mbox' => 'mailto:jim@sample.com' ] ] );

The error message is 'No identifying properties found for given actor' but I thought the absence of an IFI was the point of an anonymous group. Putting in an IFI prevents the error but (on my reading of the specification) should not be necessary.

Sorry for all my confusion.

brianjmiller commented 7 years ago

That doesn't look like an error message produced by TinCanPHP, is that message coming from the LRS?

GrantBailey commented 7 years ago

Brian, Sorry yes, I believe it is coming from the LRS.

brianjmiller commented 7 years ago

Assuming the member property is getting sent by the library, then that sounds like an implementation bug in the LRS, have you tried alternate LRSs to see if it is accepted by them?

GrantBailey commented 7 years ago

Brian,

I tried with the ADL LRS and the error message was 'One and only one of mbox, mbox_sha1sum, openid, account may be supplied with an Agent'.

I have reproduced my whole statement below in case I have made some other error.

$id = guidv4(generateRandomString()); $actor = new TinCan\Agent ( [ 'objectType' => 'Group', 'name' => 'Tin Can group', 'member' => [ 'objectType' => 'Agent', 'name' => 'Jim Sample', 'mbox' => 'mailto:jim@sample.com' ] ] ); $verb = new TinCan\Verb( [ 'id' => 'http://adlnet.gov/expapi/verbs/attempted', 'display' => ['en-US' => 'attempted'] ] ); $activity = new TinCan\Activity ( [ 'id' => 'http://www.baileyandireland.com/tincan/IAL/1.1' ] );

// Compose statement for sending to the LRS $statement = new TinCan\Statement ( [ 'id' => $id, 'actor' => $actor, 'verb' => $verb, 'object' => $activity ] );

// Send the statement $response = $lrs->saveStatement($statement);

// Retrieve statements from the LRS $response = $lrs->queryStatements(['limit' => 2]);

garemoko commented 7 years ago

I think I see what's wrong here. Instead of

$actor = new TinCan\Agent (

use

$actor = new TinCan\Group (
brianjmiller commented 7 years ago

@garemoko should be right. In general in Tin Can PHP you would only ever be setting objectType in two scenarios:

When constructing single objects the objectType will always be the constant set in the class itself.

GrantBailey commented 7 years ago

Andrew, Brian: Many thanks for your help. It makes sense now.