--- loncom/homework/grades.pm 2003/10/21 21:46:15 1.144
+++ loncom/homework/grades.pm 2003/10/28 23:20:03 1.145
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# The LON-CAPA Grading handler
#
-# $Id: grades.pm,v 1.144 2003/10/21 21:46:15 albertel Exp $
+# $Id: grades.pm,v 1.145 2003/10/28 23:20:03 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -572,18 +572,21 @@ LISTJAVASCRIPT
my %status = ();
if ($ENV{'form.showgrading'} eq 'yes' && $submitonly ne 'all') {
(%status) =&student_gradeStatus($url,$symb,$udom,$uname,$partlist);
- my $statusflg = '';
+ my $submitted = 0;
+ my $graded = 1;
foreach (keys(%status)) {
- $statusflg = 1 if ($status{$_} ne 'nothing');
+ $submitted = 1 if ($status{$_} ne 'nothing');
+ $graded = 0 if ($status{$_} =~ /^correct/);
my ($foo,$partid,$foo1) = split(/\./,$_);
if ($status{'resource.'.$partid.'.submitted_by'} ne '') {
- $statusflg = '';
+ $submitted = 0;
$gradeTable.='';
}
}
- next if ($statusflg eq '' && $submitonly eq 'yes');
+ next if (!$submitted && ($submitonly eq 'yes' || $submitonly eq 'graded'));
+ next if (!$graded && $submitonly eq 'graded');
}
$ctr++;
@@ -625,7 +628,7 @@ LISTJAVASCRIPT
} else {
$gradeTable='
'.
'No submissions found for this resource for any students. ('.$num_students.
- ' checked for submissions
';
+ ' checked for submissions)
';
}
} elsif ($ctr == 1) {
$gradeTable =~ s/type=checkbox/type=checkbox checked/;
@@ -1830,15 +1833,25 @@ sub processHandGrade {
}
$ctr = 0;
@parsedlist = reverse @parsedlist if ($button eq 'Previous');
+ my ($partlist) = &response_type($url);
foreach my $student (@parsedlist) {
+ my $submitonly=$ENV{'form.submitonly'};
my ($uname,$udom) = split(/:/,$student);
- if ($ENV{'form.submitonly'} eq 'yes') {
- my %record = &Apache::lonnet::restore($symb,$ENV{'request.course.id'},$udom,$uname);
- my $statusflg = '';
- foreach (split(/:/,$ENV{'form.gradePartRespid'})){
- $statusflg = 1 if (exists ($record{'resource.'.$_.'.submission'}));
+ if ($submitonly =~ /^(yes|graded)$/) {
+# my %record = &Apache::lonnet::restore($symb,$ENV{'request.course.id'},$udom,$uname);
+ my %status=&student_gradeStatus($url,$symb,$udom,$uname,$partlist);
+ my $submitted = 0;
+ my $graded = 1;
+ foreach (keys(%status)) {
+ $submitted = 1 if ($status{$_} ne 'nothing');
+ $graded = 0 if ($status{$_} =~ /^correct/);
+ my ($foo,$partid,$foo1) = split(/\./,$_);
+ if ($status{'resource.'.$partid.'.submitted_by'} ne '') {
+ $submitted = 0;
+ }
}
- next if ($statusflg eq '');
+ next if (!$submitted && ($submitonly eq 'yes' || $submitonly eq 'graded'));
+ next if (!$graded && $submitonly eq 'graded');
}
push @nextlist,$student if ($ctr < $ntstu);
last if ($ctr == $ntstu);
@@ -3551,7 +3564,7 @@ sub gradingmenu {
}
formname.command.value = cmd;
formname.saveState.value = "saveCmd="+cmdsave+":saveSec="+pullDownSelection(formname.section)+
- ":saveSub="+radioSelection(formname.submitonly)+":saveStatus="+pullDownSelection(formname.Status);
+ ":saveSub="+pullDownSelection(formname.submitonly)+":saveStatus="+pullDownSelection(formname.Status);
if (val < 5) formname.submit();
if (val == 5) {
if (!checkReceiptNo(formname,'notOK')) { return false;}
@@ -3619,12 +3632,14 @@ GRADINGMENUJS
$result.='