From: dpvc v. a. <we...@ma...> - 2009-01-15 12:59:46
|
Log Message: ----------- Make Ordering() break a string at > and = rather than assume the variable names are single letters. Modified Files: -------------- pg/macros: contextOrdering.pl Revision Data ------------- Index: contextOrdering.pl =================================================================== RCS file: /webwork/cvs/system/pg/macros/contextOrdering.pl,v retrieving revision 1.5 retrieving revision 1.6 diff -Lmacros/contextOrdering.pl -Lmacros/contextOrdering.pl -u -r1.5 -r1.6 --- macros/contextOrdering.pl +++ macros/contextOrdering.pl @@ -32,7 +32,7 @@ would both produce the same ordering. The first form gives the ordering as the student must type it, and the second gives the ordering by specifying numeric values for the various letters that -determine the resulting order. Note that equality is determined using +induce the resulting order. Note that equality is determined using the default tolerances for the Ordering context. You can change these using commands like the following: @@ -149,8 +149,8 @@ unless $context->{name} =~ m/Ordering/; if (scalar(@_) == 1) { $string = shift; - my $letters = $string; $letters =~ s/[^A-Z]//ig; - context::Ordering::Letters($context,split(//,$letters)); + my $letters = $string; $letters =~ s/ //g; + context::Ordering::Letters($context,split(/[>=]/,$letters)); } else { my %letter = @_; my @letters = keys %letter; context::Ordering::Letters($context,@letters); |