How to keep undate the punctuation

Hi, I would like to keep update the scorm punctuation (cmi.core.score.raw) and now, this value is set when you finish the scorm.
I have been searching and I found this code here:

    if (!prez.lmsInitEx){
        prez.lmsInitEx = true;
        if (prez.lms) {
            var fEndLesson = prez.lms.endLesson;
            prez.lms.endLesson = function(bTimeout){
                fEndLesson.call(this, bTimeout);
                var bPassed = prez.result();
                doSetValue('cmi.completion_status', bPassed ? 'completed' : 'incomplete');
                doCommit();
            }
        }

I tried to execute the following code when I load each silde, but it doesn’t work.

    doSetValue('cmi.core.score.raw', prez.variable("myScore"));
    doCommit();

What’s wrong? And how can I do it?

Thank you.

Hi Pedro,

Please try adding the following code into ActivePresenter > Project > Properties > Event:

if (prez.lmsInitEx)
	return;

prez.lmsInitEx = true;

if (prez.lms) {
	var fStoreSuspendData = prez.lms.storeSuspendData;
	prez.lms.storeSuspendData = function(suspendInfo, bCommit){
		
		var nRawScore = prez.score();
		var nMaxScore = prez.maxScore();
		
		//SCORM 2004
		doSetValue('cmi.score.scaled', nMaxScore > 0 ? (nRawScore/nMaxScore) : 0);
		doSetValue('cmi.score.raw', nRawScore > 0 ? Math.round(nRawScore) : 0);
		
		/*
		SCORM 1.2
		doLMSSetValue('cmi.core.score.raw', (nMaxScore > 0 && nRawScore > 0) ? Math.round(nRawScore * 100/nMaxScore) : 0);			
		*/
		
		fStoreSuspendData.call(this, suspendInfo, bCommit);
	}
}

Please note that this may not work for the future releases. This code is for SCORM 2004. You need to modify the code (follow the comment inside it) if you want to use with SCORM 1.2.

We will consider adding an option for it when exporting to HTML5/SCORM in the future.

Regards,

Hi

We have solve our problem,

Thank you so much,