Experienced authors (with appropriate HTML/CSS and JavaScript knowledge) can use Avendoo® API (application programming interface) for instructional material. Thus they can transfer certain parameters to a self created design.
The following table contains the appropriate command and the appropriate description:
Instructional material API
Command | Description |
---|---|
fn_getAPIVersion() | Shows the version number of the current API. By now this function transmits the value “2”.(Status: February 2023). |
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: |
fn_reload_page() | Loads the page new. |
fn_getUserLogin() | Transmits the login name.
Example of use: |
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: |
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.
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.
Befehl | Erklä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: |
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: |
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)
| Via these two function you can go to any page in another instructional material.
Caution: |
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.