h5p / h5p-single-choice-set

MIT License
2 stars 63 forks source link

result.success and result.completion still not used #56

Open kgoertz99 opened 4 years ago

kgoertz99 commented 4 years ago

I have tried this with the latest release (1.11.9). The problem has become apparent when, in Moodle, after finishing a single choice set, the attempt is not counted as "completed" and it is also not shown whether the attempt was successful. This is the requestjson which was sent in the POST request after finishing the single choice set:

[
   {
      "actor":{
         "name":"bla@bla.bla",
         "mbox":"mailto:bla@bla.bla",
         "objectType":"Agent"
      },
      "verb":{
         "id":"http://adlnet.gov/expapi/verbs/answered",
         "display":{
            "en-US":"answered"
         }
      },
      "object":{
         "id":"https://bla.bla.bla/xapi/activity/311",
         "objectType":"Activity",
         "definition":{
            "interactionType":"compound",
            "type":"http://adlnet.gov/expapi/activities/cmi.interaction",
            "extensions":{
               "http://h5p.org/x-api/h5p-local-content-id":11
            }
         }
      },
      "result":{
         "duration":"PT23.509999999999998S",
         "score":{
            "raw":2,
            "min":0,
            "max":2,
            "scaled":1
         }
      }
   },
   {
      "actor":{
         "name":"bla@bla.bla",
         "mbox":"mailto:bla@bla.bla",
         "objectType":"Agent"
      },
      "verb":{
         "id":"http://adlnet.gov/expapi/verbs/answered",
         "display":{
            "en-US":"answered"
         }
      },
      "context":{
         "contextActivities":{
            "parent":[
               {
                  "id":"https://bla.bla.bla/xapi/activity/311",
                  "objectType":"Activity"
               }
            ]
         }
      },
      "object":{
         "id":"https://bla.bla.bla/xapi/activity/311?subContentId=ccf22619-c268-41ff-b3f5-e8a556370045",
         "objectType":"Activity",
         "definition":{
            "description":{
               "en-US":"Antwort 1"
            },
            "interactionType":"choice",
            "correctResponsesPattern":[
               "0"
            ],
            "type":"http://adlnet.gov/expapi/activities/cmi.interaction",
            "choices":[
               {
                  "id":"0",
                  "description":{
                     "en-US":"Antwort 1"
                  }
               },
               {
                  "id":"1",
                  "description":{
                     "en-US":"Antwort 2"
                  }
               }
            ],
            "extensions":{
               "http://h5p.org/x-api/h5p-local-content-id":11,
               "http://h5p.org/x-api/h5p-subContentId":"ccf22619-c268-41ff-b3f5-e8a556370045"
            }
         }
      },
      "result":{
         "response":"0",
         "completion":true,
         "success":true,
         "duration":"PT16.93S",
         "score":{
            "raw":1,
            "min":0,
            "max":1,
            "scaled":1
         }
      }
   },
   {
      "actor":{
         "name":"bla@bla.bla",
         "mbox":"mailto:bla@bla.bla",
         "objectType":"Agent"
      },
      "verb":{
         "id":"http://adlnet.gov/expapi/verbs/answered",
         "display":{
            "en-US":"answered"
         }
      },
      "context":{
         "contextActivities":{
            "parent":[
               {
                  "id":"https://bla.bla.bla/xapi/activity/311",
                  "objectType":"Activity"
               }
            ]
         }
      },
      "object":{
         "id":"https://bla.bla.bla/xapi/activity/311?subContentId=6ccb3edb-a1c6-4278-b0f6-e5fc2dec70be",
         "objectType":"Activity",
         "definition":{
            "description":{
               "en-US":"Antwort 1"
            },
            "interactionType":"choice",
            "correctResponsesPattern":[
               "0"
            ],
            "type":"http://adlnet.gov/expapi/activities/cmi.interaction",
            "choices":[
               {
                  "id":"0",
                  "description":{
                     "en-US":"Antwort 1"
                  }
               },
               {
                  "id":"1",
                  "description":{
                     "en-US":"Antwort 2"
                  }
               }
            ],
            "extensions":{
               "http://h5p.org/x-api/h5p-local-content-id":11,
               "http://h5p.org/x-api/h5p-subContentId":"6ccb3edb-a1c6-4278-b0f6-e5fc2dec70be"
            }
         }
      },
      "result":{
         "response":"0",
         "completion":true,
         "success":true,
         "duration":"PT6.58S",
         "score":{
            "raw":1,
            "min":0,
            "max":1,
            "scaled":1
         }
      }
   }
]

Evidently, result.success and result.completion are missing. I don't know why it wasn't fixed by da4cbae5dd0de34387e68ae3f147376f8e6cc015, but I double checked that my H5P-package contains the code of that commit, and it does.