Skip to content

Context Object - possible inconsistency with specification #79

@GrantBailey

Description

@GrantBailey

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:

  • 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:

$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'
]
]
]
);

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions