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

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

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

Revision 5556 Revision 5843
1################################################################################ 1################################################################################
2# WeBWorK Online Homework Delivery System 2# WeBWorK Online Homework Delivery System
3# Copyright 2000-2007 The WeBWorK Project, http://openwebwork.sf.net/ 3# Copyright 2000-2007 The WeBWorK Project, http://openwebwork.sf.net/
4# $CVSHeader: webwork2/lib/WeBWorK.pm,v 1.100 2007/08/13 22:59:53 sh002i Exp $ 4# $CVSHeader: pg/macros/contextIntegerFunctions.pl,v 1.11 2007/10/04 16:40:48 sh002i Exp $
5# 5#
6# This program is free software; you can redistribute it and/or modify it under 6# This program is free software; you can redistribute it and/or modify it under
7# the terms of either: (a) the GNU General Public License as published by the 7# the terms of either: (a) the GNU General Public License as published by the
8# Free Software Foundation; either version 2, or (at your option) any later 8# Free Software Foundation; either version 2, or (at your option) any later
9# version, or (b) the "Artistic License" which comes with this package. 9# version, or (b) the "Artistic License" which comes with this package.
44 44
45loadMacros('MathObjects.pl'); 45loadMacros('MathObjects.pl');
46 46
47sub _contextIntegerFunctions_init {context::IntegerFunctions2::Init()}; # don't reload this file 47sub _contextIntegerFunctions_init {context::IntegerFunctions2::Init()}; # don't reload this file
48 48
49package context::IntegerFunction2; 49package context::IntegerFunctions2;
50our @ISA = qw(Parser::Function::numeric2); # checks for 2 numeric inputs 50our @ISA = qw(Parser::Function::numeric2); # checks for 2 numeric inputs
51 51
52sub C { 52sub C {
53 shift; my ($n,$r) = @_; my $C = 1; 53 shift; my ($n,$r) = @_; my $C = 1;
54 return (0) if($r>$n); 54 return (0) if($r>$n);
67sub Init { 67sub Init {
68 my $context = $main::context{IntegerFunctions} = Parser::Context->getCopy("Numeric"); 68 my $context = $main::context{IntegerFunctions} = Parser::Context->getCopy("Numeric");
69 $context->{name} = "IntegerFunctions"; 69 $context->{name} = "IntegerFunctions";
70 70
71 $context->functions->add( 71 $context->functions->add(
72 C => {class => 'context::IntegerFunction2'}, 72 C => {class => 'context::IntegerFunctions2'},
73 P => {class => 'context::IntegerFunction2'}, 73 P => {class => 'context::IntegerFunctions2'},
74 ); 74 );
75 75
76 main::Context("IntegerFunctions"); 76 main::Context("IntegerFunctions");
77} 77}
78 78

Legend:
Removed from v.5556  
changed lines
  Added in v.5843

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9