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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5551 - (download) (as text) (annotate)
Tue Oct 2 20:48:05 2007 UTC (12 years, 2 months ago) by sh002i
File size: 904 byte(s)
improved formatting for docs -- these were in pod sections but were all
formatted as verbatim sections, and i moved them into normal paragraphs,
lists, etc. should make things more readable from the web.

    1 =head1 NAME
    2 
    3 contextTF.pl - Imlements contexts for true/false problems.
    4 
    5 =head1 DESCRIPTION
    6 
    7 Implements contexts for string-valued answers especially
    8 for matching problems (where you match against T and F).
    9 
   10     Context("TF");
   11 
   12 You can add new strings to the context as needed (or remove old ones)
   13 via the Context()->strings->add() and Context()-strings->remove()
   14 methods.
   15 
   16 Use:
   17 
   18     ANS(string_cmp("T","F"));
   19 
   20 when there are two answers, the first being "T" and the second being "F".
   21 
   22 =cut
   23 
   24 loadMacros("MathObjects.pl","contextString.pl");
   25 
   26 sub _contextTF_init {
   27 
   28   my $context = $main::context{TF} = Parser::Context->getCopy("String");
   29   $context->{name} = "TF";
   30   $context->strings->are(
   31     "T" => {value => 1},
   32     "F" => {value => 0},
   33     "True" => {alias => "T"},
   34     "False" => {alias => "F"},
   35   );
   36 
   37   main::Context("TF");  ### FIXME:  probably should require author to set this explicitly
   38 }
   39 
   40 1;

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9