[LON-CAPA-users] Answer display of the student's submission.
Gerd Kortemeyer
kortemey at msu.edu
Thu Jun 4 18:17:09 EDT 2015
Hi,
> On Jun 4, 2015, at 4:37 PM, Mills, Douglas G <dmills at illinois.edu> wrote:
>
> One way I've done this is to check in the script at the head of the
> problem to see if the question has been answered correctly and if so, set
> the correct answer to the student answer.
I assume this is customresponse or mathresponse.
The method that Doug describes actually always works.
Make some variable for your displayed answer, say $answer, and use that.
<problem>
<part id=“1”>
<script type=“loncapa/perl”>
…
$answer=“A correct answer is 42.”;
</script>
<solved>
<script type=“loncapa/perl">
$answer=“Your correct answer is “.&submission(1,11).”.”;
</script>
</solved>
<customresponse answerdisplay=“$answer” id="11">
…
</customresponse>
</part>
</problem>
- Gerd.
--
Gerd Kortemeyer, Ph.D.
Associate Professor of Physics
Director, LON-CAPA Project
Michigan State University
http://www.msu.edu/user/kortemey/
More information about the LON-CAPA-users
mailing list