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: September 2015).

fn_getActualPageNumber()

Shows, on which page you actual are. page 1 = a, page 2 = b, subpage 1 of page 2 = ba 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:
An 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.

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 character, beginning with an “a”. For each indention to each character is added a further character, beginning with an “a”.
Thus the first sub page of the first page has the value “aa”. The fourth sub page of the third page has the value “cd” 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)

Mithilfe dieser beiden Funktionen kann auf eine beliebige Seite in einem anderen Lehrmittel gesprungen werden.

Achtung:
Damit zu einem anderen Lehrmittel gesprungen werden kann, müssen sich beide Lehrmittel auf demselben Lernpfad befinden.

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.