closedquestion-8.x-3.x-dev/closedquestion.templates.inc
closedquestion.templates.inc
<?php
/**
* @file
* Storage for our XML templates.
*/
/**
* Defines the actual XML templates.
*
* Stored in a separate file to avoid being processed on every page load.
*
* @see closedquestion_closedquestion_templates()
*/
function _closedquestion_closedquestion_templates() {
return array(
'cq_arrow' => array(
'name' => 'Arrow question',
'xml' => '<question type="arrow" linenumbering="yes" linestyle="curved" startarrow="no" endarrow="yes">
<text>
<p>Drag some arrows</p>
<ul class="help">
<li>Click and drag to draw an arrow from one hotspot (gray rectangle) to another</li>
<li>press Ctrl while drawing an arrow to flip it</li>
</ul>
</text>
<matchimg src="" maxchoices="2">
<hotspot id="a" shape="rect" coords="167,100,192,120">Hotspot A.</hotspot>
<hotspot id="b" shape="rect" coords="151,166,170,192">Hotspot B</hotspot>
<hotspot id="c" shape="rect" coords="132,227,100,201">Hotspot C</hotspot>
</matchimg>
<hint mintries="1">A first hint.</hint>
<hint mintries="2">A second hint.</hint>
<hint mintries="3">A third hint.</hint>
<mapping correct="1" stop="1">
<match pattern="^ab,bc$" />
<feedback>Correct!</feedback>
</mapping>
<mapping correct="0">
<match pattern="ba" hotspot="Enter text" />
<feedback>Not correct, try again.</feedback>
</mapping>
</question>',
),
'cq_multiple_choice' => array(
'name' => 'Multiple Choice',
'xml' => '<question type="OPTION">
<text>Put the question here</text>
<hint mintries="1">A first hint.</hint>
<hint mintries="2">A second hint.</hint>
<hint mintries="3">A third hint.</hint>
<option correct="0">
<choice>Option 1</choice>
<feedback>feedback for option 1</feedback>
</option>
<option correct="0">
<choice>Option 2</choice>
<feedback>feedback for option 2</feedback>
</option>
<option correct="1">
<choice>Option 3</choice>
<feedback>feedback for option 3</feedback>
</option>
<option correct="0">
<choice>Option 4</choice>
<feedback>feedback for option 4</feedback>
</option>
</question>',
),
'cq_multiple_answer' => array(
'name' => 'Multiple Answer with inline feedback',
'xml' => '<question type="check">
<text>Put the question here</text>
<prompt>Choose one or more options:</prompt>
<correct>Feedback if the student answers the question correctly.</correct>
<hint mintries="1">A first hint.</hint>
<hint mintries="2">A second hint.</hint>
<hint mintries="3">A third hint.</hint>
<option>
<choice>Option 1</choice>
<feedback>feedback for option 1</feedback>
</option>
<option correct="1">
<choice>Option 2</choice>
<feedback>feedback for option 2</feedback>
</option>
<option correct="1">
<choice>Option 3</choice>
<feedback>feedback for option 3</feedback>
</option>
<option>
<choice>Option 4</choice>
<feedback>feedback for option 4</feedback>
</option>
</question>'
),
'cq_multiple_answer_advanced_mapping' => array(
'name' => 'Multiple Answer, with advanced answer mapping',
'xml' => '<question type="check">
<text>Put the question here</text>
<prompt>Choose one or more options:</prompt>
<hint mintries="1">A first hint.</hint>
<hint mintries="2">A second hint.</hint>
<hint mintries="3">A third hint.</hint>
<option id="a">
<choice>Option 1</choice>
</option>
<option id="b">
<choice>Option 2</choice>
</option>
<option id="c">
<choice>Option 3</choice>
</option>
<option id="d">
<choice>Option 4</choice>
</option>
<mapping stop="1">
<feedback>You forgot to answer!</feedback>
<match pattern="^$"/>
</mapping>
<mapping correct="1">
<match pattern="^a$" />
<feedback>That is correct.</feedback>
</mapping>
</question>',
),
'cq_select_and_order' => array(
'name' => 'Select & Order',
'xml' => '<question type="selectorder" duplicates="0">
<text>Select and order the needed steps. This example question contains only one target box.</text>
<option id="a">
<choice>Step A.</choice>
</option>
<option id="b">
<choice>Step B.</choice>
</option>
<option id="c">
<choice>Step C.</choice>
</option>
<option id="d">
<choice>Step D.</choice>
</option>
<option id="e">
<choice>Step E.</choice>
</option>
<option id="f">
<choice>Step F.</choice>
</option>
<hint mintries="1">A first hint.</hint>
<hint mintries="2">A second hint.</hint>
<hint mintries="3">A third hint.</hint>
<mapping correct="1">
<match pattern="^bcd$" />
<feedback>Correct. You only need steps B, C and D.</feedback>
</mapping>
<mapping correct="0">
<match pattern="^.*bc.*$" />
<feedback>You can not do step C unless you first do step B.</feedback>
</mapping>
</question>',
),
'cq_select_and_order_multiple_targets' => array(
'name' => 'Select & Order, with multiple target boxes',
'xml' => '<question type="selectorder"><text>Select and order the needed steps. This example question contains two target boxes.</text><option id="a"><choice>Step A.</choice></option><option id="b"><choice>Step B.</choice></option><option id="c"><choice>Step C.</choice></option><option id="d"><choice>Step D.</choice></option><option id="e"><choice>Step E.</choice></option><option id="f"><choice>Step F.</choice></option><option id="1"><choice>Day 1</choice></option><option id="2"><choice>Day 2</choice></option><hint mintries="1">A first hint.</hint><hint mintries="2">A second hint.</hint><hint mintries="3">A third hint.</hint><mapping correct="1"><match pattern="^1bc2d$"/><feedback>Correct. You need to do steps B and C on day 1 and step D on day 2.</feedback></mapping><mapping correct="0"><feedback>You can not do step C unless you first do step B.</feedback><or><match pattern="^1.*cb.*2.*$"/><match pattern="^1.*2.*cb.*$"/></or></mapping></question>',
), 'cq_order' => array(
'name' => 'Order',
'xml' => '<question type="selectorder" duplicates="0" onlyorder="1">
<text>Order the needed steps.</text>
<option id="a">
<choice>Step A.</choice>
</option>
<option id="b">
<choice>Step B.</choice>
</option>
<option id="c">
<choice>Step C.</choice>
</option>
<option id="d">
<choice>Step D.</choice>
</option>
<option id="e">
<choice>Step E.</choice>
</option>
<option id="f">
<choice>Step F.</choice>
</option>
<hint mintries="1">A first hint.</hint>
<hint mintries="2">A second hint.</hint>
<hint mintries="3">A third hint.</hint>
<mapping correct="1">
<match pattern="^abcdef$" />
<feedback>Yes!</feedback>
</mapping>
<mapping correct="0">
<match pattern="^[^b]*c.*$" />
<feedback>You can not do step C unless you first do step B.</feedback>
</mapping>
</question>'),
'cq_hotspot' => array(
'name' => 'Hotspot',
'xml' => '<question type="hotspot">
<text><p>Point out the correct two items.</p></text>
<matchImg src="" maxChoices="2">
<hotspot id="A" shape="circle" coords="275,68,68">Hotspot A.</hotspot>
<hotspot id="B" shape="rect" coords="0,21,43,121"></hotspot>
<hotspot id="C" shape="poly" coords="174,282,258,293,320,318,366,360,267,468,207,438,149,443,99,465,85,486,7,416,7,354,64,307">Hotspot C.</hotspot>
</matchImg>
<hint mintries="1">A first hint.</hint>
<hint mintries="2">A second hint.</hint>
<hint mintries="3">A third hint.</hint>
<mapping correct="1">
<match hotspot="A" />
<match hotspot="B" />
<feedback>Very Good, you pointed out the correct two items</feedback>
</mapping>
<mapping correct="0">
<match hotspot="C" />
<feedback>You have pointed out an incorrect item.</feedback>
</mapping>
<mapping correct="0">
<not><match hotspot="A" /></not>
<feedback>You have not pointed out the first correct item.</feedback>
</mapping>
<mapping correct="0">
<not>
<or>
<match hotspot="A" />
<match hotspot="B" />
<match hotspot="C" />
</or>
</not>
<feedback mintries="1">You have not selected any item.</feedback>
</mapping>
</question>',
),
'cq_drag_and_drop' => array(
'name' => 'Drag & Drop',
'xml' => '<question type="dragdrop">
<text>Drag the items to the corresponding locations on the image.</text>
<matchImg src="">
<hotspot shape="rect" coords="2,91,119,124" id="h1" />
<hotspot shape="circle" coords="6,196,123" id="h2" />
<hotspot shape="poly" coords="6,268,6,301,153,301,123,208" id="h3" />
<draggable id="d1">Draggable 1</draggable>
<draggable id="d2">Draggable 2</draggable>
<draggable id="d3">Draggable 3</draggable>
</matchImg>
<startstate value="d1,46,10;d2,46,50;d3,46,90; "/>
<hint mintries="1">A first hint.</hint>
<hint mintries="2">A second hint.</hint>
<hint mintries="3">A third hint.</hint>
<mapping correct="1">
<combination hotspot="h1" draggable="d1" />
<combination hotspot="h2" draggable="d2" />
<combination hotspot="h3" draggable="d3" />
<feedback>Correct. You have put the items at the right locations.</feedback>
</mapping>
<mapping correct="0">
<combination hotspotpattern="h.*" draggablepattern="d[0-9]" />
<feedback>You have at least one draggable on one hotspot.</feedback>
</mapping>
<mapping correct="0">
<combination hotspot="h1" draggablepattern="d[0-9]" />
<feedback>You have at least one draggable on hotspot 1.</feedback>
</mapping>
<mapping correct="0">
<combination hotspotpattern="h.*" draggable="d1" />
<feedback>You have draggable 1 on a hotspot.</feedback>
</mapping>
</question>',
),
'cq_fill_in_the_blanks_textfield' => array(
'name' => 'Fill in the blanks: text field',
'xml' => '<question type="fillblanks">
<text><p>You have measured a concentration of 10 g/l in a 10-times diluted sample.<br/>
What was the concentration in the non-diluted solution?</p>
<p><b>The original concentration was: <inlineChoice id="c" freeform="1" />g/l</b></p></text>
<hint mintries="1">A first hint.</hint>
<hint mintries="2">A second hint.</hint>
<hint mintries="3">A third hint.</hint>
<mapping correct="1">
<range inlineChoice="c" minval="100" maxval="100" />
<feedback>Very good!</feedback>
</mapping>
<mapping correct="0" stop="1">
<not><match inlineChoice="c" pattern="^[+-]?[0-9]+([,.][0-9]+)?([eE][+-]?[0-9]+)?$" /></not>
<feedback>Please give a number.</feedback>
</mapping>
<mapping correct="0" stop="1">
<match inlineChoice="c" pattern="^\d*\,\d*$" />
<feedback>Use a . as decimal separator instead of a comma.</feedback>
</mapping>
</question>',
),
'cq_fill_in_the_blanks_options' => array(
'name' => 'Fill in the blanks: options',
'xml' => '<question type="fillblanks">
<text>
<p>Fill the gaps:</p>
<p>First you should do <inlinechoice id="a" freeform="0"/>,
then <inlinechoice id="b" freeform="0"/>.</p>
</text>
<hint mintries="1">A first hint.</hint>
<hint mintries="2">A second hint.</hint>
<hint mintries="3">A third hint.</hint>
<mapping correct="1">
<feedback>Very good!</feedback>
<and>
<match inlinechoice="a" inlineoption="a"/>
<match inlinechoice="b" inlineoption="b"/>
</and>
</mapping>
<mapping correct="0" stop="1">
<feedback>Fill in all the gaps!</feedback>
<or>
<match inlinechoice="a" inlineoption="x"/>
<match inlinechoice="b" inlineoption="x"/>
</or>
</mapping>
<inlineoption id="x">...</inlineoption>
<inlineoption id="a">Option A</inlineoption>
<inlineoption id="b">Option B</inlineoption>
<inlineoption id="c">Option C</inlineoption>
</question>',
),
'cq_fill_in_the_blanks_math' => array(
'name' => 'Fill in the Blanks with math',
'xml' => '<question type="fillblanks">
<matheval e="a=random()" store="1" />
<matheval e="b=random()" store="1" />
<matheval e="a=round(a*0.8+0.11,2)" />
<matheval e="b=round(b*5+2,0)" />
<matheval e="ans=a*b" />
<matheval e="min=ans-0.01" />
<matheval e="max=ans+0.01" />
<text><p>You have measured a concentration of <mathresult e="a" />mg/ml in a <mathresult e="b" />-times diluted sample.<br/>
What was the concentration in the non-diluted solution?</p>
<p><b>The original concentration was: <inlineChoice id="c" freeform="1" />g/l</b></p></text>
<hint mintries="1">A first hint.</hint>
<hint mintries="2">A second hint.</hint>
<hint mintries="3">A third hint.</hint>
<mapping correct="1">
<range inlineChoice="c" minval="min" maxval="max" />
<feedback>Very good. The difference between your answer and the "real" answer is: <mathresult e="abs(ans-c)" /></feedback>
</mapping>
<mapping correct="0" stop="1">
<not><match inlineChoice="c" pattern="^[+-]?[0-9]+([,.][0-9]+)?([eE][+-]?[0-9]+)?$" /></not>
<feedback>Please give a number.</feedback>
</mapping>
</question>',
),
);
}
