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

1.1       www         1: \label{adaptive_hints}
1.3       lira        2: \index{hints}\index{conditional hints}\index{adaptive hints}
1.4     ! raeburn     3: 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.
1.3       lira        4: There are five types of hint condition:
1.1       www         5: 
1.3       lira        6: \begin{itemize}
                      7: 	\item Formula Hint condition
                      8: 	\item Numerical Hint condition
                      9: 	\item Option Response Hint condition
                     10: 	\item Radiobutton Hint condition
                     11: 	\item String Hint condition
                     12: \end{itemize}
                     13: 
                     14: \noindent The syntax used to describe the foil(s) and the foil answer(s) differ for the five types:
                     15: \begin{enumerate}
                     16: \item Formula Hint condition
1.1       www        17: 
1.4     ! raeburn    18: 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   19: \begin{verbatim}
1.4     ! raeburn    20: <problem>
1.1       www        21:  <script type="loncapa/perl" ># Enter computations here 
                     22:  $x1 = random(2,4,1);
                     23:  $y1 = random(3,7,1);
                     24: 
                     25:  $x2 = random($x1+1,9,1);
                     26:  $y2 = random($y1+1,15,1);
                     27: 
                     28:  $m = "($y2-$y1)/($x2-$x1)";
                     29:  $b = "$y1-$m*$x1";
                     30:  $answer = "$m*x+$b";
                     31:  $answer =~ s/\+-/-/g;
                     32:  $answer =~ s/-\+/-/g;
                     33: 
                     34:  $inverted = "($x2-$x1)/($y2-$y1)";
                     35:  $wrongans = "$inverted*x";
                     36:  $wrongans =~ s/\+-/-/g;
                     37:  $wrongans =~ s/-\+/-/g;
1.4     ! raeburn    38: </script>
        !            39: <startouttext /><p> What is the equation of the line 
1.3       lira       40: which passess through ($x1,$y1) and ($x2,$y2)?</p > y = <endouttext />
1.4     ! raeburn    41: <formularesponse samples="x@-5:5#11" id="11" answer="$answer">
        !            42:  <textline size="25" />
        !            43:   <hintgroup>
        !            44:    <formulahint samples="x@-5:5#11" answer="$wrongans" name="inversegrad">
        !            45:    </formulahint>
        !            46:    <hintpart on="inversegrad">
1.1       www        47:     <startouttext />You have inverted the slope in the question.  Slope is
1.4     ! raeburn    48: (y2-y1)/(x2 - x1) you have the slope as (x2-x1)/(y2-y1).<endouttext />
        !            49:    </hintpart>
        !            50:   </hintgroup>
        !            51:  </formularesponse>
        !            52: </problem>
1.2       albertel   53: \end{verbatim}
1.1       www        54: 
1.3       lira       55: \item Numerical Response condition
                     56: 
1.4     ! raeburn    57: 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.
1.1       www        58: 
1.2       albertel   59: \begin{verbatim}
1.4     ! raeburn    60: <problem> <startouttext /> A car travels 10 km in 10 min. 
1.3       lira       61:  What is the speed of the car?<endouttext />
1.1       www        62:   <numericalresponse format="1f" unit="km/hr" answer="60">
1.3       lira       63:    <responseparam description="Numerical Tolerance" default="2%" 
                     64:      type="tolerance" name="tol" />
1.1       www        65:     <textline />
1.4     ! raeburn    66:     <hintgroup>
1.1       www        67:      <numericalhint format="1f" unit="km/min" answer="100" name="speed">
1.3       lira       68:        <responseparam description="Numerical Tolerance" type="tolerance" 
                     69:        default="2%" name="tol" />
1.4     ! raeburn    70:      </numericalhin >
1.1       www        71:       <hintpart on="speed">
1.3       lira       72:        <startouttext />You multiplied the distance by the time.  Remember 
                     73:        speed = distance/time<endouttext />
1.4     ! raeburn    74:       </hintpart>
        !            75:      </hintgroup>
        !            76:    </numericalresponse>
        !            77: </problem>
1.2       albertel   78: \end{verbatim}
                     79: 
1.3       lira       80: \item Option Response Hint condition
1.2       albertel   81: 
1.4     ! raeburn    82: 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.
1.3       lira       83: 
                     84: \begin{enumerate}
                     85: 	\item optionresponse
1.2       albertel   86: \begin{verbatim}
1.4     ! raeburn    87: <problem>
1.3       lira       88:  <startouttext />For each of the following rock types, indicate 
1.4     ! raeburn    89:   whether or not the rock is a volcanic rock.<endouttext />
        !            90:  <optionresponse max="10" randomize="yes">
1.1       www        91:   <foilgroup options="('Yes','No')" >
1.4     ! raeburn    92:    <foil location="random" value="No" name="schist">
        !            93:     <startouttext />Schist<endouttext />
        !            94:    </foil>
        !            95:    <foil location="random" value="No" name="marble">
        !            96:     <startouttext />Marble<endouttext />
        !            97:    </foil>
        !            98:    <foil location="random" value="Yes" name="basalt">
        !            99:     <startouttext />Basalt<endouttext />
        !           100:    </foil>
        !           101:    <foil location="random" value="No" name="gabbro">
1.1       www       102:     <startouttext />Gabbro<endouttext />
1.4     ! raeburn   103:    </foil>
        !           104:    <foil location="random" value="No" name="granite">
1.1       www       105:     <startouttext />Granite<endouttext />
1.4     ! raeburn   106:    </foil>
1.1       www       107:   </foilgroup >
                    108:   <hintgroup >
1.3       lira      109:    <optionhint answer="('schist'=>'Yes','marble'=>'Yes')" 
1.4     ! raeburn   110:      name="metamorphic"/>
1.3       lira      111:    <optionhint answer="('gabbro'=>'Yes','granite'=>'Yes')" 
1.4     ! raeburn   112:      name="plutonic" />
1.1       www       113:    <hintpart on="metamorphic">
1.3       lira      114:     <startouttext />Schist and Marble are both examples of 
                    115:       metamorphic rocks as described on page 2 of the textbook.
1.4     ! raeburn   116:       <br /><br /><endouttext />
        !           117:    </hintpart>
        !           118:    <hintpart on="plutonic">
1.3       lira      119:     <startouttext />Granite and Gabbro are both examples of 
                    120:      igneous rocks that crystallized beneath the surface, i.e., 
1.4     ! raeburn   121:      they are plutonic rocks.<br /><br /><endouttext />
        !           122:    </hintpart>
1.1       www       123:    <hintpart on="default" >
1.3       lira      124:     <startouttext />Volcanic rocks are described on page 22 
1.4     ! raeburn   125:      of the textbook.<endouttext />
        !           126:    </hintpart>
        !           127:   </hintgroup>
        !           128:  </optionresponse>
        !           129: </problem>
1.2       albertel  130: \end{verbatim}
                    131: 
1.3       lira      132: \item optionresponse with concept groups
1.2       albertel  133: 
                    134: \begin{verbatim}
1.4     ! raeburn   135: <problem>
1.3       lira      136:  <startouttext />Choose the likely plate boundary type, 
                    137:   where you are most likely to encounter each of the following 
1.4     ! raeburn   138:   geologic features or phenomena.<endouttext />
        !           139:  <optionresponse max="10" randomize="yes">
1.1       www       140:    <foilgroup options="('Convergent','Divergent','Transform')" >
1.4     ! raeburn   141:      <conceptgroup concept="faulting">
        !           142:        <foil name="normal" value="Divergent">
        !           143:          <startouttext / >Normal faults<endouttext /> 
        !           144:        </foil>
        !           145:        <foil name="strike" value="Transform">
1.1       www       146:          <startouttext / >Strike-slip faults<endouttext />
1.4     ! raeburn   147:        </foil>
        !           148:        <foil name="thrust" value="Convergent">
1.1       www       149:          <startouttext />Thrust faults<endouttext />
1.4     ! raeburn   150:        </foil>
        !           151:      </conceptgroup>
        !           152:      <conceptgroup concept="earthquakes">
        !           153:        <foil name="deep" value="Convergent">
1.3       lira      154:          <startouttext / >Large Magntitude, deep and intermediate 
1.4     ! raeburn   155:           focus earthquakes<endouttext />
        !           156:        </foil>
        !           157:        <foil name="shallow" value="Transform">
1.3       lira      158:          <startouttext / >Large magnitude, shallow focus earthquakes
                    159:           <endouttext />
1.4     ! raeburn   160:        </foil>
        !           161:       <foil name="lowmag" value="Divergent">
1.3       lira      162:          <startouttext / >Low magnitude shallow focus earthquakes
                    163:           <endouttext />
1.4     ! raeburn   164:        </foil>
        !           165:      </conceptgroup>
        !           166:      <conceptgroup concept="topography">
        !           167:        <foil name="gentle" value="Divergent">
1.3       lira      168:          <startouttext / >Broad area of elevated topography with a 
1.4     ! raeburn   169:           central rift valley.<endouttext />
        !           170:        </foil>
        !           171:        <foil name="linear" value="Transform">
1.3       lira      172:          <startouttext / >A narrow linear fault zone with limited 
1.4     ! raeburn   173:           topgraphic expression.<endouttext />
        !           174:        </foil>
        !           175:        <foil name="trench" value="Convergent">
1.3       lira      176:          <startouttext />A deep trench adjacent to a volcanic arc.
1.4     ! raeburn   177:           <endouttext />
        !           178:        </foil>
        !           179:      </conceptgroup>
        !           180:      <conceptgroup concept="volcanism">
        !           181:        <foil name="explosize" value="Convergent">
1.3       lira      182:          <startouttext />Explosive volcanism involving volatile-rich 
1.4     ! raeburn   183:            viscous magma.<endouttext />
        !           184:        </foil>
        !           185:        <foil name="fluid" value="Divergent">
1.3       lira      186:          <startouttext />Non-explosive outpourings of low-viscosity 
1.4     ! raeburn   187:            magma.<endouttext />
        !           188:        </foil>
        !           189:        <foil name="nonvolcanic" value="Transform">
        !           190:          <startouttext />No volcanic activity.<endouttext />
        !           191:        </foil>
        !           192:      </conceptgroup>
        !           193:    </foilgroup>
        !           194:    <hintgroup>
1.3       lira      195:      <optionhint concept="('earthquakes' => 'incorrect')" 
1.4     ! raeburn   196:        name="quakes" />
1.3       lira      197:      <optionhint concept="('volcanism' => 'incorrect')" 
1.4     ! raeburn   198:        name="volcactivity" />
1.3       lira      199:      <optionhint concept="('topography' => 'incorrect')" 
1.4     ! raeburn   200:        name="relief" />
        !           201:      <hintpart on="volcanism">
1.3       lira      202:        <startouttext />Volcanism requires a source of magma. 
                    203:         Magma can be generated by either a depression in the solidus 
                    204:         caused by an influx of volatiles, or by decompression melting. 
                    205:         Magma rich in volatiles tends to cause explosive volcanism.
1.4     ! raeburn   206:         <endouttext />
        !           207:      </hintpart>
        !           208:      <hintpart on="quakes">
1.3       lira      209:        <startouttext />Earthquakes require brittle failure, so there 
                    210:         is a correlation between the depth of earthquake foci and the 
                    211:         geotherm.  The geotherm is depressed in subduction zones, and 
1.4     ! raeburn   212:         elevated at mid-ocean ridges.<endouttext />
        !           213:      </hintpart>
        !           214:      <hintpart on="relief">
        !           215:        <startouttext />On a broad scale topography is an expression 
1.3       lira      216:         of density variation, as embodied in the concept of isostasy.  
                    217:         Density variation in the earth is a function of temperature and 
                    218:         composition.  Cold oceanic crust entering a subduction zone is 
                    219:         dense, whereas as magma is buoyant and of lower density.
1.4     ! raeburn   220:         <br /><br /><endouttext />
        !           221:      </hintpart>
        !           222:     <hintpart on="default">
        !           223:      <startouttext />The characteristics of plate boundaries are 
        !           224:        described on page 52 of the textbook.<endouttext />
        !           225:     </hintpart>
        !           226:    </hintgroup>
        !           227:  </optionresponse>
        !           228: </problem>
1.2       albertel  229: \end{verbatim}
1.3       lira      230: \end{enumerate}
1.2       albertel  231: 
1.3       lira      232: \item Radiobutton Hint condition
1.1       www       233: 
1.3       lira      234: The radiobutton hint tag takes two parameters: answer and name.  The name is
1.1       www       235: 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:
                    236:   
1.2       albertel  237: \begin{verbatim}
1.1       www       238:  <radiobuttonhint answer="('foil','granite','gabbro')"
1.4     ! raeburn   239: name="igneous"></radiobuttonhint>
        !           240: \end{verbatim}
        !           241: 
1.1       www       242:   In order to trigger display of this hint you also need to create a
1.4     ! raeburn   243: $<$hintpart$>$$<$/hintpart$>$ block that will include a textblock that 
1.3       lira      244:   contains the text of the actual hint.
1.4     ! raeburn   245: 
        !           246: \begin{verbatim}
        !           247:  <hintpart on="igneous">
1.3       lira      248:   <startouttext />This type of rock is composed of interlocking 
1.4     ! raeburn   249:    crystals, a characteristic of igneous rocks.<endouttext />
        !           250:  </hintpart>
1.2       albertel  251: \end{verbatim}
                    252: 
1.1       www       253:   The complete radiobutton response would look as follows:
                    254:  
1.2       albertel  255: \begin{verbatim}
1.4     ! raeburn   256: <problem>
1.1       www       257:  <startouttext />
                    258:  Which of the following is a sedimentary rock?
                    259:  <endouttext />
                    260: 
1.4     ! raeburn   261:  <radiobuttonresponse max="3" randomize="yes">
        !           262:    <foilgroup>
        !           263:      <foil location="random" value="false" name="granite">
        !           264:     <startouttext />
1.1       www       265:      Granite
1.4     ! raeburn   266:     <endouttext />
        !           267:    </foil>
1.1       www       268: 
1.4     ! raeburn   269:    <foil location="random" value="false" name="gabbro">
        !           270:     <startouttext />
1.1       www       271:      Gabbro
1.4     ! raeburn   272:     <endouttext />
        !           273:    </foil>
1.1       www       274: 
                    275:    <foil location="random" value="false" name="schist">
1.4     ! raeburn   276:     <startouttext />
1.1       www       277:      Schist
                    278:     <endouttext />
1.4     ! raeburn   279:    </foil>
1.1       www       280: 
1.4     ! raeburn   281:    <foil location="random" value="false" name="gneiss">
        !           282:     <startouttext />
1.1       www       283:      Gneiss
1.4     ! raeburn   284:     <endouttext />
        !           285:    </foil>
1.1       www       286: 
1.4     ! raeburn   287:    <foil location="random" value="true" name="shale">
        !           288:     <startouttext />
1.1       www       289:      Shale
1.4     ! raeburn   290:     <endouttext />
        !           291:    </foil>
        !           292:       <foil location="random" value="true" name="sandstone">
        !           293:     <startouttext />
1.1       www       294:      Sandstone
1.4     ! raeburn   295:     <endouttext />
        !           296:    </foil>
1.1       www       297: 
1.4     ! raeburn   298:   </foilgroup>
        !           299:   <hintgroup>
1.1       www       300:    <radiobuttonhint answer="('foil','granite','gabbro')"
1.4     ! raeburn   301: name="igneous" ></radiobuttonhint>
1.1       www       302:    <radiobuttonhint answer="('foil','gneiss','schist')"
1.4     ! raeburn   303: name="metamorphic"></radiobuttonhint>
1.1       www       304: 
1.4     ! raeburn   305:    <hintpart on="igneous">
1.3       lira      306:     <startouttext />This type of rock is composed of interlocking 
1.4     ! raeburn   307:       crystals, a characteristic of igneous rocks.<br /><br /><endouttext />
        !           308:    </hintpart>
        !           309:    <hintpart on="metamorphic">
1.1       www       310:     <startouttext />This type of rock is composed of oriented crystals, a
1.4     ! raeburn   311: characteristic of foliated metamorphic rocks.<endouttext />
        !           312:    </hintpart>
        !           313:   </hintgroup>
        !           314:  </radiobuttonresponse>
        !           315: </problem>
1.2       albertel  316: \end{verbatim}
1.1       www       317: 
1.3       lira      318: \item String Hint condition
                    319: 
1.1       www       320: 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  321: 
                    322: \begin{verbatim}
1.4     ! raeburn   323: <problem>
        !           324:  <startouttext />Which US state has Lansing as its capital?<endouttext />
        !           325:   <stringresponse answer="Michigan" type="ci">
        !           326:   <textline size="20" />
        !           327:   <hintgroup>
        !           328:    <stringhint answer="wisconsin" type="cs" name="wisc">
        !           329:    </stringhint>
        !           330:    <stringhint answer="minnesota" type="cs" name="minn">
        !           331:    </stringhint>
1.1       www       332:    <hintpart on="wisc">
1.4     ! raeburn   333:     <startouttext />The state capital of Wisconsin is Madison.<endouttext />
        !           334:    </hintpart>
1.1       www       335:    <hintpart on="minn">
1.4     ! raeburn   336:     <startouttext />The state capital of Minnesota is St. Paul.<endouttext />
        !           337:    </hintpart>
        !           338:    <hintpart on="default"> 
1.3       lira      339:     <startouttext />The state you are looking for is also known as the 
1.4     ! raeburn   340:      'Great Lakes State'<endouttext />
        !           341:    </hintpart>     
        !           342:   </hintgroup>
        !           343:  </stringresponse>
        !           344: </problem> 
1.2       albertel  345: \end{verbatim}
                    346: 
1.3       lira      347: \end{enumerate}

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