Not signed in (Sign In)

Vanilla 1.1.5a is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorphilip
    • CommentTimeApr 29th 2008 edited
     
    Steve writes:


    Thanks for your guide and code Phillip. I used your scorm.as and javascript to run flash in a scorm package. I have adapted your sample file so scores are stored in the moodle gradebook, but I have not been able to export the session time from Flash to the gradebook.


    //This is working:
    if(success){
    success = scorm.set("cmi.core.score.raw", myscore);
    }

    console("scorm.set('cmi.core.score.raw', myscore): " +success);

    //But this is not:
    if(success){
    success = scorm.set("cmi.core.session_time",
    course.session_time);
    }

    console("scorm.set('cmi.core.session_time',
    course.session_time): " +success);

    //I have a function which calculates hours, minutes,
    //seconds since application started and this is fed
    //to the variable course.session_time
    course.session_time = hours+":"+minutes+":"+seconds;


    Can you suggest anything?

    Many thanks

    Steve


    (linebreaks were added to the code to help it fit the page)


    hi steve

    are you getting any error messages? when using cmi.core.session_time, the format must be exact. The SCORM RTE documentation states: "HHHH:MM:SS.SS" Hours must be a minimum of 2 digits. if your time string doesn't have two digits for hours, you will get an error message from the LMS (205: incorrect data type). this would be an easy error to run into, since if you've only done one hour, a straight number-to-string conversion would give you 1:00:00 rather than 01:00:00. does your function add the leading zero when necessary?

    if your session format *does* meet the format rules (two-to-four digits for hours, two digits for minutes, two digits for seconds, and an optional two-digit decimal for partial seconds), perhaps there's some point in your code that tries to set cmi.core.session_time before your course.session_time variable has been properly set.

    - philip