[LON-CAPA-cvs] cvs: loncom /publisher testbankimport.pm
raeburn
lon-capa-cvs@mail.lon-capa.org
Fri, 23 Apr 2004 22:42:06 -0000
raeburn Fri Apr 23 18:42:06 2004 EDT
Modified files:
/loncom/publisher testbankimport.pm
Log:
Fix lowercasing of testbank answers.
Index: loncom/publisher/testbankimport.pm
diff -u loncom/publisher/testbankimport.pm:1.3 loncom/publisher/testbankimport.pm:1.4
--- loncom/publisher/testbankimport.pm:1.3 Fri Feb 20 13:18:27 2004
+++ loncom/publisher/testbankimport.pm Fri Apr 23 18:42:05 2004
@@ -1,5 +1,5 @@
# Handler for parsing text upload problem descriptions into .problems
-# $Id: testbankimport.pm,v 1.3 2004/02/20 18:18:27 albertel Exp $
+# $Id: testbankimport.pm,v 1.4 2004/04/23 22:42:05 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1130,7 +1130,7 @@
for (my $k=$numitems+$start[$i]-1; $k<$numitems+$end[$i]; $k++) {
@{$answers{$k}} = ();
if ($qtype[$i] eq "MC") {
- lc $items[$k];
+ $items[$k] =~ tr/A-Z/a-z/;
$items[$k] =~ s/\W//g;
if ($foilformats[$i] eq "lcperiod" || $foilformats[$i] eq "lcparen" || $foilformats[$i] eq "ucparen" || $foilformats[$i] eq "ucperiod") {
for (my $j=0; $j<@alphabet; $j++) {
@@ -1148,7 +1148,7 @@
}
}
} elsif (($qtype[$i] eq "MA") || ($qtype[$i] eq "Ord")) {
- lc $items[$k];
+ $items[$k] =~ tr/A-Z/a-z/;
my @corrects = split/$patterns{$ansrtypes[$i]}/,$items[$k];
foreach my $correct (@corrects) {
$correct =~s/\W//g;