Log Message:
-----------
Make fractions stringify with parentheses properly
Modified Files:
--------------
pg/macros:
contextFraction.pl
Revision Data
-------------
Index: contextFraction.pl
===================================================================
RCS file: /webwork/cvs/system/pg/macros/contextFraction.pl,v
retrieving revision 1.6
retrieving revision 1.7
diff -Lmacros/contextFraction.pl -Lmacros/contextFraction.pl -u -r1.6 -r1.7
--- macros/contextFraction.pl
+++ macros/contextFraction.pl
@@ -771,6 +771,12 @@
return $n;
}
+sub pdot {
+ my $self = shift; my $n = $self->string;
+ $n = '('.$n.')' if $n =~ m![^0-9]!; # add parens if not just a number
+ return $n;
+}
+
###########################################################################
#
# Answer Checker
|