LMSSetValue Error

Hi, I get an error message when I test my SCORM 1.2 title in my LMS: LMSSetValue Error:cmi.core.session_time to [00:00:00.0]Not initialized

and when clicking OK in the dialog box, a new error message: LMSCommit Error: Not initialized.

The results is that the course is not logging properly. Seems like it stops logging after each page.

Can anyone help me with this issue? Im not a programmer.

Feedback is highly appreciated.

Kristine

Comments

  • jvalley4735
    jvalley4735 Community Member Posts: 1,357
    Is there a timer or time limit set for this course either in your AU's Information ribbon or LMS settings? I'd submit a support ticket (there's a button on the right-hand side of the page to take you to the website).  The Support team is able to screen share with you while in your course on your LMS.
  • klaatu
    klaatu Community Member Posts: 988
    Just a guess here but it looks like something in the lesson is either sending an LMSFinish to the LMS before the session time is submitted or the LMS isn't being properly initialized.

    Which Inspire version are you using? If you are publishing with Seemless play selected, try without it.
  • klaatu
    klaatu Community Member Posts: 988
    Another question. You mentioned that it "Seems like it stops logging after each page." Can you elaborate? Is the lesson closing after each page? What is making you think that it is logging anything at all, is there a cumulative time stored in your LMS for this lesson are does it show 00:00:00.0?
  • jhansen4963
    jhansen4963 Community Member Posts: 4
    Good day, Fellow Forum Frequenters!

    I too have had others tell me that they are receiving the error:

    <span style="font-family: 'Calibri Light',sans-serif;"><span style="color: #000000;">"LMSSetValue Error:cmi.core.session_time to [00:00:00.0] Not initialized" </span></span>

    Has a resolution to this issue been discovered?  Does the version of Windows matter?

    Side note:  no timer, no time limit.  SCORM 1.2

    Thank you,

    Justin
  • carlfink
    carlfink Community Member Posts: 947 ♦ Idol ♦
    Hi, Justin,

    From what you write, it seems as if only some people get the error, or only some of the time? Can you clarify?

    Do you know what Lectora Action is running (if any) when you receive the error? If it isn't an explicit Action, what precedes the error? Page navigation? Completing a test? Just sitting idle on the same page?

    What LMS are you using? Have you tested the course in another, say a free SCORM Cloud account?

    Have you/your students tried a different browser?
  • jhansen4963
    jhansen4963 Community Member Posts: 4
    Hi Carl,

    I have not received the error on my computer, but others are running into the error.   The "next" (page forward) action causes a lag and then eventually the error message pops up.  Almost immediately when starting the course, never makes it to the test.

    I am running Lectora Publisher.  No, I don't have a SCORM cloud to test it in.  I am almost certain the company security would shut all of that down for me.  :-(  I have created over a dozen or so courses, and this is the first one to pop this error.  It has me scratching my head.

    Still waiting back to hear about the browser, but I wanted to update you.

    Thank you
  • timk
    timk Community Member Posts: 1,197 ♦ Idol ♦
    cmi.core.session_time is a scorm variable, it's not related to any course internal action or timer. It counts the time a user spends in the course, i.e. the time the window is opened. When the window is closed its value is added to cmi.core.total_time that informs you about the time the user has taken from "not attempted" to "completed".

    So, one of the first things that should happen when the course is launched would be to (re-)set the session time variable to "00:00:00.0", before it starts counting. The error says it cannot do that. When you go to the next page the course tries again and the error is repeated.

    "Not initialized (301) Indicates that an API call was made before the call to LMSInitialize."

    Seems like the connection to the LMS is missing, maybe due to a missing internet connection.
  • jhansen4963
    jhansen4963 Community Member Posts: 4
    Hi Tim,

    Great!  I don't feel it is an internet connection issue, all of the connections are strong.  I have been looking through the forums and found a fix that happened in 2015 in a slightly unrelated LMS issue at:

    https://moodle.org/mod/forum/discuss.php?d=316441

    I opened up the Java Script file (scofunctions.js) and found that that fix is present.  I found the specific input/ output script that may be affecting this ( "function computeTime() {" ), but since I don't have the in-depth knowledge on Java, I don't know if this is the actual issue.  I have attached the Java Script file you want to take a look.

    Thank you,
  • jhansen4963
    jhansen4963 Community Member Posts: 4
    Arrgh, for security reasons, the Java Script file was not allowed.  So, I have included the snip-it below:
    function computeTime() {
    var startDate = readVariable( 'TrivantisSCORMTimer', 0 )
    if ( startDate != 0 ) {
    var currentDate = new Date().getTime();
    var elapsedMills = currentDate - startDate;
    var formattedTime = convertTotalMills( elapsedMills );
    }
    else formattedTime = "00:00:00.0";
    MySetValue( "cmi.core.session_time", formattedTime );
    }

     

    Thank you,
  • timk
    timk Community Member Posts: 1,197 ♦ Idol ♦
    I'm not sure this function is the reason. It's run when a page is loaded. When executed for the first time, i.e. when the course is launched, "startDate" is equal to 0.

    If it's not equal to 0 "if ( startDate != 0 )" the course calculates the difference between the startDate (the date the window has been opened) and the currentDate. The result is the time the window is open in milliseconds. The function "convertTotalMills()" brings the milliseconds into the format the LMS requires "hh:mm:ss.tenths" and saves the result in the variable "formattedTime" .

    If startDate is equal to 0 (else), i.e. if the window has just been opened, it sets the formattedTime directly to "00:00:00.0". The error occurs when the course tries to MySetValue( "cmi.core.session_time", formattedTime)

    But I don't think it is related to the time formatting or time measure. The error says, "My attempt to set the LMS' session time variable to the value of "formattedTime" fails, because the connection to the LMS is "Not initialized". Or as Scorm.com formulates it: "The attempt to change the session time variable comes before the call to LMSInitialize." which means the same: No connection to the LMS.

    If something was wrong with the variable or its value, it should be a different error, e.g. "Incorrect Data Type"

    Did you publish with "Prompt the user to navigate to the last viewed page"? If yes, the same error should occur:

    LMS: LMSSetValue Error:cmi.core.lesson_location to ["welcome.html"]Not initialized
  • carlfink
    carlfink Community Member Posts: 947 ♦ Idol ♦
    Tim, would it make sense to trap the error and run LMSInitialize() (again?) in the code?

    I'm pretty ignorant of the SCORM API. We don't even use SCORM at my company. Our LMS also has weird bugs, e. g. if you change a test score after saving it (using AICC), you can actually crash the server process entirely. (This was true as of 2017. We never tried it again after our provider told us to stop, obviously.)
  • timk
    timk Community Member Posts: 1,197 ♦ Idol ♦
    It should be easy enough to try, but I suppose it's coming too late. The scorm functions are probably run first, before the first user-created action is executed. There must be a reason why the connection fails, and maybe it is not too likely that it connects half a second later. It can hardly be caused by something in the course, I create lots of scorm packages and I've never seen that error.

     
  • carlfink
    carlfink Community Member Posts: 947 ♦ Idol ♦
    A random thought that occurs to me: if there is a CDN between the user and the LMS, or some sort of load-sharing so that several servers share a domain name, it would tend to break connections like that (especially if configured wrong). As I say, that's a pure guess.

     

    Justin: you can create a free account at cloud.scorm.com. It's an LMS cloud service. If your company's policy allows it, create an account there and see if you have the same problem with a different server.
  • sandrzejewski-6162
    sandrzejewski-6162 Community Member Posts: 2
    Dear Lectora Inspire users

    I also have LMS SetValue Error in my course but it is unspecified

    My course in LI is inserted in my university ELearning platform based on Moodle

    This error message shows when I'm clicking on Process Test Results button. All answers from the test section are properly transferred into ELearning platform but I want to get rid of this Error message.

    Is there any mistake in test section parameters?

     

     
  • timk
    timk Community Member Posts: 1,197 ♦ Idol ♦
    Seems like either something is missing or the course tries to fill in a variable that doesn't exist. But that's very difficult to troubleshoot with so little information.

    What are your parameters?
    Are there any error messages in the console?
    Which Lectora version do you use?

    Can you share the AWT?
  • sandrzejewski-6162
    sandrzejewski-6162 Community Member Posts: 2
    1. What do you mean by parameters?

    2. After Lectora Inspire internal control of a project (by a command "publish") there are no mistakes that enable me to create a course for Moodle-based platform

    3. I'm using 18.2.1 version. Maybe updating a program to 18.2.2 will solve a problem

    But does it help to share a single AVT file?
  • timk
    timk Community Member Posts: 1,197 ♦ Idol ♦
    You wrote about the "test section parameters". Your publishing settings may also be relevant.

    When you open the course in moodle, and take a look at the browsers developers tools (F12) when you click the button it may show error messages that allow to gather some more information about the error.

    If you shared the AWT file along with the related folders "images", "media" etc. I (or someone else) could take a look at the project and maybe find the error.