cmi.core.total_time

Syntax: LMSGetValue("cmi.core.total_time");

Responsibility: The LMS is responsible for calculating this value. However, it uses the data written to cmi.core.session_time to calculate this value. If the SCO is not writing the session time to the cmi.core.session_time item, then the cmi.core.total_time item may be invalid.

Data: CMITimespan

Description: This is the total accumulated time of all the student's sessions in this SCO. It is used to keep track of the total time spent in every session of this SCO for this student. The LMS should initialize this to a default value the first time the SCO is launched and then use the SCO reported values to cmi.core.session_time to keep a running total.

When the student is in their first attempt at a SCO, the cmi.core.score.raw should be set to an empty string. For additional attempts the cmi.core.score.raw item reflects what was recorded on the student's last previous attempt. If no cmi.core.score.raw was set in a SCO and a request for the cmi.core.score.raw as made by the SCO, then an empty string should be returned.

Example Javascript: The following JavaScript reads the accumulated time in this score and then checks to see if it has exceeded 1 hour. If it has exceeded 1 hour, the student is reminded that help is available.

<script language="javascript">

var totalTime
= LMSGetValue("cmi.core.total_time");
var splitTime = totalTime.split(":");
var totalHours = splitTime[0];

var totalMinutes = splitTime[1];
if ((totalHours == 1 && totalMinutes > 0) || (totalHours > 1)) {
    // Student has spent over 1 hour in this SCO
    alert("You seem to be having a problem completing this lesson. You might want to cick on the Help button to review the tips for this lesson.");
}


</script>