Avendoo® online documentation

Avendoo® API

Knowledge test final pages

Experienced authors (with appropriate HTML/CSS and JavaScript knowledge) can access on Avendoo® API (application programming interface) for the final page of a knowledge test.

The following table contains the appropriate command and the respective explanation:

CommandExplanation

window.top.

If the content of the knowledge test final page is embedded via IFrame, this information has to be set before each function for accessing from the IFrame to the function in the Avendoo-API.

var login

The variable contains the user name of the user.

var sequencePassed

The variable contains the information, if the user has passed the knowledge test.

true = Passed
false = Not Passed

Note: The element “summary” has to be inserted.

var sequencePoints

The variable contains the points, which are required for passing the knowledge test.

var sequencePossible
Points

The variable contains the maximum achievable points in the knowledge test.

var sequenceReached
Points

The variable contains the achieved points of the user in the knowledge test.

fn_getPerformanceBarData()

With this function an object “performanceBarData” will be generated and transferred as JSON String. The object has the following attributes:

  • performanceBarData.reachedPoints = Actual achieved total points of the user in the knowledge test
  • performanceBarData.maxPoints = Maximum achievable totla points in the knowledge test
  • performanceBarData.minPoint = Passing grade of the knowledge test
  • performanceBarData.userAverage = Average total points of all users’ results
  • performanceBarData.numberOfResults = number of the knowledge tests attempts, on which the test was completed
  • performanceBarData.stdReachedPoints = Standard deviation of the achieved total points
  • performanceBarData.averageMaxPoints = Arithmetic average of the maximum points of all questions (relevant for knowledge tests with random question selection)
  • performanceBarData.stdMaxPoints = Standard deviation for maximum points of all questions (relevant for knowledge test with random question selection)

Note:

On the tab “final page” of the knowledge test the range have to be inserted.
Example:
Successively the JSON object will be generated and then the attribute “numberOfResults” will be shown as alert meassage:
obj = JSON.parse(fn_getPerformanceBarData());
alert(obj.numberOfResults);

fn_getQuestionDetailData()

With this function an Array questionDetailData will be generated and transfered as JSON String. Per question of the knowledge test an object is generated.

Each single object contains the following attributes:

  • question.questionId = ID of the question in Avendoo® (z.B. 1361346442146_1)
  • question.averageReachedPoints = Average of the achieved points of each question by the previous participants
  • question.standardDeviationReachedPoints = Standard deviation of the achieved points of each question by previous participants
  • question.maxPoints = maximum achievable points of a question
  • question.reachedPoints = Actual achieved points of the user of a question
  • question.position = Position of question in the knowledge test
  • question.type = Question type
  • question.title = Title of a question

An object can be generated with obj = JSON.parse(fn_ getQuestionDetailData); and then it can be accessed with obj[0].questionId and so on to single attributes of the questions.

Note:

  • On the tab “final page“ you have to choose another item than “No details” at “Display of the details”. Otherwise this data won’t be written.
  • The positions in the Array will be counted from “0” and be written in square brackets.
  • On the tab “final page” you have to choose another item than “No details” at “Display of the details”. Otherwise this data won’t be written.

Examples:
Successively the JSON object will be generated and then the attribute title for the first question in the knowledge test will be shown as alert message:

Var player = GetPlayer();
 obj = JSON.parse(window.top.fn_getQuestionDetailData());
player.SetVar("as2_title_frage1",obj[0].title);

The next example shows the achieved points of the user for the second question in the knowledge test:

Var player = GetPlayer();
obj = JSON.parse(window.top.fn_getQuestionDetailData());
player.SetVar("as2_reachedPoints_frage2",obj[1].reachedPoints);