Interactive Exercise Tasks

The following tasks will be covered:

Add a static exercise

This tasks explains how to create a static exercise and see it.

Prerequisite:

Task steps

  • first insert the exercise header and metadata
    • type “<” then “e”, “x”, “e”, “r”, “c” then press return
    • add the id attribute as requested, e.g. mini-exercise
    • set the for attribute to the reference to a concept. If directly from the task create-a-collection, simply use hello-world
    • press return to finalize this tag
    • maybe right-away add the closing element: press return to go down one line, then press “<” and “/” which should input you the closing element. Saving is a good idea at this point.
    • inside the exercise element, add “<”, “m”, “e”, press space then “>”, then add a Title element (same procedure), then input a title, say A mini exercise.
    • close Title and metadata
  • we should now have reached something such as

      <exercise id="mini-exercise" for="hello-world">
        <metadata><Title>Mini-exercise</Title>
        </metadata>
    
    
      </exercise>
    
  • now go below metadata and add <CMP> followed by the exercise invitation, that is, the text that is presented to learners to invite them to start the first interactive exercise

    • inside CMP, type something such as Let us start a minimum exercise.
    • close the CMP
  • open the Ant Farm tab

  • select the build-file of your collection (by the name you gave when creating a collection)
  • double click it and throw a short look in the console pane that just opened below the editing pane
  • wait till it shows BUILD SUCCESSFUL
  • open the ActiveMath main menu with your browser (at http://localhost:8080/ActiveMath2/ typically)
  • open the book bearing your collection name
  • you should see the exercise with the given title and no Start the exercise message below it

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

Task: download eXtasy source and insert into own collection

This tasks explains how to download an extasy exercise into one’s own collection.

Prerequisite:

  • create-collection
  • usage of eXtasy exercise authoring tool
  • applications-on: jEditOQMath, ActiveMath, web-browser

Task steps

  • in the first eXtasy window, having chosen a collection, it is possible to preview or source items of the collection. Choose the exercise you wish then request source
  • the OMDoc file is now downloaded to your browser… depending on your browser, you will get either a very little amount of text (typical of Safari), or an XML display which looks like a source (typical of Mozilla). Do not copy this.
  • either save this file (FIle > Save As…) or View the source and copy this
  • save the content inside your collection, within the oqmath directory, under a file-name which ends with .oqmath
  • open this file in jEditOQMath. Typically it looks fairly ugly because it has neither marks of being XML nor a clean indenting
  • invoke the command OQMath > Clean-up-OMDoc, save the file (File > Save), close-it and re-open it
  • you should now get a file editted in XML-mode and validation should run automatically
  • in the status bar, you should now see XML parsing complete, 0 error(s).. Should that number be non-null, please try to fix the errors
  • now open the Ant Farm tab on the left, locate the the build-file of the collection where you saved your file (e.g. My collection), select it, and press the running man to start it
  • if all goes well, you should obtain zero errors and the exercise should appear within a new page of the automatic-recorded-book

A more experimental way, for those who intend to edit this file further in jEditOQMath, is to use OQMath > OMDoc2 OQMath which will convert all formulæ to QMath using the notations of this collection.