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

1.1       www         1: \label{adaptive_hints}
1.3     ! lira        2: \index{hints}\index{conditional hints}\index{adaptive hints}
        !             3: Hints are placed within \textless hintgroup \textgreater \textless \textbackslash hintgroup\textgreater 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 \textless hintpart on="NAME" \textgreater\textless /hintpart \textgreater 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 \textless hintpart on="default" \textgreater\textless /hintpart \textgreater tags.
        !             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.3     ! lira       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 \textless hintpart \textgreater tag.
1.2       albertel   19: \begin{verbatim}
1.1       www        20: <problem >
                     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;
                     38: </script >
1.3     ! lira       39: <startouttext /><p > What is the equation of the line 
        !            40: which passess through ($x1,$y1) and ($x2,$y2)?</p > y = <endouttext />
1.1       www        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" >
                     47:     <startouttext />You have inverted the slope in the question.  Slope is
                     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: 
        !            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 \textless hintpart \textgreater tag.
1.1       www        58: 
1.2       albertel   59: \begin{verbatim}
1.3     ! lira       60: <problem > <startouttext /> A car travels 10 km in 10 min. 
        !            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 />
                     66:     <hintgroup >
                     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.1       www        70:      </numericalhint >
                     71:       <hintpart on="speed">
1.3     ! lira       72:        <startouttext />You multiplied the distance by the time.  Remember 
        !            73:        speed = distance/time<endouttext />
1.1       www        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.3     ! lira       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'=\textgreater'True','Foil2'=\textgreater'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., \textless optionhint concept="('buoyancy'=\textgreater'correct','density'=\textgreater'correct')" name="fluids" / \textgreater 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.
        !            83: 
        !            84: \begin{enumerate}
        !            85: 	\item optionresponse
1.2       albertel   86: \begin{verbatim}
1.1       www        87: <problem >
1.3     ! lira       88:  <startouttext />For each of the following rock types, indicate 
        !            89:   whether or not the rock is a volcanic rock.<endouttext / >
1.1       www        90:  <optionresponse max="10" randomize="yes" >
                     91:   <foilgroup options="('Yes','No')" >
                     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" >
                    102:     <startouttext />Gabbro<endouttext />
                    103:    </foil >
                    104:    <foil location="random" value="No" name="granite" >
                    105:     <startouttext />Granite<endouttext />
                    106:    </foil >
                    107:   </foilgroup >
                    108:   <hintgroup >
1.3     ! lira      109:    <optionhint answer="('schist'=>'Yes','marble'=>'Yes')" 
        !           110:      name="metamorphic"/ >
        !           111:    <optionhint answer="('gabbro'=>'Yes','granite'=>'Yes')" 
        !           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.
        !           116:       <br / ><br / ><endouttext / >
1.1       www       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., 
        !           121:      they are plutonic rocks.<br / ><br / ><endouttext / >
1.1       www       122:    </hintpart >
                    123:    <hintpart on="default" >
1.3     ! lira      124:     <startouttext />Volcanic rocks are described on page 22 
        !           125:      of the textbook.<endouttext / >
1.1       www       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.1       www       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 
        !           138:   geologic features or phenomena.<endouttext / >
1.1       www       139:  <optionresponse max="10" randomize="yes" >
                    140:    <foilgroup options="('Convergent','Divergent','Transform')" >
                    141:      <conceptgroup concept="faulting" >
                    142:        <foil name="normal" value="Divergent" >
                    143:          <startouttext / >Normal faults<endouttext / > 
                    144:        </foil >
                    145:        <foil name="strike" value="Transform" >
                    146:          <startouttext / >Strike-slip faults<endouttext />
                    147:        </foil >
                    148:        <foil name="thrust" value="Convergent" >
                    149:          <startouttext />Thrust faults<endouttext />
                    150:        </foil >
                    151:      </conceptgroup >
                    152:      <conceptgroup concept="earthquakes" >
                    153:        <foil name="deep" value="Convergent" >
1.3     ! lira      154:          <startouttext / >Large Magntitude, deep and intermediate 
        !           155:           focus earthquakes<endouttext / >
1.1       www       156:        </foil >
                    157:        <foil name="shallow" value="Transform" >
1.3     ! lira      158:          <startouttext / >Large magnitude, shallow focus earthquakes
        !           159:           <endouttext />
1.1       www       160:        </foil >
                    161:       <foil name="lowmag" value="Divergent" >
1.3     ! lira      162:          <startouttext / >Low magnitude shallow focus earthquakes
        !           163:           <endouttext />
1.1       www       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 
        !           169:           central rift valley.<endouttext / >
1.1       www       170:        </foil >
                    171:        <foil name="linear" value="Transform" >
1.3     ! lira      172:          <startouttext / >A narrow linear fault zone with limited 
        !           173:           topgraphic expression.<endouttext / >
1.1       www       174:        </foil >
                    175:        <foil name="trench" value="Convergent" >
1.3     ! lira      176:          <startouttext />A deep trench adjacent to a volcanic arc.
        !           177:           <endouttext / >
1.1       www       178:        </foil >
                    179:      </conceptgroup >
                    180:      <conceptgroup concept="volcanism" >
                    181:        <foil name="explosize" value="Convergent" >
1.3     ! lira      182:          <startouttext />Explosive volcanism involving volatile-rich 
        !           183:            viscous magma.<endouttext / >
1.1       www       184:        </foil >
                    185:        <foil name="fluid" value="Divergent" >
1.3     ! lira      186:          <startouttext />Non-explosive outpourings of low-viscosity 
        !           187:            magma.<endouttext / >
1.1       www       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')" 
        !           196:        name="quakes" / >
        !           197:      <optionhint concept="('volcanism' => 'incorrect')" 
        !           198:        name="volcactivity" / >
        !           199:      <optionhint concept="('topography' => 'incorrect')" 
        !           200:        name="relief" / >
1.1       www       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.
        !           206:         <endouttext / >
1.1       www       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 
        !           212:         elevated at mid-ocean ridges.<endouttext / >
1.1       www       213:      </hintpart >
                    214:      <hintpart on="relief" >
1.3     ! lira      215:        <startouttext / >On a broad scale topography is an expression 
        !           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.
        !           220:         <br / ><br / ><endouttext / >
1.1       www       221:      </hintpart >
                    222:     <hintpart on="default" >
1.3     ! lira      223:      <startouttext / >The characteristics of plate boundaries are 
        !           224:        described on page 52 of the textbook.<endouttext / >
1.1       www       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')"
                    239: name="igneous" ></radiobuttonhint >
                    240:   In order to trigger display of this hint you also need to create a
1.3     ! lira      241: <hintpart ></hintpart > block that will include a textblock that 
        !           242:   contains the text of the actual hint.
1.1       www       243:  <hintpart on="igneous" >
1.3     ! lira      244:   <startouttext />This type of rock is composed of interlocking 
        !           245:    crystals, a characteristic of igneous rocks.<endouttext / >
1.1       www       246:  </hintpart >
1.2       albertel  247: \end{verbatim}
                    248: 
1.1       www       249:   The complete radiobutton response would look as follows:
                    250:  
1.2       albertel  251: \begin{verbatim}
1.1       www       252: <problem >
                    253:  <startouttext />
                    254:  Which of the following is a sedimentary rock?
                    255:  <endouttext />
                    256: 
                    257:  <radiobuttonresponse max="3" randomize="yes" >
                    258:    <foilgroup >
                    259:      <foil location="random" value="false" name="granite" >
                    260:     <startouttext / >
                    261:      Granite
                    262:     <endouttext / >
                    263:    </foil >
                    264: 
                    265:    <foil location="random" value="false" name="gabbro" >
                    266:     <startouttext / >
                    267:      Gabbro
                    268:     <endouttext / >
                    269:    </foil >
                    270: 
                    271:    <foil location="random" value="false" name="schist">
                    272:     <startouttext / >
                    273:      Schist
                    274:     <endouttext />
                    275:    </foil >
                    276: 
                    277:    <foil location="random" value="false" name="gneiss" >
                    278:     <startouttext / >
                    279:      Gneiss
                    280:     <endouttext / >
                    281:    </foil >
                    282: 
                    283:    <foil location="random" value="true" name="shale" >
                    284:     <startouttext / >
                    285:      Shale
                    286:     <endouttext / >
                    287:    </foil >
                    288:       <foil location="random" value="true" name="sandstone" >
                    289:     <startouttext / >
                    290:      Sandstone
                    291:     <endouttext / >
                    292:    </foil >
                    293: 
                    294:   </foilgroup >
                    295:   <hintgroup >
                    296:    <radiobuttonhint answer="('foil','granite','gabbro')"
                    297: name="igneous" ></radiobuttonhint >
                    298:    <radiobuttonhint answer="('foil','gneiss','schist')"
                    299: name="metamorphic" ></radiobuttonhint >
                    300: 
                    301:    <hintpart on="igneous" >
1.3     ! lira      302:     <startouttext />This type of rock is composed of interlocking 
        !           303:       crystals, a characteristic of igneous rocks.<br / ><br / ><endouttext / >
1.1       www       304:    </hintpart >
                    305:    <hintpart on="metamorphic" >
                    306:     <startouttext />This type of rock is composed of oriented crystals, a
                    307: characteristic of foliated metamorphic rocks.<endouttext / >
                    308:    </hintpart >
                    309:   </hintgroup >
                    310:  </radiobuttonresponse >
                    311: </problem >
1.2       albertel  312: \end{verbatim}
1.1       www       313: 
1.3     ! lira      314: \item String Hint condition
        !           315: 
1.1       www       316: 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  317: 
                    318: \begin{verbatim}
1.1       www       319: <problem >
                    320:  <startouttext />Which US state has Lansing as its capital?<endouttext / >
                    321:   <stringresponse answer="Michigan" type="ci" >
                    322:   <textline size="20" / >
                    323:   <hintgroup >
                    324:    <stringhint answer="wisconsin" type="cs" name="wisc" >
                    325:    </stringhint >
                    326:    <stringhint answer="minnesota" type="cs" name="minn" >
                    327:    </stringhint >
                    328:    <hintpart on="wisc">
                    329:     <startouttext />The state capital of Wisconsin is Madison.<endouttext / >
                    330:    </hintpart >
                    331:    <hintpart on="minn">
                    332:     <startouttext />The state capital of Minnesota is St. Paul.<endouttext / >
                    333:    </hintpart >
                    334:    <hintpart on="default" >
1.3     ! lira      335:     <startouttext />The state you are looking for is also known as the 
        !           336:      'Great Lakes State'<endouttext / >
1.1       www       337:    </hintpart >     
                    338:   </hintgroup >
                    339:  </stringresponse >
                    340: </problem > 
1.2       albertel  341: \end{verbatim}
                    342: 
1.3     ! lira      343: \end{enumerate}

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