--- loncom/homework/rankresponse.pm 2005/01/10 19:21:57 1.43
+++ loncom/homework/rankresponse.pm 2005/06/20 21:31:07 1.46
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# rank style response
#
-# $Id: rankresponse.pm,v 1.43 2005/01/10 19:21:57 albertel Exp $
+# $Id: rankresponse.pm,v 1.46 2005/06/20 21:31:07 albertel Exp $
# Copyright Michigan State University Board of Trustees
#
# This file is part of the LearningOnline Network with CAPA (LON-CAPA).
@@ -177,7 +177,7 @@ sub displayanswers {
sub check_response_order {
my (%responsehash)=@_;
- my @order=sort(values(%responsehash));
+ my @order=sort( {$a <=> $b} values(%responsehash));
my $lastvalue=0;
my $expected=1;
my $malformed=0;
@@ -195,7 +195,7 @@ sub check_response_order {
sub grade_response {
my ($max,$randomize,$tol)=@_;
my (@whichfoils)=&whichfoils($max,$randomize);
- if (!defined($ENV{'form.submitted'})) { return; }
+ if (!&Apache::response::submitted()) { return; }
my %responsehash;
my %grade;
my ($temp,$right,$wrong,$ignored)=(1,0,0,0);
@@ -263,8 +263,11 @@ sub displayfoils {
foreach my $name (@whichfoils) {
my $text=$Apache::response::foilgroup{$name.'.text'};
my $value=shift(@correctorder);
- if ($target eq 'web') {$result.='
';} else {$result.=' \strut\\\\\strut ';}
- $result.=$value.':'.$text;
+ if ($target eq 'web') {
+ $result.='
'.$value.': '.$text;
+ } else {
+ $result.=' \strut\\\\\strut '.$value.':'.$text;
+ }
}
} else {
my $i = 0;