Parent / Child Activities?


Andrew writes:

"[In my authoring tool work,] I'm considering building an option of sending a lot of statements for child activities (e.g. questions and possibly even slides). I wonder if there's a way by which I can use the context to report the parent (or grandparent/great-great-great-grandparent) activity without explicitly sending new statements for the parent activity. I need to re-read the context section and see how you've implemented it in the prototypes - its an area I've not really looked at yet. An ability to get data (e.g. duration) from children (or parents)  would be nice too e.g. for cases where the parent is a group of courses and wants to calculate its own duration."

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request


  • Avatar
    David Ells



    The way you group activities together is through the statements about them. This keeps Activities from being inseparably tied to each other by definition, but instead they can be associated during a specific learning experience with them. 

    You specify the activities to associate in the context part of the statement, using the "contextActivities" field.

    Here's an example:


         "actor": [some actor object],

         "verb": "experienced",

         "object": {"id":"activity1"},

         "context": {

            "contextActivities": {

                "parent": {"id":"activity1-parent"},

                "grouping": {"id":"activity1-course"},

                "other": {"id":"activity1-semester"}




    In this statement, we're saying, within the context of this "experience", activity1 is the child of activity1-parent, it is in a logical grouping of activity1-course, and is part of yet another grouping of activity1-semester. 

    Each of these fields in contextActivities could be specified in a TCAPI statement query, or otherwise used to group these statements into a report.

    Our convention is that for traditional SCORM-like content, we use the "grouping" field for the root level xAPI Activity that corresponds to the course as a whole. You can see an example of this in our Golf Example prototype ( here's a file that creates the context that is sent with all the statements from the example - )

    Also take a look at the "Report Sample" prototype, it uses the "object" parameter in a TCAPI statement query, along with the "context" flag, in order to pull all statements that have a context activity matching the given object. That way, it pulls all the statements relevant to the golf example in one query.

    Make sense? Thanks!

Powered by Zendesk