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

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

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