Forum Discussion

ScottMcGee-daa8's avatar
ScottMcGee-daa8
Community Member
7 months ago
Solved

CMI5 Course Pass/Fail & Complete/Incomplete

Hi, Our LMS team after nearly a year, finally understood the issue I'm having.  Unlike Scorm cloud where I test, we discovered that unlike scorm cloud "Complete when all units are Complete and ...
  • ScottMcGee-daa8's avatar
    7 months ago

    After several hours and forums I figured it out. Someone else wrote this so can't take credit, but hopefully anyone searching for this via CMI5 will find that this works (In my LMS it does).

    Pass/Complete

    //Get LMS API
    function findLMSAPI(win) {
    if (win.hasOwnProperty("GetStudentID")) return win;
    else if (win.parent == win) return null;
    else return findLMSAPI(win.parent);
    }

    var lmsAPI = findLMSAPI(this);

    //Set Completed status
    lmsAPI.SetReachedEnd();
    //Set Passed status
    lmsAPI.SetPassed();


    Failed/Incomplete

    //Get LMS API
    function findLMSAPI(win) {
    if (win.hasOwnProperty("GetStudentID")) return win;
    else if (win.parent == win) return null;
    else return findLMSAPI(win.parent);
    }

    var lmsAPI = findLMSAPI(this);

    //Set Completed status
    lmsAPI.ResetStatus();
    //Set Passed status
    lmsAPI.SetFailed();