Forum Discussion
lmsAPI Functionality in HTML5 Output
Hi Astutis,
One thing I noticed in your code is that you have quotes around the "14" when you are declaring the passingScore variable. This is most likely forcing that variable to be used as a String. So, when you do your '>=' comparison later on, it would be comparing a number to a string (which wouldn't be reliable). Otherwise, I think your code looked good.
The other thing I would double-check is that these variables that you are pulling in are exactly what you are expecting them to be. For example, I'm assuming that you have a trigger on your results slide somewhere to set "finalscore" equal to "Results.PassPoints" or something like that, right?
If you try these things, it may or may not work. If it doesn't work, perhaps you could upload a .story file and I could take a look?
Hi Adam.
I removed the quotations from the "14", but it's still setting a 'Passed' status when the score is 13.
I have a variable in my project titled 'finalscore', but I don't have a trigger on my results slide involving it. Should I? The only triggers I have are a 'Submit results' one to get the question answers sent to the LMS, and the one executing the Javascript code.
I do have a trigger on the previous hidden 'How many' survey slide which is setting finalscore to the typed value in the numeric entry box.
I've got the variables being displayed on the results slide so that I can check they're working okay, and they are displaying correctly. It's just the passed/failed status that's not working.