Creating an mini-interactive-exercise in jEditOQMath and seeing it
This tasks explains how to create a trivial interactive exercise in source form and see it in the exercise system.
Prerequisite:
Task steps
- we continue where the task add a static exercise stopped, namely, while editing the exercise of id
mini-exercise inside the file first.oqmath
- put the cursor below the
CMP element but before </exercise>
- now we add a first
interaction element
- type
<, i, n, then space, then add the id attribute, e.g. id="mini-entry", then type >
- then input
feedback with a CMP element in a next line: <feedback><CMP>
- inside there, we add the first presented text, for example,
The exercise will just ask for a number to be input in the box:
- at this point we add a formula with an id by providing an input such as
$id("numberInput",x)$ which just puts the term with the sole term made by the variable x along with an id for it
- close
CMP and feedback elements (type twice < followed by /)
- save and fix any errors appearing in the error console tab on the top of the window
we now declare that the variable x should be an input-zone by adding, after the feedback element, the interaction_map that indicates that this id should be replaced by a blank: <interaction_map> <blank for="numberInput"/> </interaction_map>
- for such an input to be processed we must now sort on possible answers by the addition of an answermap_ which will branch to the possible interactions.
- start an
answer_map element
- add a
default child of it pointing to an interaction that is still to be made, for example, type <default xref="mini-exo-always-finishes">
- inside this answer map entry, that catches all possibilities, add a
diagnosis indicating the score thus performed: <diagnosis><achievement value="1.0"/>
- close
default and answer_map elements
now create the final interaction, for example with the following code to be put after the answer_map.
<interaction id="mini-exo-always-finishes">
<feedback><CMP>Fantastic, we're already through.</CMP></feedback>
</interaction>
save and correct any validation errors
open the Ant Farm tab on the left of jEditOQMath, select the build file of the collection you are running, click the running man, and wait that “BUILD SUCCESSFUL” appears in the console below
- navigate with your browser to the book of your collection then to the exericise on bottom of first page. You may need to reload the browser window.
- a link Start the exercise should appear
- click it see the exercise and the input field
- input a value (actually anything) then submit
- see the message You can now close your window
Beyond this Task
Trackback URL for this post:http://eds.activemath.org/de/trackback/159
|