Skip to main content

Fill Blanks 2

<?xml version="1.0" encoding="UTF-8"?>
<!-- $Id$ -->
<question type="fillblanks">
  <!--
  The values used in the question are calculated first.

  the first two expressions generate random numbers. store="1" means that
  those two expressions are only evaluated the first time a user views the
  question. The values are then stored and loaded the next time.

  The other expressions are evaluated every time the user views the question.

  Expressions specifying store="1" should always be the first expressions.
  -->
  <matheval expression="a=random()" store="1" />
  <matheval expression="b=random()" store="1" />
  <matheval expression="a=round(a*0.8+0.11,2)" />
  <matheval expression="b=round(b*5+2,0)" />
  <matheval expression="ans=a*b" />
  <matheval expression="min=ans-0.01" />
  <matheval expression="max=ans+0.01" />

  <text>
    <p>In this question the values are generated and different for each user. The generated values are also used in the feedback after three incorrect tries.</p>
    <p>You have measured a concentration of <mathresult expression="a" />mg/ml in a <mathresult expression="b" />-times diluted sample.<br/>
       What was the concentration in the non-diluted solution?</p>
    <p><b>The original concentration was: <inlineChoice identifier="c" freeform="1" />g/l</b></p>

  </text>

  <hint mintries="1">That's not correct.</hint>
  <hint mintries="2">The concentration in the non-diluted solution is higher than the measured concentration.</hint>
  <hint mintries="3">The correct answer is: <mathresult expression="a" /> * <mathresult expression="b" /> = <mathresult expression="ans" />.</hint>

  <mapping correct="1">
    <range inlineChoice="c" minval="min" maxval="max" />
    <feedback>
              Very good.
    </feedback>
  </mapping>

  <mapping correct="0" stop="1">
    <not><match inlineChoice="c" pattern="^[+-]?[0-9]+(\.[0-9]+)?(e[+-]?[0-9]+)?$" /></not>
    <feedback>Please give a number.</feedback>
  </mapping>
</question>