Add xAPI data

Description

The format I would expect from the getXAPIData in Documentation Tool contains the main statement from Documentation Tool with a finishing verb (e.g. "answered" or "completed") and the children of Documentation Tool.

The children of doctool is its pages, these are typically of "compound" interaction type since they consist of multiple inputs/answers.

The smallest pieces are "long-fill-in" for the questions that can be answered and the goals definitions, and "choice" for the goal assessments. A hand-written example for how statement and children can look (be aware that this will likely need some modification once implemented, but can be a good starting point):

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 { "statement": { "actor": { "name": "user", "mbox": "mailto:usermail.com", "objectType": "Agent" }, "verb": { "id": "http://adlnet.gov/expapi/verbs/answered", "display": { "en-US": "answered" } }, "object": { "id": "https://example.com/node/XXX", "objectType": "Activity", "definition": { "extensions": { "http://h5p.org/x-api/h5p-local-content-id": XXXXX }, "name": { "en-US": "Documentation Tool" }, "interactionType": "compound/documentationtool", "type": "http://adlnet.gov/expapi/activities/cmi.interaction" } }, "context": { "contextActivities": { "category": [ { "id": "http://example.com/libraries/H5P.DocumentationTool-X.XX", "objectType": "Activity" } ] } }, "result": { "completion": true, "duration": "PT104.38S" } }, "children": [ { "statement": { "actor": { "name": "user", "mbox": "mailto:user@mail.com", "objectType": "Agent" }, "verb": { "id": "http://adlnet.gov/expapi/verbs/answered", "display": { "en-US": "answered" } }, "context": { "contextActivities": { "parent": [ { "id": "https://example.com/node/XXX", "objectType": "Activity" } ] } }, "object": { "id": "https://example.com/node/XXX?subContentId=8964f94f-190c-4fe7-a729-3c89618b9fb0", "objectType": "Activity", "definition": { "interactionType": "compound", "type": "http://adlnet.gov/expapi/activities/cmi.interaction", "extensions": { "http://h5p.org/x-api/h5p-local-content-id": XXXXX, "http://h5p.org/x-api/h5p-subContentId": "8964f94f-190c-4fe7-a729-3c89618b9fb0" } } }, "result": { "duration": "PT10.32S" } }, "children": [ { "statement": { "actor": { "name": "user", "mbox": "mailto:user@mail.com", "objectType": "Agent" }, "verb": { "id": "http://adlnet.gov/expapi/verbs/answered", "display": { "en-US": "answered" } }, "context": { "contextActivities": { "parent": [ { "id": "https://example.com/node/XXX?subContentId=8964f94f-190c-4fe7-a729-3c89618b9fb0", "objectType": "Activity" } ] } }, "object": { "id": "https://example.com/node/XXX?subContentId=0a5f12b1-c025-4a19-9771-d31d58511438", "objectType": "Activity", "definition": { "description": { "en-US": "Did you learn how to make the cookies ??" }, "interactionType": "choice", "type": "http://adlnet.gov/expapi/activities/cmi.interaction", "choices": [ { "id": "0", "description": { "en-US": "Did not achieve" } }, { "id": "1", "description": { "en-US": "Achieved partially" } }, { "id": "2", "description": { "en-US": "Achieved completely" } } ], "extensions": { "http://h5p.org/x-api/h5p-local-content-id": 21180, "http://h5p.org/x-api/h5p-subContentId": "0a5f12b1-c025-4a19-9771-d31d58511438" } } }, "result": { "completion": true, "duration": "PT5.28S" } } } ] }, { "statement": { "actor": { "name": "user", "mbox": "mailto:user@gmail.com", "objectType": "Agent" }, "verb": { "id": "http://adlnet.gov/expapi/verbs/answered", "display": { "en-US": "answered" } }, "object": { "id": "https://h5p.org/node/612?subContentId=a648de70-c1fd-4692-9261-ce44bc0a9204", "objectType": "Activity", "definition": { "extensions": { "http://h5p.org/x-api/h5p-local-content-id": 21180, "http://h5p.org/x-api/h5p-subContentId": "a648de70-c1fd-4692-9261-ce44bc0a9204" }, "name": { "en-US": "Nameof the project" }, "type": "http://adlnet.gov/expapi/activities/cmi.interaction", "interactionType": "long-fill-in" } }, "context": { "contextActivities": { "parent": [ { "id": "https://h5p.org/node/612", "objectType": "Activity" } ], "category": [ { "id": "http://h5p.org/libraries/H5P.TextInputField-1.0", "objectType": "Activity" } ] } }, "result": { "completion": true, "duration": "PT91.73S", "response": "My first H5P Documentation Tool!" } } } ]

Acceptance Criteria

1. Interacted events whenever the user interacts with the various widgets in the tool

2. Progressed events when the user changes pages with the same data as for CoursePresentation (what page did he go to is detailed and we use the same statement structure for detailing this)

3. When the user says he is done there will be answered events for every input field and a "completed" event for the entire tool. (With result data detailing the users answers in the answered event. The reason the answered events aren't triggered until at this point is that this is when we can be sure that the user is done answering.)

4. A getXAPIData function sending in everything in the format described in description

Status

Assignee

Timothy Lim

Reporter

Svein-Tore Griff With

Funding

DocToolReporting

Code reviewer

Thomas Marstrander

Released

None

Time tracking

8h

Fix versions

Priority

Medium