[system] / trunk / pg / macros / contextTF.pl Repository:
ViewVC logotype

Diff of /trunk/pg/macros/contextTF.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 3334 Revision 4997
1loadMacros("Parser.pl","contextString.pl"); 1loadMacros("Parser.pl","contextString.pl");
2 2
3sub _contextTF_init {}; # don't load it again 3sub _contextTF_init {}; # don't load it again
4
5=head3 Context("TF")
4 6
5########################################################## 7##########################################################
6# 8#
7# Implements contexts for string-valued answers especially 9# Implements contexts for string-valued answers especially
8# for matching problems (where you match against T and F). 10# for matching problems (where you match against T and F).
11# 13#
12# You can add new strings to the context as needed (or remove old ones) 14# You can add new strings to the context as needed (or remove old ones)
13# via the Context()->strings->add() and Context()-strings->remove() 15# via the Context()->strings->add() and Context()-strings->remove()
14# methods. 16# methods.
15# 17#
16# Use 18# Use:
17# 19#
18# ANS(string_cmp("T","F")); 20# ANS(string_cmp("T","F"));
19# 21#
20# when there are two answers, the first being "T" and the second being "F". 22# when there are two answers, the first being "T" and the second being "F".
21# 23#
24
25=cut
22 26
23$context{TF} = Context("String")->copy; 27$context{TF} = Context("String")->copy;
24$context{TF}->strings->are( 28$context{TF}->strings->are(
25 "T" => {value => 1}, 29 "T" => {value => 1},
26 "F" => {value => 0}, 30 "F" => {value => 0},

Legend:
Removed from v.3334  
changed lines
  Added in v.4997

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9