[LON-CAPA-cvs] cvs: loncom /homework rankresponse.pm response.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Thu, 09 Sep 2004 18:34:29 -0000
albertel Thu Sep 9 14:34:29 2004 EDT
Modified files:
/loncom/homework rankresponse.pm response.pm
Log:
- my fix for scantron mode broke online mode, this should fix both
Index: loncom/homework/rankresponse.pm
diff -u loncom/homework/rankresponse.pm:1.37 loncom/homework/rankresponse.pm:1.38
--- loncom/homework/rankresponse.pm:1.37 Fri Sep 3 14:35:52 2004
+++ loncom/homework/rankresponse.pm Thu Sep 9 14:34:29 2004
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# rank style response
#
-# $Id: rankresponse.pm,v 1.37 2004/09/03 18:35:52 albertel Exp $
+# $Id: rankresponse.pm,v 1.38 2004/09/09 18:34:29 albertel Exp $
# Copyright Michigan State University Board of Trustees
#
# This file is part of the LearningOnline Network with CAPA (LON-CAPA).
@@ -198,8 +198,7 @@
my ($temp,$right,$wrong,$ignored)=(1,0,0,0);
my @correctorder=&get_correct_order($tol,@whichfoils);
foreach my $name (@whichfoils) {
- # get response returns a=>0, when we want a=>1
- my $response = &Apache::response::getresponse($temp)+1;
+ my $response = &Apache::response::getresponse($temp,'A is 1');
my $value=shift(@correctorder);
if ( $response =~ /[^\s]/) {
$responsehash{$name}=$response;
Index: loncom/homework/response.pm
diff -u loncom/homework/response.pm:1.102 loncom/homework/response.pm:1.103
--- loncom/homework/response.pm:1.102 Thu Sep 9 04:59:56 2004
+++ loncom/homework/response.pm Thu Sep 9 14:34:29 2004
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# various response type definitons response definition
#
-# $Id: response.pm,v 1.102 2004/09/09 08:59:56 albertel Exp $
+# $Id: response.pm,v 1.103 2004/09/09 18:34:29 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -533,6 +533,8 @@
$response;
if ($resulttype ne 'letter') {
$response = $let_to_num{$response};
+ } elsif ($resulttype ne 'A is 1') {
+ $response = $let_to_num{$response}+1;
}
} else {
$response = $ENV{$formparm};