Automatically send SCORM data to LMS <p>I have this code so far...</p> <pre><code>function sendData() { // this work out where I am and construct the 'cmi.core.lesson.location' variable computeTime(); var a = "" + (course.length - 1) + "|"; for (i = 1; i &lt; course.length; i++) { a = a + qbin2hex(course[i].pages).join("") + "|"; if (iLP == 1) { a = a + course[i].duration + "|"; a = a + course[i].timecompleted + "|" } } SetQuizDetails(); a = a + course[0].quiz_score_running + "|0|0|0|0|0|0|"; objAPI.LMSSetValue("cmi.core.lesson_location", "LP_AT7|" + a); bFinishDone = (objAPI.LMSCommit("") == "true"); objAPI.LMSCommit(""); console.log("Data Sent!"); } setTimeout(sendData(), 1000); </code></pre> <p>However, it doesn't seem to work as intented. Data should be sent off to the server every 1000ms, but that's not happening. What am I missing here?</p> <p>As I side note, this is SCORM 1.2.</p>