Reserved Variables

struitt Community Member Posts: 127 ♪ Opening Act ♪
Hi rockstars!

Quick question...I am wanting to add the variable 'Elapsed Time' to a course so we can capture how long a learner is in the course. 'Elapsed Time' is listed under 'Reserved Variables,' however when I add the action to 'modify variable' it is not available for me to choose.

I've tried this in Lectora 18 and 19 with the same results. I've never used this variable before so I'm reaching out to anyone who has.

What am I doing wrong?


  • cainam
    cainam Community Member Posts: 286 ☆ Superstar ☆
    It is a variable already set up for you - so it is already initiated. To see the value of it, you can set up an action to change the contents of a text block and swap in the ElapsedTime Variable instead. (Target your text block, value is ElapsedTime)
    - Adam Cain
  • struitt
    struitt Community Member Posts: 127 ♪ Opening Act ♪
    How would it get to an LMS such as Saba? Like how would my LMS team be able to tell that a learner spent X amount of minutes in the course?

    My LMS team is telling me I need to insert (specifically) the variable cmi.core.session_time to report to the LMS (I found 'Elapsed Time' while researching and it sounded the same).
  • timk
    timk Community Member Posts: 1,176 ☆ Superstar ☆
    Aren't there any error messages? Sending the session_time is one of the most basic Scorm requirements. Lectora should do it all automatically. If it didn't there should be a Scorm error. I tested Lectora 19 with moodle and it worked. I've never had any issues with it.
  • struitt
    struitt Community Member Posts: 127 ♪ Opening Act ♪
    I have to meet with the LMS team (Saba) today to get more details. As far as I know there are no error messages. All I know is they are requesting I insert an action into the course for sending cmi.core.session_time and I can't figure out how or what they are talking about.

    If it is in there automatically, I guess the question is how can they see that data? Our LMS team wants to be able to tell how long a learner was in a course and with early tests, the numbers don't match.
  • timk
    timk Community Member Posts: 1,176 ☆ Superstar ☆
    edited April 27, 2021
    The file "scofunctions.js" that is part of the scorm package contains the function "computeTime" that calculates the time a user has spent in the course and sets "cmi.core.session_time" to this value. The function is executed regularly, i.e. whenever the course might be closed.

    The session time isn't displayed by the LMS or at least not by the systems I know. It is added to cmi.core.total_time, the "Sum of all of the learner’s session times accumulated in the current learner attempt". This is a value that should be displayed by the LMS and is the time a user has spent in the course from "not attempted" to "completed", not matter how many sessions have been done to reach completion.

    If you wanted to set the session_time yourself, it can be done with a Run javascript action. For this you need the time in a format "hh:mm:ss.0". You could put it in a variable, e.g. "mytime" with two actions:

    Action: Modify variable
    Target: mytime
    Type: Set equal to
    Value: VAR(ElapsedTime)

    Action: Modify variable
    Target: mytime
    Type: Add to variable
    Value: .0

    Then Run javascript:
    LMSSetValue( "cmi.core.session_time",Varmytime.getValue());

    But this will only work if Lectoras automatic functions do not work at all. Otherwise it may be overwritten by Lectoras own logic. And all my tests say it works...
  • struitt
    struitt Community Member Posts: 127 ♪ Opening Act ♪
    I appreciate that timk. I have no doubt Lectora works, I'm just trying to figure out *how* it works and how I can have that conversation with my LMS/Saba team as this is unchartered territory for me, even after working in Lectora for 14 years.

    This is one of those situations where I don't know what I don't know.
  • carlfink
    carlfink Community Member Posts: 839 ☆ Superstar ☆
    @struitt, think just one level higher. What is the purpose of using cme.core.session_time? Who is consuming that information? What do they really need to know?
Sign In or Register to comment.

So You Wanna Be An eLearning ROCKSTAR?

We're all fans of eLearning here! Want to become an eLearning ROCKSTAR? Just click on one of the buttons below to start your rocking journey!