Skip to content

Instantly share code, notes, and snippets.

@nadavkav
Created January 23, 2022 20:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nadavkav/bb04e7e76a0d207f9970148fa184f7c7 to your computer and use it in GitHub Desktop.
Save nadavkav/bb04e7e76a0d207f9970148fa184f7c7 to your computer and use it in GitHub Desktop.
Moodle formulas question (a test case for inconsistency verifying student answer)
<?xml version="1.0" encoding="UTF-8"?>
<quiz>
<!-- question: 3039285 -->
<question type="formulas">
<name>
<text>random validation error test case</text>
</name>
<questiontext format="html">
<text><![CDATA[<b>Please use normal decimal syntax:</b><br><br>{#A}<br><br>{#B}<br><br>{#C}<br><br>{#D}<br>]]></text>
</questiontext>
<generalfeedback format="html">
<text></text>
</generalfeedback>
<defaultgrade>4</defaultgrade>
<penalty>0.3333333</penalty>
<hidden>0</hidden>
<idnumber>495963</idnumber>
<correctfeedback format="html">
<text>תשובתך נכונה.</text>
</correctfeedback>
<partiallycorrectfeedback format="html">
<text>תשובתך נכונה חלקית.</text>
</partiallycorrectfeedback>
<incorrectfeedback format="html">
<text>תשובתכם אינה נכונה</text>
</incorrectfeedback>
<shownumcorrect/>
<varsrandom><text>a3={1:8:0.01};
b3={1:7};
a1={1:8:0.01};
b1={1:7};
a2={1:8:0.01};
b2={1:7};
a4={1:8:0.01};
b4={1:7};</text>
</varsrandom>
<varsglobal><text>c1=a1*pow(10,-b1);
c2=a2*pow(10,-b2);
c4=a4*pow(10,-b4);</text>
</varsglobal>
<answernumbering><text>none</text>
</answernumbering>
<answers>
<partindex>
<text>0</text>
</partindex>
<placeholder>
<text>#A</text>
</placeholder>
<answermark>
<text>1</text>
</answermark>
<answertype>
<text>10</text>
</answertype>
<numbox>
<text>1</text>
</numbox>
<vars1>
<text></text>
</vars1>
<answer>
<text>[c1]</text>
</answer>
<vars2>
<text></text>
</vars2>
<correctness>
<text>_err == 0</text>
</correctness>
<unitpenalty>
<text>0</text>
</unitpenalty>
<postunit>
<text></text>
</postunit>
<ruleid>
<text>1</text>
</ruleid>
<otherrule>
<text></text>
</otherrule>
<autocomplete>
<text>0</text>
</autocomplete>
<subqtext format="html">
<text><![CDATA[<p style="direction: ltr;">{a1}•10<sup>-{b1}</sup>=&nbsp; {_0}&nbsp; &nbsp; &nbsp;&nbsp;</p>]]></text>
</subqtext>
<feedback format="html">
<text></text>
</feedback>
<correctfeedback format="html">
<text></text>
</correctfeedback>
<partiallycorrectfeedback format="html">
<text></text>
</partiallycorrectfeedback>
<incorrectfeedback format="html">
<text></text>
</incorrectfeedback>
</answers>
<answers>
<partindex>
<text>1</text>
</partindex>
<placeholder>
<text>#B</text>
</placeholder>
<answermark>
<text>1</text>
</answermark>
<answertype>
<text>10</text>
</answertype>
<numbox>
<text>1</text>
</numbox>
<vars1>
<text></text>
</vars1>
<answer>
<text>[c2]</text>
</answer>
<vars2>
<text></text>
</vars2>
<correctness>
<text><![CDATA[_relerr < 0.01]]></text>
</correctness>
<unitpenalty>
<text>0</text>
</unitpenalty>
<postunit>
<text></text>
</postunit>
<ruleid>
<text>1</text>
</ruleid>
<otherrule>
<text></text>
</otherrule>
<autocomplete>
<text>0</text>
</autocomplete>
<subqtext format="html">
<text><![CDATA[<p style="direction: ltr;">{a2}•10<sup>-{b2}</sup>=&nbsp; {_0}&nbsp; &nbsp; &nbsp;<br></p>]]></text>
</subqtext>
<feedback format="html">
<text></text>
</feedback>
<correctfeedback format="html">
<text></text>
</correctfeedback>
<partiallycorrectfeedback format="html">
<text></text>
</partiallycorrectfeedback>
<incorrectfeedback format="html">
<text></text>
</incorrectfeedback>
</answers>
<answers>
<partindex>
<text>2</text>
</partindex>
<placeholder>
<text>#C</text>
</placeholder>
<answermark>
<text>1</text>
</answermark>
<answertype>
<text>10</text>
</answertype>
<numbox>
<text>1</text>
</numbox>
<vars1>
<text>e5=a3*pow(10,-b3);</text>
</vars1>
<answer>
<text>[e5]</text>
</answer>
<vars2>
<text></text>
</vars2>
<correctness>
<text>_relerr == 0</text>
</correctness>
<unitpenalty>
<text>0</text>
</unitpenalty>
<postunit>
<text></text>
</postunit>
<ruleid>
<text>1</text>
</ruleid>
<otherrule>
<text></text>
</otherrule>
<autocomplete>
<text>0</text>
</autocomplete>
<subqtext format="html">
<text><![CDATA[<p style="direction: ltr;">{a3}•10<sup>-{b3}</sup>=&nbsp; {_0}&nbsp; &nbsp; &nbsp;<br></p>]]></text>
</subqtext>
<feedback format="html">
<text></text>
</feedback>
<correctfeedback format="html">
<text></text>
</correctfeedback>
<partiallycorrectfeedback format="html">
<text></text>
</partiallycorrectfeedback>
<incorrectfeedback format="html">
<text></text>
</incorrectfeedback>
</answers>
<answers>
<partindex>
<text>3</text>
</partindex>
<placeholder>
<text>#D</text>
</placeholder>
<answermark>
<text>1</text>
</answermark>
<answertype>
<text>10</text>
</answertype>
<numbox>
<text>1</text>
</numbox>
<vars1>
<text></text>
</vars1>
<answer>
<text>c4</text>
</answer>
<vars2>
<text></text>
</vars2>
<correctness>
<text><![CDATA[_relerr < 0.001]]></text>
</correctness>
<unitpenalty>
<text>0</text>
</unitpenalty>
<postunit>
<text></text>
</postunit>
<ruleid>
<text>1</text>
</ruleid>
<otherrule>
<text></text>
</otherrule>
<autocomplete>
<text>0</text>
</autocomplete>
<subqtext format="html">
<text><![CDATA[<p style="direction: ltr;">{a4}•10<sup>-{b4}</sup>=&nbsp; {_0}&nbsp; &nbsp; &nbsp;<br></p>]]></text>
</subqtext>
<feedback format="html">
<text></text>
</feedback>
<correctfeedback format="html">
<text></text>
</correctfeedback>
<partiallycorrectfeedback format="html">
<text></text>
</partiallycorrectfeedback>
<incorrectfeedback format="html">
<text></text>
</incorrectfeedback>
</answers>
<hint format="html">
<text>שימו לב לשגיאה ונסו שוב</text>
</hint>
<hint format="html">
<text>שימו לב לשגיאה ונסו שוב</text>
</hint>
</question>
</quiz>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment