Question widgets should implement the following functions in addition to the functions discussed in this topic.

getWidgetQuestionState()

This method is called when the user clicks Submit on the question slide. The method provides the widget with an option to restore its state when the quiz is restored in an LMS. This function should return a non-empty string in a way that it can restore its state when the widget is reloaded.

setWidgetQuestionState()

Restores the widget to its previous state. setWidgetQuestionState() is called when the widget is reloaded in the LMS.

function getWidgetQuestionState() { trace("get Widget Question State"); return "<var1>"+var1+"</var1><var2>"+var2+"</var2>" //Should be a non- empty String.Should not contain _ and ; } function setWidgetQuestionState( val:String) { trace("set Widget Question State()" + val ); }

For example, let us consider that the state of the variables is var1=10, var2="Captivate" when Submit is pressed and the function is called. Open the Adobe Captivate quiz in LMS, attempt the question, and press Submit. The getWidgetQuestionState function is called. Re-open the quiz in LMS. When the widget question is shown, function setWidgetQuestion is called with the same string: "<var1>10</var1><var2>Captivate</var2>"

answers()

Displays the review feedback. The function returns an array of Objects() with the following properties.

answerID

A unique ID for every answer.

chosenAnswer

String representing the answer chosen by the learner.

correctAnswer

String representing the correct answer.

For example,

function answers():Array { var answers:Array = new Array(); var ans : Object = new Object(); var ans2 :Object = new Object(); ans.answerID = "10"; ans.chosenAnswer = "Hi..Hi..."; ans.correctAnswer = "Hello...Hello..."; answers["firstanswer"]= ans; ans2.answerID = "12"; ans2.chosenAnswer = "Hi2..Hi2..."; ans2.correctAnswer = "Hello2...Hello2..."; answers["first2answer"]= ans2; return answers; }

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy