adaptlearning / adapt-contrib-xapi

TinCan/xAPI extension for the Adapt Framework
GNU General Public License v3.0
12 stars 28 forks source link

Matching question response is incorrect #65

Closed garemoko closed 5 years ago

garemoko commented 5 years ago

For matching questions, the result.response property uses a target id that is not one of the listed targets. The correctResponsesPattern does use the right id. Example (redacted to remove client information) object and result properties from a statement below.

I can't figure out where in the code the definition for statements (e.g. the correctResponsesPattern is getting built)


"object": {
    "objectType": "Activity",
    "id": "https://example.com/url",
    "definition": {
      "name": {
        "en": "Foo"
      },
      "description": {
        "en": "Lorem foobar"
      },
      "type": "http://adlnet.gov/expapi/activities/question",
      "interactionType": "matching",
      "correctResponsesPattern": [
        "1[.]1_1"
      ],
      "source": [
        {
          "id": "1",
          "description": {
            "en": "Thing to match to..."
          }
        }
      ],
      "target": [
        {
          "id": "1_1",
          "description": {
            "en": "This other thing"
          }
        },
        {
          "id": "1_2",
          "description": {
            "en": "Or this one"
          }
        }
      ]
    }
  },
  "result": {
    "score": {
      "raw": 1
    },
    "success": true,
    "completion": true,
    "response": "1[.]1"
  }```
brian-learningpool commented 5 years ago

There is a getInteractionObject() function which is implemented in each question component. For Matching you can find it here: https://github.com/adaptlearning/adapt-contrib-matching/blob/master/js/matchingModel.js#L148-L199

garemoko commented 5 years ago

@brian-learningpool Thanks!

So one solution would be to remove the question index and underscore from both the correctResponsesPattern and the target. It's odd that the question index is included in the target but not the source anyway.

This seems like a better solution than modifying the result.response since the question index does not add any value.

brian-learningpool commented 5 years ago

Hi @garemoko, I've had a look at this and it looks like response is wrong. The question index is included in the target because a Matching component can contain multiple questions:

In this case source is the question and target are the possible answers, prefixed with the question index to indicate the grouping.

garemoko commented 5 years ago

@brian-learningpool both sets of options are the same in that example - is that always the case with this interaction type? If not, that's really just two multiple choice questions on one slide, if it is, I don't understand why you need the question prefix.

brian-learningpool commented 5 years ago

Hi @garemoko, apologies for the confusion, I just added the screenshot to indicate there were multiple questions and didn't even check the items.

To clarify, the possible answers are unique to each question, that's why the prefix is required, e.g.

1: What colour is the sky?
1_1: Pink
1_2: Blue

2: What does a dog do?
2_1: Bark
2_2: Purr  
garemoko commented 5 years ago

Thanks @brian-learningpool. In that case, I would not consider this a matching question, but instead as two multiple choice questions that happen to be on the same page. That might be a bit of a bigger re-work, but would lead to clearer data.

brian-learningpool commented 5 years ago

@garemoko, it's been Matching since v1 of the Adapt Framework. It's different from two multiple choice questions as the score for the question component is dependent on matching all options correctly. I think it's getting slightly off track here but drop into the Gitter room https://gitter.im/adaptlearning/adapt_framework if you want to discuss it with the team.

I do believe the response is incorrect.