Annotation of loncom/html/adm/help/tex/adaptive_hints.tex, revision 1.2

1.1       www         1: \label{adaptive_hints}
                      2: Adaptive or conditional hints in LON-CAPA
                      3: Note: an extra space has been added before each tag closure in any tags included below so that the text will be displayed correctly by the FAQ-O-Matic.
                      4: 
                      5: Hints are placed within <hintgroup ></hintgroup > tags. The first part of the hint is the condition, which includes a specification of the foil(s) and foil answer(s) required to trigger the hint. The answers specified in the hint condition are compared with the user's submission, and if the condition is met, the hint action included in the conditional hint block will be executed (for example this could be the display of a block of text). You can set multiple hint conditions for a particular problem. Hint conditions are identified by a name. The corresponding hint action includes this hint condition name in the "on" parameter). When a hint condition evaluates to true, the corresponding hint action is triggered. Besides providing hint actions within <hintpart on="NAME" ></hintpart > tags for each named (NAME) hint condition, a hint can be designated for display if none of the conditional hints evaluate to true. The default hint is not displayed if the conditions were met for any of the conditional hints. The default hint action is included between <hintpart on="default" ></hintpart > tags.
                      6: There are five types of hint condition:
                      7: 
                      8: Formula Hint condition
                      9: Numerical Hint condition
                     10: Option Response Hint condition
                     11: Radiobutton Hint condition
                     12: String Hint condition
                     13: 
                     14: The syntax used to describe the foil(s) and the foil answer(s) differ for the five types:
                     15: 1. Formula Hint condition
                     16: The formulahint tag takes three parameters: answer, name, and samples. The "name" is the unique name given to the hint condition. The formula answer for which you wish to provide conditional is included in the answer parameter. The samples parameter includes the points (or range of points) over which sampling of the student's submitted answer and the formula included in the formula hint answer parameter are to be compared. The syntax is the same as used to specify sampling points in the samples parameter of the formula reponse tag itself. The formula submitted by the student is evaluated at the sample points for the hint and the calculated values are compared with the corresponding values determined by evaluating the "hint" answer at the same sampling points. A close correspondence between the two sets of values will trigger the hint action specified in the <hintpart > tag.
1.2     ! albertel   17: \begin{verbatim}
1.1       www        18: <problem >
                     19:  <script type="loncapa/perl" ># Enter computations here 
                     20:  $x1 = random(2,4,1);
                     21:  $y1 = random(3,7,1);
                     22: 
                     23:  $x2 = random($x1+1,9,1);
                     24:  $y2 = random($y1+1,15,1);
                     25: 
                     26:  $m = "($y2-$y1)/($x2-$x1)";
                     27:  $b = "$y1-$m*$x1";
                     28:  $answer = "$m*x+$b";
                     29:  $answer =~ s/\+-/-/g;
                     30:  $answer =~ s/-\+/-/g;
                     31: 
                     32:  $inverted = "($x2-$x1)/($y2-$y1)";
                     33:  $wrongans = "$inverted*x";
                     34:  $wrongans =~ s/\+-/-/g;
                     35:  $wrongans =~ s/-\+/-/g;
                     36: </script >
                     37: <startouttext /><p > What is the equation of the line which passess through ($x1,$y1) and ($x2,$y2)?</p > y = <endouttext />
                     38: <formularesponse samples="x@-5:5#11" id="11" answer="$answer" >
                     39:  <textline size="25" / >
                     40:   <hintgroup >
                     41:    <formulahint samples="x@-5:5#11" answer="$wrongans" name="inversegrad" >
                     42:    </formulahint >
                     43:    <hintpart on="inversegrad" >
                     44:     <startouttext />You have inverted the slope in the question.  Slope is
                     45: (y2-y1)/(x2 - x1) you have the slope as (x2-x1)/(y2-y1).<endouttext / >
                     46:    </hintpart >
                     47:   </hintgroup >     
                     48:  </formularesponse >
                     49: </problem >
1.2     ! albertel   50: \end{verbatim}
1.1       www        51: 
                     52: 2. Numerical Response condition
                     53: The numericalhint tag takes four parameters: answer, name, unit and format. The "name" is the unique name given to the hint condition. The numerical answer for which you wish to provide conditional is included in the answer parameter. Student submission of that answer in combination with the "unit" parameter in the hint condition will trigger the hint action specified in the <hintpart > tag.
                     54: 
1.2     ! albertel   55: \begin{verbatim}
1.1       www        56: <problem > <startouttext />A car travels 10 km in 10 min. What is the speed of the car?<endouttext />
                     57:   <numericalresponse format="1f" unit="km/hr" answer="60">
                     58:    <responseparam description="Numerical Tolerance" default="2%" type="tolerance" name="tol" />
                     59:     <textline />
                     60:     <hintgroup >
                     61:      <numericalhint format="1f" unit="km/min" answer="100" name="speed">
                     62:        <responseparam description="Numerical Tolerance" type="tolerance" default="2%" name="tol" />
                     63:      </numericalhint >
                     64:       <hintpart on="speed">
                     65:        <startouttext />You multiplied the distance by the time.  Remember speed = distance/time<endouttext />
                     66:       </hintpart >
                     67:      </hintgroup >
                     68:    </numericalresponse >
                     69: </problem >
1.2     ! albertel   70: \end{verbatim}
        !            71: 
1.1       www        72: 3. Option Response Hint condition
                     73: There are two types of option response hint conditions: one for standalone foils and one for concept groups. In both cases the option hint tag includes two parameters: answer and name for standalone foils, and concept and name for foils grouped together in a concept group. For the answer parameter, the names and submitted values for each of the foils that are being included in the hint condition are provided in a hash, i.e., in the format: ('Foil1'=>'True','Foil2'=>'False'). In the case of a conditional hint for a concept group, the format of the concept parameter is also a hash that links the name of each concept group included in the hint condition to either 'correct' or 'incorrect' - e.g., <optionhint concept="('buoyancy'=>'correct','density'=>'correct')" name="fluids" / > If 'correct' is specified for a named concept then when the conditional hint is evaluated answers for each of the foils selected by a student must be correct for the hint action to be triggered. If anything other than 'correct' is provided in the concept hash in the optionhint tag then then students answers will be compared with the set answers for the foils in the concept group and as long as at least one answer is incorrect (i.e., the concept group was not correctly answered) then the corresponding hint action will be triggered.
                     74: (a) optionresponse
1.2     ! albertel   75: 
        !            76: \begin{verbatim}
1.1       www        77: <problem >
                     78:  <startouttext />For each of the following rock types, indicate whether or not the rock is a volcanic rock.<endouttext / >
                     79:  <optionresponse max="10" randomize="yes" >
                     80:   <foilgroup options="('Yes','No')" >
                     81:    <foil location="random" value="No" name="schist" >
                     82:     <startouttext />Schist<endouttext / >
                     83:    </foil >
                     84:    <foil location="random" value="No" name="marble" >
                     85:     <startouttext />Marble<endouttext / >
                     86:    </foil >
                     87:    <foil location="random" value="Yes" name="basalt" >
                     88:     <startouttext />Basalt<endouttext / >
                     89:    </foil >
                     90:    <foil location="random" value="No" name="gabbro" >
                     91:     <startouttext />Gabbro<endouttext />
                     92:    </foil >
                     93:    <foil location="random" value="No" name="granite" >
                     94:     <startouttext />Granite<endouttext />
                     95:    </foil >
                     96:   </foilgroup >
                     97:   <hintgroup >
                     98:    <optionhint answer="('schist'=>'Yes','marble'=>'Yes')" name="metamorphic"/ >
                     99:    <optionhint answer="('gabbro'=>'Yes','granite'=>'Yes')" name="plutonic" / >
                    100:    <hintpart on="metamorphic">
                    101:     <startouttext />Schist and Marble are both examples of metamorphic rocks
                    102: as described on page 2 of the textbook.<br / ><br / ><endouttext / >
                    103:    </hintpart >
                    104:    <hintpart on="plutonic" >
                    105:     <startouttext />Granite and Gabbro are both examples of igneous rocks that crystallized beneath the surface, i.e., they are plutonic rocks.<br / ><br / ><endouttext / >
                    106:    </hintpart >
                    107:    <hintpart on="default" >
                    108:     <startouttext />Volcanic rocks are described on page 22 of the
                    109: textbook.<endouttext / >
                    110:    </hintpart >
                    111:   </hintgroup >
                    112:  </optionresponse >
                    113: </problem >
1.2     ! albertel  114: \end{verbatim}
        !           115: 
1.1       www       116: (b) optionresponse with concept groups
1.2     ! albertel  117: 
        !           118: \begin{verbatim}
1.1       www       119: <problem >
                    120:  <startouttext />Choose the likely plate boundary type, where you are most likely to encounter each of the following geologic features or phenomena.<endouttext / >
                    121:  <optionresponse max="10" randomize="yes" >
                    122:    <foilgroup options="('Convergent','Divergent','Transform')" >
                    123:      <conceptgroup concept="faulting" >
                    124:        <foil name="normal" value="Divergent" >
                    125:          <startouttext / >Normal faults<endouttext / > 
                    126:        </foil >
                    127:        <foil name="strike" value="Transform" >
                    128:          <startouttext / >Strike-slip faults<endouttext />
                    129:        </foil >
                    130:        <foil name="thrust" value="Convergent" >
                    131:          <startouttext />Thrust faults<endouttext />
                    132:        </foil >
                    133:      </conceptgroup >
                    134:      <conceptgroup concept="earthquakes" >
                    135:        <foil name="deep" value="Convergent" >
                    136:          <startouttext / >Large Magntitude, deep and intermediate focus earthquakes<endouttext / >
                    137:        </foil >
                    138:        <foil name="shallow" value="Transform" >
                    139:          <startouttext / >Large magnitude, shallow focus earthquakes<endouttext />
                    140:        </foil >
                    141:       <foil name="lowmag" value="Divergent" >
                    142:          <startouttext / >Low magnitude shallow focus earthquakes<endouttext />
                    143:        </foil >
                    144:      </conceptgroup >
                    145:      <conceptgroup concept="topography" >
                    146:        <foil name="gentle" value="Divergent" >
                    147:          <startouttext / >Broad area of elevated topography with a central rift valley.<endouttext / >
                    148:        </foil >
                    149:        <foil name="linear" value="Transform" >
                    150:          <startouttext / >A narrow linear fault zone with limited topgraphic expression.<endouttext / >
                    151:        </foil >
                    152:        <foil name="trench" value="Convergent" >
                    153:          <startouttext />A deep trench adjacent to a volcanic arc.<endouttext / >
                    154:        </foil >
                    155:      </conceptgroup >
                    156:      <conceptgroup concept="volcanism" >
                    157:        <foil name="explosize" value="Convergent" >
                    158:          <startouttext />Explosive volcanism involving volatile-rich viscous magma.<endouttext / >
                    159:        </foil >
                    160:        <foil name="fluid" value="Divergent" >
                    161:          <startouttext />Non-explosive outpourings of low-viscosity magma.<endouttext / >
                    162:        </foil >
                    163:        <foil name="nonvolcanic" value="Transform" >
                    164:          <startouttext />No volcanic activity.<endouttext / >
                    165:        </foil >
                    166:      </conceptgroup >
                    167:    </foilgroup >
                    168:    <hintgroup >
                    169:      <optionhint concept="('earthquakes' => 'incorrect')" name="quakes" / >
                    170:      <optionhint concept="('volcanism' => 'incorrect')" name="volcactivity" / >
                    171:      <optionhint concept="('topography' => 'incorrect')" name="relief" / >
                    172:      <hintpart on="volcanism" >
                    173:        <startouttext />Volcanism requires a source of magma. Magma can be generated by either a depression in the solidus caused by an influx of volatiles, or by decompression melting. Magma rich in volatiles tends to cause explosive volcanism.<endouttext / >
                    174:      </hintpart >
                    175:      <hintpart on="quakes" >
                    176:        <startouttext />Earthquakes require brittle failure, so there is a correlation between the depth of earthquake foci and the geotherm.  The geotherm is depressed in subduction zones, and elevated at mid-ocean ridges.<endouttext / >
                    177:      </hintpart >
                    178:      <hintpart on="relief" >
                    179:        <startouttext / >On a broad scale topography is an expression of density variation, as embodied in the concept of isostasy.  Density variation in the earth is a function of temperature and composition.  Cold oceanic crust entering a subduction zone is dense, whereas as magma is buoyant and of lower density.<br / ><br / ><endouttext / >
                    180:      </hintpart >
                    181:     <hintpart on="default" >
                    182:      <startouttext / >The characteristics of plate boundaries are described on page 52 of the textbook.<endouttext / >
                    183:     </hintpart >
                    184:    </hintgroup >
                    185:  </optionresponse >
                    186: </problem >
1.2     ! albertel  187: \end{verbatim}
        !           188: 
1.1       www       189: 4. Radiobutton Hint condition
                    190: 
                    191:  The radiobutton hint tag takes two parameters: answer and name.  The name is
                    192: the name of the hint condition, and the answer is an array. The first element of the array will be 'foil'; the remaining elements are the names of the foils that you require to have been checked by the student for the hint to be displayed. For example, if you create a radiobutton response problem with six foils named: granite, gabbro, gneiss, shale, sandstone and schist, and you want your hint named: igneous to be displayed when either granite or basalt had been checked your radiobutton hint would be as follows:
                    193:   
1.2     ! albertel  194: \begin{verbatim}
1.1       www       195:  <radiobuttonhint answer="('foil','granite','gabbro')"
                    196: name="igneous" ></radiobuttonhint >
                    197:   In order to trigger display of this hint you also need to create a
                    198: <hintpart ></hintpart > block that will include a textblock that contains the text of the actual hint.
                    199:  <hintpart on="igneous" >
                    200:   <startouttext />This type of rock is composed of interlocking crystals, a
                    201: characteristic of igneous rocks.<endouttext / >
                    202:  </hintpart >
1.2     ! albertel  203: \end{verbatim}
        !           204: 
1.1       www       205:   The complete radiobutton response would look as follows:
                    206:  
1.2     ! albertel  207: \begin{verbatim}
1.1       www       208: <problem >
                    209:  <startouttext />
                    210:  Which of the following is a sedimentary rock?
                    211:  <endouttext />
                    212: 
                    213:  <radiobuttonresponse max="3" randomize="yes" >
                    214:    <foilgroup >
                    215:      <foil location="random" value="false" name="granite" >
                    216:     <startouttext / >
                    217:      Granite
                    218:     <endouttext / >
                    219:    </foil >
                    220: 
                    221:    <foil location="random" value="false" name="gabbro" >
                    222:     <startouttext / >
                    223:      Gabbro
                    224:     <endouttext / >
                    225:    </foil >
                    226: 
                    227:    <foil location="random" value="false" name="schist">
                    228:     <startouttext / >
                    229:      Schist
                    230:     <endouttext />
                    231:    </foil >
                    232: 
                    233:    <foil location="random" value="false" name="gneiss" >
                    234:     <startouttext / >
                    235:      Gneiss
                    236:     <endouttext / >
                    237:    </foil >
                    238: 
                    239:    <foil location="random" value="true" name="shale" >
                    240:     <startouttext / >
                    241:      Shale
                    242:     <endouttext / >
                    243:    </foil >
                    244:       <foil location="random" value="true" name="sandstone" >
                    245:     <startouttext / >
                    246:      Sandstone
                    247:     <endouttext / >
                    248:    </foil >
                    249: 
                    250:   </foilgroup >
                    251:   <hintgroup >
                    252:    <radiobuttonhint answer="('foil','granite','gabbro')"
                    253: name="igneous" ></radiobuttonhint >
                    254:    <radiobuttonhint answer="('foil','gneiss','schist')"
                    255: name="metamorphic" ></radiobuttonhint >
                    256: 
                    257:    <hintpart on="igneous" >
                    258:     <startouttext />This type of rock is composed of interlocking crystals, a
                    259: characteristic of igneous rocks.<br / ><br / ><endouttext / >
                    260:    </hintpart >
                    261:    <hintpart on="metamorphic" >
                    262:     <startouttext />This type of rock is composed of oriented crystals, a
                    263: characteristic of foliated metamorphic rocks.<endouttext / >
                    264:    </hintpart >
                    265:   </hintgroup >
                    266:  </radiobuttonresponse >
                    267: </problem >
1.2     ! albertel  268: \end{verbatim}
1.1       www       269: 
                    270: 5. String Hint condition
                    271: The radiobutton hint tag takes two parameters: answer and name. The name is the name of the hint condition, and the answer is a text string. The type parameter allows you to choose between case sensitive, case insensitive, and case insensitive in any order. A simple example is shown below.
1.2     ! albertel  272: 
        !           273: \begin{verbatim}
1.1       www       274: <problem >
                    275:  <startouttext />Which US state has Lansing as its capital?<endouttext / >
                    276:   <stringresponse answer="Michigan" type="ci" >
                    277:   <textline size="20" / >
                    278:   <hintgroup >
                    279:    <stringhint answer="wisconsin" type="cs" name="wisc" >
                    280:    </stringhint >
                    281:    <stringhint answer="minnesota" type="cs" name="minn" >
                    282:    </stringhint >
                    283:    <hintpart on="wisc">
                    284:     <startouttext />The state capital of Wisconsin is Madison.<endouttext / >
                    285:    </hintpart >
                    286:    <hintpart on="minn">
                    287:     <startouttext />The state capital of Minnesota is St. Paul.<endouttext / >
                    288:    </hintpart >
                    289:    <hintpart on="default" >
                    290:     <startouttext />The state you are looking for is also known as the 'Great Lakes State'<endouttext / >
                    291:    </hintpart >     
                    292:   </hintgroup >
                    293:  </stringresponse >
                    294: </problem > 
1.2     ! albertel  295: \end{verbatim}
        !           296: 
1.1       www       297: 

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>