The itemBody section is where the question text, interactions, buttons and feedback are defined. Questions, solutions, etc will vary hugely depending on the question being asked, but I have included some standard sections that tend to be used regularly.
Question Text
Question text displaying an equation using variables defined using Maxima in templateProcessing:
<div class="QTEXT"> <p>Solve the equation <m:math display="block"> <m:mrow> <m:mi>mLHS1</m:mi> <m:mo>=</m:mo> <m:mi>mRHS1</m:mi> </m:mrow> </m:math> giving your answer as an integer or as a fraction in its lowest terms. </p> </div>
Displaying Variables
Maths variable: <printedVariable identifier="mVar"/>
Integer: <printedVariable identifier="oQansVars" format="%.0f"/>
Number (to 2 decimal places – change the number before the f in the format attribute to change the number of decimal places): <printedVariable identifier="oQansVars" format="%.2f"/>
Interactions
Text/numerical entry interaction
<textEntryInteraction responseIdentifier="RESPONSE" expectedLength="2" />
Mathematical expression entry interaction
<customInteraction id="customInteraction1" ma:syntax="text/x-maxima" ma:printIdentifier="printMath" responseIdentifier="RESPONSE"/>
Show Hint button
<feedbackBlock showHide="show" identifier="askhint" outcomeIdentifier="ASKHINT"> <p> <endAttemptInteraction responseIdentifier="HINTREQUEST" title="Show Hint"/> </p> </feedbackBlock>
Show Solution button
<feedbackBlock showHide="show" identifier="asksolution" outcomeIdentifier="ASKSOLUTION"> <p> <endAttemptInteraction responseIdentifier="SOLREQUEST" title="Show Solution"/> </p> </feedbackBlock>
Feedback
Correct
<feedbackBlock outcomeIdentifier="FEEDBACK" identifier="RESPONSE-CORRECT" showHide="show"> <div>Correct</div> </feedbackBlock>
Incorrect
<feedbackBlock outcomeIdentifier="FEEDBACK" identifier="RESPONSE-INCORRECT" showHide="show"> <div>Incorrect, try again. <br /><br /> </div> </feedbackBlock>
No answer entered
<feedbackBlock outcomeIdentifier="FEEDBACK" identifier="RESPONSE-NULL" showHide="show"> <div>Please enter an answer<br /><br /></div> </feedbackBlock>
Hint
<feedbackBlock identifier="HINT" outcomeIdentifier="FEEDBACK" showHide="show"> <div>Solution goes here<br /><br /></div> </feedbackBlock>
Solution
<feedbackBlock identifier="SOLUTION" outcomeIdentifier="FEEDBACK" showHide="show"> <div>Solution goes here<br /><br /></div> </feedbackBlock>
MathML
I won’t cover MathML in any detail here, but the University of Edinburgh’s LaTeX to MathML converter is a very useful tool to help with this. This section contains a few tips for achieving some things that aren’t immediately obvious in MathML.
Greek Letters in MathML
These must be represented by the HTML decimal (e.g. Α) or hex codes (e.g. Α), not the HTML entity codes (e.g. Α). Here’s a full list of codes.
Operators in MathML
Times symbol: <m:mo>×</m:mo>
Space: <m:mi> </m:mi>