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

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

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

Revision 5550 Revision 5551
1loadMacros("MathObjects.pl","contextString.pl"); 1=head1 NAME
2
3contextABCD.pl - Contexts for matching problems.
2 4
3=head1 DESCRIPTION 5=head1 DESCRIPTION
4 6
5 ##########################################################
6 #
7 # Implements contexts for string-valued answers especially 7Implements contexts for string-valued answers especially
8 # for matching problems (where you match against A, B, C, D, 8for matching problems (where you match against A, B, C, D,
9 # and so on). 9and so on).
10 # 10
11 # There are two contexts defined here, 11There are two contexts defined here,
12 # 12
13 # Context("ABCD"); 13 Context("ABCD");
14 # Context("ABCD-List"); 14 Context("ABCD-List");
15 # 15
16 # The second allows the students to enter lists of strings, 16The second allows the students to enter lists of strings,
17 # while the first does not. 17while the first does not.
18 # 18
19 # You can add new strings to the context as needed (or remove old ones) 19You can add new strings to the context as needed (or remove old ones)
20 # via the Context()->strings->add() and Context()-strings->remove() 20via the Context()->strings->add() and Context()-strings->remove()
21 # methods, eg. 21methods, eg.
22 # 22
23 # Context("ABCD-List")->strings->add(E=>{},e=>{alias=>"E"}); 23 Context("ABCD-List")->strings->add(E=>{},e=>{alias=>"E"});
24 # 24
25 # Use string_cmp() to produce the answer checker(s) for your 25Use string_cmp() to produce the answer checker(s) for your
26 # correct values. Eg. 26correct values. Eg.
27 # 27
28 # ANS(string_cmp("A","B")); 28 ANS(string_cmp("A","B"));
29 # 29
30 # when there are two answers, the first being "A" and the second being "B". 30when there are two answers, the first being "A" and the second being "B".
31 #
32 31
33=cut 32=cut
33
34loadMacros("MathObjects.pl","contextString.pl");
34 35
35sub _contextABCD_init { 36sub _contextABCD_init {
36 my $context = $main::context{ABCD} = Parser::Context->getCopy("String"); 37 my $context = $main::context{ABCD} = Parser::Context->getCopy("String");
37 $context->{name} = "ABCD"; 38 $context->{name} = "ABCD";
38 $context->strings->are( 39 $context->strings->are(

Legend:
Removed from v.5550  
changed lines
  Added in v.5551

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9