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, 8 months ago) by
www
Branches:
MAIN
CVS tags:
version_2_12_X,
version_2_11_X,
version_2_11_6_msu,
version_2_11_6,
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
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>