Annotation of loncom/homework/templates/stringPrePro.problem, revision 1.1
1.1 ! www 1: <problem>
! 2: <script type="loncapa/perl">$idx=&random(0,2,1);
! 3: $word=('Maus','Horn','Huhn')[$idx];
! 4: $plural=('Mäuse','Hörner','Hühner')[$idx];
! 5:
! 6: sub umlaute {
! 7: my $answer=shift;
! 8: $answer=~s/ae/ä/g;
! 9: $answer=~s/oe/ö/g;
! 10: $answer=~s/ue/ü/g;
! 11: return $answer;
! 12: }</script>
! 13:
! 14: <startouttext />
! 15: What is the plural of German "$word"?
! 16: <endouttext />
! 17:
! 18: <stringresponse answer="$plural" type="cs" preprocess="umlaute">
! 19: <textline readonly="no" addchars="Ä,Ö,Ü,ä,ö,ü,ß"></textline>
! 20:
! 21: </stringresponse>
! 22:
! 23: </problem>
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>