Avendoo® online documentation

Instructional material API

CommandDescription

fn_getAPIVersion()

Shows the version number of the current API. By now this function transmits the value “2”.(Status: May 2022).

fn_getActualPageNumber()

Shows, on which page you actual are. page 1 = 0001, page 2 = 0002, subpage 1 of page 2 = 0002, 0001 etc.

fn_setAllPagesRead()

Set all pages of instructional material to “visited”. Then the instructional material is valued as “Completed” on the learning path. The learner is automatically on the last page of instructional material.

Note:
The changes in an instructional material are first seen on the next opening or after a new loading of the instructional material.
See also „fn_reload_page()“.

fn_reload_page()

Loads the page new.

fn_getUserLogin()

Transmits the login name.

Example of use:
A user should be welcomed with his/her name.
API Code

fn_getUserLanguage()

Transmits the language, which is provided for the learner, via a country code.
The country codes are in accordance with ISO 639-1.

Note:
The language, which is provided for the learner, is often not in accordance with the language, in which the learner has been processed the instructional material.

fn_isPageVisited()

Transmits the value “true” or “false”, depending on if the a page was already seen (true) or not (false).

fn_getVisitedPages()

This function delivers an array with all pages, which the learner has already seen.

fn_getTutorialId()

Transmits the ID, with which each instructional material is numbered.

fn_getAssignmentId()

Transmits the ID, with which each course activation is numbered.

fn_getPageId()

Transmits the ID, with which each page of instructional material is numbered.

fn_setData()

Sets the data for all JavaScript variants with text, even false-true-values.
Example:
fn_setData(“objectType”, 4): “objectType” could be”question 1″ sein.

fn_getData()

Reads the saved data for all JavaScript variants with text.Liest die
Example:
fn_setData(“objectType”, 4);
fn_setData(“objectType”, fn_getData(“objectType”) + 6);
fn_getData(“objectType”); => 10

The tutorial-assigment and the page ID are unique 13-digit numbers and look like “1437638469552_1”. Two different instructional materials, course activations or pages of instructional materials have never the same ID.

Important

There isn’t a limitation of 26 pages in the tutorial assistant anymore since 17.27.

Onboard navigation in the instructional material

Command
Description

fn_opencloseMenu()

Shows or hides the menu for navigation by the instructional material.

fn_closeMenu()

Hides the menu for navigation by the instructional material.

fn_left()

Opens the previous page.

fn_up()

If it is an indented page the function opens the page, which is one level higher.

fn_right()

Opens the next page.

These functions allow the author to create an individual navigation within the instructional materials by reproducing the functionality of the onboard navigation of Avendoo®.

Example of use:

The navigation should be within the instructional material via individual buttons. Thus the menu bar of the instructional material is hidden by default and is shown only if applicable.

Navigation

Functions to go to other pages of instructional material

BefehlErklärung

fn_getPages()

This function detects an Array, in which each page of instructional material is assigned to a number, beginning with “0001”. For each indention to each number is added a further number, beginning with an “0001”.
Thus the first sub page of the first page has the value “0001, 0001”. The fourth sub page of the third page has the value “0003, 0004” and so on.

Note:
Because there is added a value to each page, this function is ideal in combination with the method “lenghth” to count all pages of an instructional material.
fn_getPages().length – 1 transmits the total number of pages of an instructional material.

fn_openPageByMenuPosition(position)

With the function fn_openPageByMenuPosition(position) you can go to any page of an instructional material. Thus you insert for
position“ simply the matching character code of the appropriate page of instructional material. (See fn_getPages()).

Example of use:
You want to go to the second sub page of the fourth page:

API Code 3

fn_openPageByPageId(pageId)

This function is similar to the function „fn_openPageByMenuPosition(position)“. But the position is not defined as characters but as page ID (see fn_getPage/a>).

fn_switch2otherTutorial(tutorialId,pageId)
fn_switch2originalTutorial(tutorialId,pageId)

Via these two function you can go to any page in another instructional material.

Caution:
For going to another instructional material, both instructional materials have to be on the same learning path.

By requesting a certain page within or outside an instructional material Avendoo® supports the author in many ways. If you click on “Link instructional material” in the editor, a link to the favored page of instructional material is created. You can copy, change and reuse the created link in the source code.