Skip to main content
Known Participant
February 21, 2016
Question

cpAPIInterface Not Available

  • February 21, 2016
  • 1 reply
  • 883 views

I have used a stripped down version of the below javascript in a Captivate 8 project and it works.

In another project it does not work, it fails on window.cpAPIInterface and shows that  "No CPInterface"

What is the reason that the CPIInterface is not available and how can I resolve this issue.

alert("START");

if(window.cpAPIInterface)

{

alert("CPIInterface");

} else

{

alert ("NO CPIInterface")

}

var txtString = window.cpAPIInterface.getVariableValue("Text_Entry_Box_8");

alert("2");

alert(txtString.toString());

SCORM2004_RecordFillInInteraction('99110', txtString.toString(), true, 'strCorrectResponse', 'strDescription', 100, 10, '');

    This topic has been closed for replies.

    1 reply

    TLCMediaDesign
    Inspiring
    February 22, 2016

    That could depend on several things:

    SWF or HTML5?

    When and where are you running the script? JavaScript window or externally?

    Does it work locally but not in LMS?

    PYiatrouAuthor
    Known Participant
    February 22, 2016

    The code will need to cater for HTML 5 and SWF - I thought the whole point of CPAPIInterface was that it should cover both?

    Since the code is designed to populate a SCORMDriver call to LMS I've tested it primarily with SCORMCloud LMS. But I'll try it again locally.

    I've tested it with two captivate 8 projects and identical code works in one project with LMS and not in the other project.

    The code is being executed from Javascript Window.

    Any ideas on how to proceed would be much appreciated, since I've really been banging my head on this one.

    PYiatrouAuthor
    Known Participant
    February 22, 2016

    Small update I tested locally. Locally it shows that there is a CPAPIInterface but still does not reach alert 2.