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:
Command | Explanation |
---|---|
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 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
| The variable contains the maximum achievable points in the knowledge test. |
var sequenceReached
| 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:
Note: On the tab “final page” of the knowledge test the range have to be inserted. |
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:
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:
Examples: 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); |