You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The "revision" property MUST only be used if the Statement's Object is an Activity.
The "platform" property MUST only be used if the Statement's Object is an Activity.
In apparent contravention of the specification the PHP xAPI library allows the 'revision' and 'platform' properties where the Statement's Object is other than Activity. Example:
This actually appears to be an issue with semver breakage in the specification between 1.0.0 and 1.0.1.
1.0.0 Version:
The revision property MUST NOT be used if the Statement's Object is an Agent or Group.
The platform property MUST NOT be used if the Statement's Object is an Agent or Group.
1.0.1+ Version:
The revision property MUST only be used if the Statement's Object is an Activity.
The platform property MUST only be used if the Statement's Object is an Activity.
Not that it will necessarily matter for this lib. In general the library doesn't do any validation of objects leaving that to the LRS, but I could in this case see us checking during Statement serialization whether those properties exist/should be included in the Context.
The xAPI specification's description of the properties of the Context Object (see https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#requirements-10) is as follows:
In apparent contravention of the specification the PHP xAPI library allows the 'revision' and 'platform' properties where the Statement's Object is other than Activity. Example:
$activity = new TinCan\Activity (
[
'id' => 'http://www.baileyandireland.com/tincan/meeting/16-10-16',
'objectType' => 'Agent',
'name' => 'Andrew Downes',
'mbox' => 'mailto:[email protected]'
]
);
$context = new TinCan\Context (
[
'registration' => 'ec531277-b57b-4c15-8d91-d292c5b2b8f7',
'instructor' =>
[
'name' => 'Andrew Downes',
'account' =>
[
'homePage' => 'http://www.example.com',
'name' => '13936749'
],
'objectType' => 'Agent'
],
'team' =>
[
'name' => 'Team PB',
'mbox' => 'mailto:[email protected]',
'objectType' => 'Group'
],
'contextActivities' =>
[
'parent' =>
[
'id' => 'http://www.example.com/meetings/series/267',
'objectType' => 'Activity'
],
'grouping' =>
[
'id' => 'http://example.adlnet.gov/xapi/example/Algebra1'
],
'category' =>
[
'id' => 'http://www.example.com/meetings/categories/teammeeting',
'objectType' => 'Activity',
'definition' =>
[
'name' =>
[
'en-US' => 'team meeting'
],
'description' =>
[
'en-US' => 'A category of meeting used for regular team meetings.'
],
'type' => 'http://example.com/expapi/activities/meetingcategory'
],
],
'other' =>
[
[
'id' => 'http://www.example.com/meetings/occurances/34257',
'objectType' => 'Activity'
],
[
'id' => 'http://www.example.com/meetings/occurances/3425567',
'objectType' => 'Activity'
]
]
],
'revision' => 'Updated in Dec 2015',
'platform' => 'Example virtual meeting software',
'language' => 'en',
'statement' =>
[
'objectType' => 'StatementRef',
'id' => '6690e6c9-3ef0-4ed3-8b37-7f3964730bee'
],
'extensions' =>
[
'http://example.com/profiles/meetings/activitydefinitionextensions/room' =>
[
'name' => 'Kilby',
'id' => 'http://example.com/rooms/342'
]
]
]
);
The text was updated successfully, but these errors were encountered: