Forum Discussion
JavaScript Communicating Points to Canvas LMS
- 5 days ago
Solution Post: Heart Anatomy Lab | Articulate - Community
It might be that you just needed make sure the data was a number before using it. I did this and tested on SCORM Cloud and it reported the score correctly.
In the attached file I've adjusted and added some console.logs so you can see the data being processed by JavaScript.
I also changed "26" to a Storyline variable called maxscore. You could just grab this JS and overwrite your existing script, or use the attached SL file.
let player = GetPlayer();
let score = Number(player.GetVar("score"));
console.log("score",score);
let maxscore = Number(player.GetVar("maxscore"));
console.log("maxscore",maxscore);
let scorePerc = (score/maxscore)*100;
console.log("scorePerc",scorePerc);
let lmsAPI = window.parent;
lmsAPI.SetScore(scorePerc, 100, 0);
Thanks! I played around with your solutions and I do think it was functioning better. Unfortunately I found out that the network for my institution will not access Javascript info to transfer to the LMS, so I had to find another work around. I am linking my solution below.
- SamHill5 days agoSuper Hero
Hi cameron​, Storyline runs on JavaScript. It doesn't sound right that you institution will not access JavaScript as that would mean the Storyline content would not work at all. To transfer any data to an LMS, Storyline uses the SCORM JavaScript API and to run any slide, JavaScript is used. I'm just flagging that you have potentially been given incorrect information regarding JavaScript.
- cameron4 days agoCommunity Member
Thank you for telling me! I will definitely have to look into this further.
Related Content
- 5 months ago