Dictaction - result.success in xAPI statement is always false

Michael Dajewski's picture

xAPI statement example:

actor: {...}
verb: {id: "http://adlnet.gov/expapi/verbs/answered", display: {…}}
object: {...}
context: {...}
result:
score: {min: 0, max: 14, raw: 14, scaled: 1}
completion: true
success: false


Even if result.scale.scaled is 1 the result success is false.

The 'Behavioural settings' in editor have no impact.

Tested with: https://h5p.org/dictation (1st example)
Library version: 1.0.2

This happens because the mistakesTrimmed used in isPassed() is never declared nor assigned a value.

See: h5p-dictation/src/scripts/h5p-dictation.js
Branch: master
Latest commit to this file: 5de4db4

LN: 318

this.isPassed = () => this.mistakesTrimmed === 0;

Proposed change:

this.isPassed = () => this.mistakesCapped === 0;
Above change fixes issue for me, but I will live decission upto you. 

The result.success is true or false as expected.

Content types: 
otacke's picture

Hi Michael!

Clearly a bug that happened when tidying up the code. Why didn't you simply file a pull request for the change? No need for lengthy explanations.

Best,

Oliver 

otacke's picture

Hi Michael!

I fixed the issue and also was told by the H5P core team that the patch should be out this week. Thanks for reporting and sorry for the trouble.

Cheers,
Oliver

Michael Dajewski's picture

Oliver, 

Thank you for fixing it quickly. 
Sorry for lengthly report - wanted to be as clear as possible. 
I was not sure the pull request is the right way to report the issues. 

Best regards, 
MichaelD

otacke's picture

Hi Michael!

If you fixed it anyway, don't be shy :-)

Best,

Oliver 

otacke's picture

Hi Michael!

The fix has been released on h5p.org and should soon be available via the editor for updating. Thanks again.

Best,
Oliver