logging duration with xAPI
Hi everyone,
I'm trying to log duration with xAPI and encounter some problems.
The first problem is already solved - I had to find out how to get and store the elapsed time on a slide.
This article was great help: http://iconlogic.blogs.com/weblog/2014/12/adobe-captivate-system-time-variables.html
My problem is now that I don't manage to send the ISO-converted time to xAPI and to retain it in my data,
which I'm downloading from scorm cloud via a get request with postman.
Here's my code, Im basically trying to get the elapsed time - which I calculated before using the proposed method from the iconlogic blog -
and to convert it to an iso string and to assign it to the result duration variable:
var tincan = new TinCan ({url: window.location.href});
var duration_conv = window.cpAPIInterface.getVariableValue("elapsed_time_slide1");
tincan.sendStatement(
{
"verb": {
"id": "http://adlnet.gov/expapi/verbs/completed",
"display": {
"en-US": "completed"
}
},
"object": {
"id": "http://COSIMA_TP4_SIM_AINMUELLER/main_question_menu",
"definition": {
"name": {
"en-US": "main_question_menu"
},
"description": {
"en-US": "Menu for main questions"
}
},
"objectType": "Activity"
},
"result": {
"duration": new Date(duration_conv).toISOString()
}
}
);
