--- loncom/homework/grades.pm 2004/11/23 14:37:33 1.232
+++ loncom/homework/grades.pm 2005/02/18 23:36:12 1.248
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# The LON-CAPA Grading handler
#
-# $Id: grades.pm,v 1.232 2004/11/23 14:37:33 albertel Exp $
+# $Id: grades.pm,v 1.248 2005/02/18 23:36:12 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -695,10 +695,12 @@ LISTJAVASCRIPT
(%status) =&student_gradeStatus($url,$symb,$udom,$uname,$partlist);
my $submitted = 0;
my $graded = 0;
+ my $incorrect = 0;
foreach (keys(%status)) {
$submitted = 1 if ($status{$_} ne 'nothing');
- $graded = 1 if ($status{$_} !~ /^correct/);
-
+ $graded = 1 if ($status{$_} =~ /^ungraded/);
+ $incorrect = 1 if ($status{$_} =~ /^incorrect/);
+
my ($foo,$partid,$foo1) = split(/\./,$_);
if ($status{'resource.'.$partid.'.submitted_by'} ne '') {
$submitted = 0;
@@ -708,11 +710,12 @@ LISTJAVASCRIPT
$status{'resource.'.$partid.'.submitted_by'}.'" />';
}
}
+
next if (!$submitted && ($submitonly eq 'yes' ||
$submitonly eq 'incorrect' ||
$submitonly eq 'graded'));
- next if (!$graded && ($submitonly eq 'graded' ||
- $submitonly eq 'incorrect'));
+ next if (!$graded && ($submitonly eq 'graded'));
+ next if (!$incorrect && $submitonly eq 'incorrect');
}
$ctr++;
@@ -720,7 +723,7 @@ LISTJAVASCRIPT
$gradeTable.='
' if ($ctr%2 ==1);
$gradeTable.=''.$ctr.' | '.
' | '."\n".
+ $student.':'.$$fullname{$student}.' " />'."\n".
''.&nameUserString(undef,$$fullname{$student},$uname,$udom).' | '."\n";
if ($ENV{'form.showgrading'} eq 'yes' && $submitonly ne 'all') {
@@ -973,6 +976,7 @@ sub sub_page_kw_js {
my $iconpath = $request->dir_config('lonIconsURL');
&commonJSfunctions($request);
my $docopen=&Apache::lonhtmlcommon::javascript_docopen();
+ $docopen=~s/^document\.//;
$request->print(<
@@ -1689,6 +1693,7 @@ KEYWORDS
&Apache::lonnet::allowuploaded('/adm/grades',$file);
$lastsubonly.='
'.$file.'';
}
+ $lastsubonly.='
';
}
$lastsubonly.='Submitted Answer: '.
&cleanRecord($subval,$responsetype,$symb,$partid,
@@ -2004,10 +2009,12 @@ sub processHandGrade {
# 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;
+ my $ungraded = 0;
+ my $incorrect = 0;
foreach (keys(%status)) {
$submitted = 1 if ($status{$_} ne 'nothing');
- $graded = 0 if ($status{$_} =~ /^correct/);
+ $ungraded = 1 if ($status{$_} =~ /^ungraded/);
+ $incorrect = 1 if ($status{$_} =~ /^incorrect/);
my ($foo,$partid,$foo1) = split(/\./,$_);
if ($status{'resource.'.$partid.'.submitted_by'} ne '') {
$submitted = 0;
@@ -2016,8 +2023,8 @@ sub processHandGrade {
next if (!$submitted && ($submitonly eq 'yes' ||
$submitonly eq 'incorrect' ||
$submitonly eq 'graded'));
- next if (!$graded && ($submitonly eq 'graded' ||
- $submitonly eq 'incorrect'));
+ next if (!$ungraded && ($submitonly eq 'graded'));
+ next if (!$incorrect && $submitonly eq 'incorrect');
}
push @nextlist,$student if ($ctr < $ntstu);
last if ($ctr == $ntstu);
@@ -2402,9 +2409,6 @@ sub viewgrades {
my (undef,undef,$fullname) = &getclasslist($ENV{'form.section'},'1');
my $ctr = 0;
foreach (sort {lc($$fullname{$a}) cmp lc($$fullname{$b}) } keys %$fullname) {
- my $uname = $_;
- $uname=~s/:/_/;
- $result.=''."\n";
$ctr++;
$result.=&viewstudentgrade($url,$symb,$ENV{'request.course.id'},
$_,$$fullname{$_},\@parts,\%weight,$ctr);
@@ -2428,18 +2432,21 @@ sub viewstudentgrade {
my ($uname,$udom) = split(/:/,$student);
$student=~s/:/_/;
my %record=&Apache::lonnet::restore($symb,$courseid,$udom,$uname);
- my $result=''.$ctr.' | '.
+ my $result=' |
'.
+ ''.
+ "\n".$ctr.' | '.
''.$fullname.' '.
'('.$uname.($ENV{'user.domain'} eq $udom ? '' : ':'.$udom).') | '."\n";
foreach my $apart (@$parts) {
my ($part,$type) = &split_part_type($apart);
my $score=$record{"resource.$part.$type"};
+ $result.='';
if ($type eq 'awarded') {
my $pts = $score eq '' ? '' : $score*$$weight{$part};
$result.=''."\n";
- $result.=' | | '."\n";
@@ -2448,7 +2455,7 @@ sub viewstudentgrade {
$status = 'nothing' if ($status eq '');
$result.=''."\n";
- $result.=' |