Storyline xAPI Surveys returning invalid JSON

Jan 24, 2017

We have created several simple one page surveys as a testing ground. On Submit the xAPI Statement JSON is found to be invalid. An example is below. Thank you. 

{"object":{"id":"http://65qXj31zAhY_course_id/5VHHvWV5mas/5xUqZmjNzaX/Statement_6SEu92oY22m","definition":{"description":{"und":"As a new team member, this class was very informative to me."},"scale":{"id":"6Xuzs9fGR2z","description":{"und":"Strongly Disagree"}},{"id":"6jlHVNKrZFQ","description":{"und":"Disagree"}},{"id":"5WXUR3VTKKI","description":{"und":"Neutral"}},{"id":"5ZmKBBEW2Os","description":{"und":"Agree"}},{"id":"5tVNsXeC5Yl","description":{"und":"Strongly Agree"}},"interactionType":"likert","name":{"und":"As a new team member, this class was very informative to me."},"type":"http://adlnet.gov/expapi/activities/cmi.interaction"},"objectType":"Activity"},"result":{"response":"5tVNsXeC5Yl"},"verb":{"id":"http://adlnet.gov/expapi/verbs/answered"},"actor":{"mbox":"mailto:someemail@e.com","name":"Mike XapiMan"},"version":"1.0.0","context":{"contextActivities":{"grouping":{"id":"http://65qXj31zAhY_course_id"},"parent":{"id":"http://65qXj31zAhY_course_id/5nI0awE0piX"}},"registration":"MXw5MzF8Mzk2fDc3fDEwOA=="}}

 

3 Replies
Tom King

I may be under-informed, but at first blush it looks like a simple formatting error in the generated JSON-- shouldn't the scale item be an array with multiple sub-objects as peers for the responses? Otherwise the identifier/objects don't pair as valid JSON.

Instead, maybe something like this, with scale as an array is what was intended:

{
"object": {
"id": "http://65qXj31zAhY_course_id/5VHHvWV5mas/5xUqZmjNzaX/Statement_6SEu92oY22m",
"definition": {
"description": {
"und": "As a new team member, this class was very informative to me."
},
"scale": [
{
"id": "6Xuzs9fGR2z",
"description": {
"und": "Strongly Disagree"
}
},
...
{
"id": "5tVNsXeC5Yl",
"description": {
"und": "Strongly Agree"
}
}
],
Tom King

Sorry to chime in again, but the example Storyline-generated JSON structure seems inconsistent with other Likert examples, such as the one found here: <http://tincanapi.com/scorm-to-tin-can-api-cookbook/#pt9> which shows...

"object": {
        "id": "http://www.example.com/tincan/activities/uyheHUJd76s/question3",
        "objectType": "Activity",
        "definition": {
            "name": {"en-US": "Question 3"},
            "description": {"en-US": "How awesome is Tin Can?"},
            "type": "http://adlnet.gov/expapi/activities/cmi.interaction",
            "interactionType": "likert",
            "correctResponsesPattern": ["likert_3"],
            "scale": [
                {"id": "likert_0", "description": {"en-US": "It’s OK"}},
                {"id": "likert_1", "description": {"en-US": "It’s Pretty Cool"}},
                {"id": "likert_2", "description": {"en-US": "It’s Damn Cool"}},
                {"id": "likert_3", "description": {"en-US": "It’s Gonna Change the World"}}
            ]
        }
    }
 

So maybe something needs to be fixed on the Storyline side of the equation?

This discussion is closed. You can start a new discussion or contact Articulate Support.