Closed brian-learningpool closed 4 years ago
Not sure, I'll take a look at this in a bit.
Yeah, this does look like a mistake. Just going into a console, you can see the behavior isn't correct:
statement.addGroupingActivity("A"); statement.addGroupingActivity("B");
console.log(statement.context.contextActivities.grouping.length)
>> 1
Go ahead and submit that change for a PR and I'll move it through.
I noticed that the first statement was lost while trying to add two grouped items to my xAPI statement via
addGroupingActivity()
method. Is this by design or a bug?I think maybe
_getobj()
requires a check before returning an empty array on https://github.com/adlnet/xAPIWrapper/blob/c7bc09f28a6500924e2f4cef8e4d992c03cdd98b/src/xapistatement.js#L12.Something like