--- loncom/homework/grades.pm 2009/01/16 10:59:52 1.548
+++ loncom/homework/grades.pm 2009/03/06 21:14:50 1.555
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# The LON-CAPA Grading handler
#
-# $Id: grades.pm,v 1.548 2009/01/16 10:59:52 bisitz Exp $
+# $Id: grades.pm,v 1.555 2009/03/06 21:14:50 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -268,12 +268,37 @@ sub reset_caches {
sub get_radiobutton_correct_foil {
my ($partid,$respid,$symb,$uname,$udom)=@_;
my $analyze = &get_analyze($symb,$uname,$udom);
- foreach my $foil (@{&get_order($partid,$respid,$symb,$uname,$udom)}) {
- if ($analyze->{"$partid.$respid.foil.value.$foil"} eq 'true') {
- return $foil;
+ my $foils = &get_order($partid,$respid,$symb,$uname,$udom);
+ if (ref($foils) eq 'ARRAY') {
+ foreach my $foil (@{$foils}) {
+ if ($analyze->{"$partid.$respid.foil.value.$foil"} eq 'true') {
+ return $foil;
+ }
}
}
}
+
+ sub scantron_partids_tograde {
+ my ($resource,$cid,$uname,$udom) = @_;
+ my (%analysis,@parts);
+ if (ref($resource)) {
+ my $symb = $resource->symb();
+ my $analyze = &get_analyze($symb,$uname,$udom);
+ if (ref($analyze) eq 'HASH') {
+ %analysis = %{$analyze};
+ }
+ if (ref($analysis{'parts'}) eq 'ARRAY') {
+ foreach my $part (@{$analysis{'parts'}}) {
+ my ($id,$respid) = split(/\./,$part);
+ if (!&Apache::loncommon::check_if_partid_hidden($id,$symb,$udom,$uname)) {
+ push(@parts,$part);
+ }
+ }
+ }
+ }
+ return (\%analysis,\@parts);
+ }
+
}
#--- Clean response type for display
@@ -699,7 +724,7 @@ sub verifyreceipt {
my $title.=
'
'.
- &mt('Verifying Submission Receipt [_1]',$receipt).
+ &mt('Verifying Receipt No. [_1]',$receipt).
'
'."\n".
''.&mt('Resource: [_1]',$env{'form.probTitle'}).
'
'."\n";
@@ -2105,7 +2130,7 @@ KEYWORDS
}
$lastsubonly.=''.&mt('Submitted Answer:').' '.
&cleanRecord($subval,$responsetype,$symb,$partid,
- $respid,\%record,$order);
+ $respid,\%record,$order,undef,$uname,$udom);
if ($similar) {$lastsubonly.="
$similar\n";}
$lastsubonly.='';
}
@@ -2234,7 +2259,7 @@ KEYWORDS
''."\n";
my $nsel = ($env{'form.NTSTU'} ne '' ? $env{'form.NTSTU'} : '1');
$ntstu =~ s/