[LON-CAPA-users] customresponse / customhint

Christina möller christina.moeller at fh-stralsund.de
Thu Jul 25 03:13:13 EDT 2013


Hello LC-Community,

is there anyone, who has an example for <customhint>?
I try it like the <Egyptian Fraction>-example, but it doesn´t work.

What am I doing wrong?

Thanks.

%<-------- my problem-code

#$term = "2*a*(13*b*c-2*d)";
#$answer = &cas("maxima","ratsimp($term);");
#$term =~s/\*//g;

<customresponse answerdisplay="$answer" id="11">

<textline readonly="no" size="25"></textline>
<hintgroup showoncorrect="no">

<answer type="loncapa/perl">
$frommaxima = &cas('maxima',"is($submission = $answer);");
if ($frommaxima=~/^\s*true\s*$/i){ return 'EXACT_ANS';}
if ($submission eq $answer) { return 'EXACT_ANS'; }
return 'INCORRECT';
</answer>


<customhint name="format" >
<answer type="loncapa/perl">
if ($submission=~/\(/) { return 'INCORRECT'; }
if ($submission==$term){ return 'INCORRECT'; }
return 'INCORRECT';
</answer>

</customhint>

<hintpart on="format">
<startouttext />
<p>Customhint format </p>
<endouttext />
</hintpart>

</hintgroup>

</customresponse>

---------->%



More information about the LON-CAPA-users mailing list