[Lon-capa-users] numericalhint

Ray Batchelor lon-capa-users@mail.lon-capa.org
Sun, 10 Feb 2002 15:12:34 -0800


Hi Guy,
Sorry, I tried it your way and it works the same as before.
That is, the conditional hint text only appears if the response 
submitted was exactly $TKwrongans to 15 sig figs.   (It did not matter 
whether I specified the default tolerance on the numerical hint as a 
variable or as 10%.)  
If the response was less than 15 sig figs, then only the general hint 
text appeared. 

Cheers,
Ray  
 
On Sunday 10 February 2002 09:33 am, you wrote:
> Hi Ray,
>
> I hav rewritten this to be something that should work.
>
> (The most important change was changing the name="tolTKwrong" to
> name="tol")
>
> *IMPORTANT* the name field is the _internal_name_ used to identify
> information, tolerances _must_ be stored with a name="tol", sigfigs
> _must_ be stored with name="sig"
>
> (Let me know if the variable default works, that might or might not.)
> (It is might work in a non intuitave manner, I'd test with a fixed
> tol, and then try the variable out)
>
>
> <numericalresponse answer="$ans" unit="J/g/K" format="1E">
> 	<responseparam name="tol" type="tolerance" description="Numerical
> Tolerance" default="$tolans" /> <responseparam name="sig"
> type="int_range,0-16" default="0,15" description="Significant
> Figures" /> <textline />
>
> 	<hintgroup>
> 		<numericalhint answer="$TKwrongans" unit="J/g/K" format="1E"
> name="TKwrong"> <responseparam name="tol" type="tolerance" 
> description="tolerance on answer to trigger numerical hint" 
> default="$tolTKwrongans" /> </numericalhint>
> 		<hintpart on="TKwrong">
>     			<startouttext />
> 				The conditional hint text would go here.
> 			<endouttext />
> 		</hintpart>
> 		<hintpart on="default">
> 	 		<startouttext />
> 				The general hint text goes here.
> 		 	<endouttext />
> 		</hintpart>
> 	</hintgroup>
> </numericalresponse>