Custom quiz scoring in Adobe Captivate

Custom quiz scoring in Adobe Captivate

Adobe Captivate 9 has a selection of built-in quiz processes that are designed to cover the majority of scenarios. Multiple choice, true/false, blank fill, matching and a few other types are supported.

Incorporating quizzes is always a bit of a struggle, not only in developing good quiz concepts, but in developing user feedback, structuring the user journey through the course given the results, scoring strategies, and ensuring that any reporting functions to the LMS capture the right information and can be easily searched and interpreted.

Adobe can only anticipate a limited range of cases to be modeled in the Captivate user interface as, after a point the UI becomes unworkable. As designers delve into more unique user experiences, the only practical strategy is to dive “behind the scenes” and develop JavaScript-controlled user interactions. This is a very rich area for creativity, as through JavaScript, pretty much any user interaction can be developed, but is hampered by the fact that Adobe provides no documentation on the very extensive quiz control library that is loaded as part of the course player. With work, it is possible to gain an understanding of this very rich set of tools, and with that comes the ability to circumvent the limitations of the Captivate UI in creating unique experiences.

Here, we will show how to override the internal scoring process. This has been tested on multiple choice quizzes so far, but the concepts may be applicable to the other quiz types. The function that we will show will enable you to assign any point value to the users answers. There need not be a single “right” answer. Scores can also be based on other real-time parameters, such as how many times the user has taken the quiz, and how long they have taken to submit. Scores are reported to the LMS through Captivate, no special communication is needed.

The following information is targeted to folks with a relatively good background in JavaScript.

Where to put the JavaScript?

We use an external file to incorporate all JavaScript in our applications. It is far easier to manage and to make changes in near-real time. To do this, we use the “Execute Javascript at On Enter” function with the following small script to the first page of captivate presentation:

$(‘body’).append(‘<script src=”/<path to file>/myscript.js” async=”false”></script>’);

This path is from the root of the webserver and in our case, we don’t include the “http://url/…” to make this work wherever the course module is loaded

Taking over the scoring function

We will skip the majority of the gory details of how Captivate structures the quiz data and all the functions needed to manage the interaction. For the purpose of getting to the heart of the matter, you only need to know the following:

  1. Quiz pages have an “ID” that is needed to find the quiz data. The IDs all start with “Slidexxxxx” To get this ID, the easiest is to just find it using jQuery:
var slideID = $('[id^=Slide]').attr("id");

2. The quiz data is easily accessed using the following Captivate function:

var quizObject = cp.getQuestionObject(slideID);

The quizObject is very rich. It not only contains all of the quiz data, but also all of the functions necessary to manage this data. There is one critical function that, after everything, decides on what score to give a question. A question is scored regardless of whether the answer is “right or wrong” so this function is always called.


It is not necessary to know anything about the rest of the Captivate code, only that the value returned by this function will be captured as the score for a quiz question. By “overloading” this function, we can create an arbitrary function that determines score based on any information we wish. The following provides an example of how to overload this function, and information on the most likely variables one would use to create a custom scoring function:

// save a reference to the original function
saveGetScore = quizObject.__proto__.getQuestionScoredPoints

//overload the function
quizObject.__proto__.getQuestionScoredPoints = function () {

console.log('---- question Info -----');
console.log("question interaction id:" + this.questionData.iid);
console.log("answered correctly:" + this.getAnsweredCorrectly());
console.log("correct answer:" + this.getCorrectAnswerAsString());
console.log("chosen answer:" + this.getChosenAnswerAsString());
console.log("current attempt:" + this.currentAttempt);
console.log("number of attempts:" + this.numberOfAttempts);
console.log("end Time:" + this.endTime);
console.log("start Time:" + this.startTime);

// the question text
console.log("question text:" + this.questionData.qt);

//some internal ID information
console.log("question number:" + this.questionData.qnq);
console.log("slide number:" + this.m_slideIndex);
console.log("question object name:" + this.questionObjName);
console.log("answergroup:" + this.questionObjName);

// a returned score
return 100;


A typical output from this, after submitting a quiz question looks like:

---- question Info -----
question interaction id:10686
answered correctly:true
correct answer:B
chosen answer:B
current attempt:1
number of attempts:1

end Time:Sat Feb 25 2017 12:03:29 GMT-0500 (Eastern Standard Time)
start Time:Sat Feb 25 2017 12:03:20 GMT-0500 (Eastern Standard Time)

question text:Choose which is the right answer

question number:0
slide number:0
question object name:Slide10662q0


A complete example

The “interaction ID” shows up on the Captivate quiz tab when you are making the quiz page and can be set to a convenient value if you want. With the variables listed above, it is possible to develop a wide range of scoring systems. The following shows the code for a complete partial credit scored question assuming there are five possible answers. ‘C’ is the best at 5 points, ‘A’ and ‘E’ are the worst at 1 point:

var slideID =   $('[id^=Slide]').attr("id");
var quizObject = cp.getQuestionObject(slideID);
var saveGetScore = quizObject.__proto__.getQuestionScoredPoints;

quizObject.__proto__.getQuestionScoredPoints = function () {

var iid = this.questionData.iid;

if ( iid != "10686" ) {
// call the regular scoring function if not this question

var chosen = this.getChosenAnswerAsString());
var score = 0
if (chosen == "A") { score = 1;}
if (chosen == "B") { score = 2;}
if (chosen == "C") { score = 5;}
if (chosen == "D") { score = 3;}
if (chosen == "E") { score = 1;}

return score;

From here, all kinds of interesting scoring techniques can be devised!

Although the Captivate code base is not for the feint-hearted, with some work, we can use this base to create all kinds of interesting interactions!

4 Criteria For Testing Your Online Corporate Training

So you’ve built your corporate training courses and are ready to launch them. But before you go live, there’s still one very important step left: The testing process. This is one of the most important -and often neglected- steps to make the online corporate training experience a success.

This post was first published on eLearning Industry.

10 Criteria For Choosing The Best Rapid eLearning Authoring Tools

Rapid eLearning Authoring Tools give you the ability to design amazing eLearning content quickly and cost-effectively. But how do you find the software that's a perfect fit for your corporate eLearning initiatives? In this article, I'll highlight the 10 criteria for selecting the ideal rapid eLearning authoring tool for your organization.

This post was first published on eLearning Industry.

Wurman’s 5 Rules Of Information Communication

Richard Saul Wurman has some great wisdom to impart about effectively communicating large amounts of information visually. He offers 5 simple rules for more effectively communicating information in any form.

This post was first published on eLearning Industry.

Adapt Learning Review: Create Responsive, Multi-Device Courses

This is a review of an eLearning authoring tool I have been using in the past year; Adapt Learning. It creates responsive multi-devices courses that can be integrated into a Learning Management System.

This post was first published on eLearning Industry.

4 Tips To Help You Complete Online Assignments On Time

Most of the people who study online have other demanding commitments. As a result, online assignments can pile up and become overwhelming. These tips will help you avoid missing assignment due dates and ensure your online assignments are submitted early.

This post was first published on eLearning Industry.

Linking to specific areas in PDFs from Captivate 9

When developing a series of continuing education quizzes I needed to take learners to specific sections within guidelines to allow them to dig deeper into topical areas and as remediation. Some of the challenges with this project Were: 1) learners needed to view the official guidelines; 2)  guidelines are updated on a regular basis and posted online as PDFs; 3) the education committee wanted the learner to be taken directly to the narrative, chart, table or graphic associated with the question answer or distractor.

There are a number of wonderful tutorials available on the internet for answer level feedback so I will not address the process here. The following instructions step through how to prepare pdf documents and then add destination links to questions  and/or external link areas on other slides.

Annotating PDFs

There is no way to specify a URL to a bookmark within a PDF. Such as, destinations will have to be created within the documents for each area identified in item 2 above. The destinations will take learners directly to information associated with guideline questions. The following instructions step through the process of creating anchors inside a PDF from a link by using what is called “Named Destinations”.ap1

  1. Open the PDF in Adobe Acrobat professional 8-11 or DC.
  2. Go to View >> Navigation Tabs >> Destinations (Adobe Acrobat 8, 9, or 10), or View >>Show/Hide >> Navigation Panes >> Destination (Adobe Acrobat 11 or DC)
  3. Manually navigate through the PDF for the first desired passage, and then go to Tools >> Edit Text & Images.
  4. Click to the left of the first passage, and then click on the Destinations icon. An untitled link will be created.


  1. Double-click on the untitled link in the Destinations list and name the area. (It is suggested that short simple names be used)
  2. Document destination name..
  3. Repeat steps 1-6 until all feedback areas have been identified.
  4. Save and then close the PDF document.

Save the document to the project folder.

Adding Destination Links to Slides

Links to specific topical areas within PDFs can be accomplished in two ways:

  • Accessing a PDF by a specific page number by using:
  • Accessing a PDF by a destination identifier by using:

To add destination of page links to slides:

  1. Select the text that will receive the destination or page link.
  2. Click on the link icon in the Properties window. The Link To popup window will be displayed.
  3. Assure that Web Page is selected in the type field.
  4. Paste the URL with the destination identifier associated with the question in the Location field.
  5. Click on the drop-down arrow to the right of the Location field and select New. This selection will open the PDF in a new browser window.
  6. Click the [OK] button to save the entries.
  7. Repeat steps 1-6 for each link area in project.