Skip to main content
Inspiring
May 19, 2022
Question

Help with NaN Error! [Cap2019]

  • May 19, 2022
  • 2 replies
  • 1041 views

Hi folks,

I got an error report from my LMS provider, that there´s an "NaN" but instead there should be an number. The content does not contain any quizzes, only a non-scored drag&drop. The settings should be either to "slide visits", counting e.g. 28 of 29 or 90%. The main problem: I did not create the captivate files, they are from a supplier ... 

 

Is there anything I can do with the exported files? And if not, what do I have to tell my supplier to do?

 

Thanks in advance!

This topic has been closed for replies.

2 replies

TLCMediaDesign
Inspiring
May 19, 2022

This shouldn't be affecting completion or break the course in any way.

 

Is this SCORM 2004?

 

The only thing you could do is to edit the scormdriver.js to see where the NaN is coming from and fix it there.

Sasha*Author
Inspiring
May 19, 2022

Yes, it´s SCORM2004. 

 

"see where the NaN is coming from and fix it there" --> What exactly do you mean? How can I find where the NaN is coming from? And how should a fix look like?

TLCMediaDesign
Inspiring
May 19, 2022

In the scormdriver.js, it uses a funtion RoundToPrecision for all of the vaules concerning the score.

 

So you would need to unminify the scormdriver.js here: https://beautifier.io/

 

Find the function that looks like this on line 660:

function RoundToPrecision(number, significantDigits) {
number = parseFloat(number);
return (Math.round(number * Math.pow(10, significantDigits)) / Math.pow(10, significantDigits))
}

 

and replace it with this:

function RoundToPrecision(number, significantDigits) {
number = parseFloat(number);
var getNum = (Math.round(number * Math.pow(10, significantDigits)) / Math.pow(10, significantDigits));
if ( isNaN.getNum )
{
return 0;
}
else
{
return getNum;
}
}

Sasha*Author
Inspiring
May 19, 2022