Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Automatic SCORM score script

New Here ,
Nov 16, 2015 Nov 16, 2015

Hi,

can anyone help me with the js that will allow user to acquire point (SCORM 2004) just for viewing the slide (either on enter or exit of the slide). I will obviously use advanced actions to execute the script. The script should allow me to set the amount of points granted for each slide and set the max score so the points from the slide view could be mixed with quiz points.

I need help ASAP.

TOPICS
Advanced
321
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Nov 19, 2015 Nov 19, 2015
LATEST

I think you'll run into issues, especially with SCORM 2004 trying to do this. You will have a hard time trying to stop Captivate from overwriting your custom scores.

You most likely would need to publish Captivate without SCORM and use a custom SCORM wrapper and manifest.

That being said, this is the function(s) to set the score:

function SCORM2004_SetScore(intScore, intMaxScore, intMinScore)

{

    return true;

var blnResult;

    var fltNormalizedScore;

    WriteToDebug("In SCORM2004_SetScore intScore=" + intScore + ", intMaxScore=" + intMaxScore + ", intMinScore=" + intMinScore);

    SCORM2004_ClearErrorInfo();

    fltNormalizedScore = intScore / 100;

    RoundToPrecision(fltNormalizedScore, 7);

    blnResult = SCORM2004_CallSetValue("cmi.score.raw", intScore);

    blnResult = SCORM2004_CallSetValue("cmi.score.max", intMaxScore) && blnResult;

    blnResult = SCORM2004_CallSetValue("cmi.score.min", intMinScore) && blnResult;

    blnResult = SCORM2004_CallSetValue("cmi.score.scaled", fltNormalizedScore) && blnResult;

    WriteToDebug("Returning " + blnResult);

    return blnResult;

}

or

function SCORM2004_SetPointBasedScore(intScore, intMaxScore, intMinScore)

{

    var blnResult;

    var fltCalculatedScore;

    WriteToDebug("In SCORM2004_SetPointBasedScore intScore=" + intScore + ", intMaxScore=" + intMaxScore + ", intMinScore=" + intMinScore);

    SCORM2004_ClearErrorInfo();

    if (intScore >= intMinScore)

    {

        fltCalculatedScore = intScore / intMaxScore;

    }

    else

    {

        WriteToDebug("intScore is lower than intMinScore. Overriding score with minscore for cmi.score.scaled");

        fltCalculatedScore = intMinScore / intMaxScore;

    }

    fltCalculatedScore = RoundToPrecision(fltCalculatedScore, 7);

    blnResult = SCORM2004_CallSetValue("cmi.score.raw", intScore);

    blnResult = SCORM2004_CallSetValue("cmi.score.max", intMaxScore) && blnResult;

    blnResult = SCORM2004_CallSetValue("cmi.score.min", intMinScore) && blnResult;

    blnResult = SCORM2004_CallSetValue("cmi.score.scaled", fltCalculatedScore) && blnResult;

    WriteToDebug("Returning " + blnResult);

    return blnResult;

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Help resources