No attempt time
garemoko opened this issue · 3 comments
We have session duration covered (cmi.session_time) but not attempt time (cmi.total_time).
Attempt time should be passed as part of the result in the passed/failed/completed statement.
It's in the JSON object stored at the activity attempt state endpoint. Additionally timestamps are at least recommended for all statements. I'd recommend if you're going to use statements to get total time, go from "initialized" to "terminated". The passed/failed/completed statement might not necessarily be the last statement in a session (or even exist at all).
Can you link me to where the "activity attempt state endpoint" is?
If initialized and terminated mark the beginning and end of attempt, you can't use those to calculate duration as that'd include time between sessions. You could work it out using resume and suspend too, but that'd be a big calculation for attempts spanning a lot of sessions.
There is an activity state for each attempt IRI with the state ID of http://adlnet.gov/xapi/profile/scorm/attempt-state
(https://github.com/creighton/xAPI-SCORM-Profile/blob/dev/xapi-scorm-profile.md#scorm-activity-attempt-state)
That's where we're recommending total_time goes.
Yeah I didn't mean timestamp I meant result duration. Following what SCORM says in the RTE, if cmi.total_time isn't set, add up all of the session times, which would be in the suspended statements.