The CBA ItemBuilder provides Finite-State Machine operators to create user-defined Calculators.
But what if you need a special (school-style) calculator type?
ExternalPageFrames
and Embedded HTML ExplorerExample of custom HTML5/JavaScript-calculator
Resources embedded in Embedded HTML Explorer
Content integrated via ExternalPageFrames
can also be embedded into pages or displayed in dialogs.
Create and Integrate
ExternalPageFrame
Connect
Folder Structure for Embedded Resources:
Using the Embedded HTML Explorer to edit or change content requires basic knowledge about HTML and JavaScript. An example file is provided for Developers.
However, importing existent content wit the Embedded HTML Explorer and using ExternalPageFrames
in the Page Editor is rather simple.
Default
example.html
Editor
Note that the Embedded HTML Explorer fails to show very long text lines (e.g., when embedding large base64-encoded resources)!
Set Page Address
in context menu of ExternalPageFrames
External content with ExternalPageFrames
requires that the linked content is available online when the assessments are administered and that an online connection exists (i.e., no offline delivery).
All files and dependencies required at runtime (i.e., an HTML entry page and all resources, libraries, CSS, and JavaScript files) must be integrated into the Project File for local use.
How to Integrated Files and Folders?
HTML5/JavaScript content is added1 using the Embedded HTML Explorer’s context menu
If references to URLs (i.e., links starting with http
or https
) remain in embedded resources, a) pure offline delivery is not possible, and b) potential privacy issues may arise.
Embedded HTML-Content is…
ExternalPageFrames
(= iframe
).zip
files like other resources)Embedded HTML-Content can…
Embedded HTML-Content needs to respond in particular way to…
getState()
/setState()
)Examples
Click Trace Log-Event
and check the Trace Debug Window.
Click the buttons Set V_*
to change values of FSM-variables.
Values of FSM-variables can also be set from JavaScript.
The button `Trigger FSM-Event” executes a FSM-rule triggered by a JavaScript-event.
External Page Frames can be used for various purposes, including the computation of FSM variables using JavaScript functions.
Data provided to Embedded HTML Content will get lost on page changes. To make data persistent and to store data entered to ExternalPageFrames
, the getState()
and setState()
-methods need to be implemented.
ExternalPageFrames
to the item with the getState()
-method.setState()
.getState()
and setState()
are called automatically by the CBA ItemBuilder (i.e., a JavaScript developer only needs to implement the endpoints within the content developed for ExternalPageFrames
).Embedded HTML Content can provide variables that can be used for Scoring. If the HTML5/JavaScript content implements the interface1, variables can be automatically extracted.
ExternalPageFrame
.Import External Variables
to add Variables.FSM-Rules
Helpful to remember
Cross-browser testing: If ExternalPageFrames
are used, item authors need to perform cross-browser tests to ensure the content works in the targeted browser.
Availability of content: Keep in mind that content used in ExternalPageFrames
is either completely embedded or available at runtime.
Consider to share content created for ExternalPageFrames
!