File:
[LON-CAPA] /
loncom /
homework /
templates /
stringPrePro.problem
Revision
1.1:
download - view:
text,
annotated -
select for diffs
Wed Jun 8 20:38:53 2011 UTC (13 years, 6 months ago) by
www
Branches:
MAIN
CVS tags:
version_2_12_X,
version_2_11_X,
version_2_11_5_msu,
version_2_11_5,
version_2_11_4_uiuc,
version_2_11_4_msu,
version_2_11_4,
version_2_11_3_uiuc,
version_2_11_3_msu,
version_2_11_3,
version_2_11_2_uiuc,
version_2_11_2_msu,
version_2_11_2_educog,
version_2_11_2,
version_2_11_1,
version_2_11_0_RC3,
version_2_11_0_RC2,
version_2_11_0_RC1,
version_2_11_0,
version_2_10_X,
version_2_10_1,
loncapaMITrelate_1,
language_hyphenation_merge,
language_hyphenation,
HEAD,
BZ4492-merge,
BZ4492-feature_horizontal_radioresponse,
BZ4492-feature_Support_horizontal_radioresponse,
BZ4492-Support_horizontal_radioresponse
Bug #2020: pre-processing of numerical, formula, and string response
Bug #5100: degrees Fahrenheit, etc
<problem>
<script type="loncapa/perl">$idx=&random(0,2,1);
$word=('Maus','Horn','Huhn')[$idx];
$plural=('Mäuse','Hörner','Hühner')[$idx];
sub umlaute {
my $answer=shift;
$answer=~s/ae/ä/g;
$answer=~s/oe/ö/g;
$answer=~s/ue/ü/g;
return $answer;
}</script>
<startouttext />
What is the plural of German "$word"?
<endouttext />
<stringresponse answer="$plural" type="cs" preprocess="umlaute">
<textline readonly="no" addchars="Ä,Ö,Ü,ä,ö,ü,ß"></textline>
</stringresponse>
</problem>
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>