--- loncom/homework/grades.pm 2004/09/24 21:09:33 1.214
+++ loncom/homework/grades.pm 2005/04/01 23:56:52 1.252
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# The LON-CAPA Grading handler
#
-# $Id: grades.pm,v 1.214 2004/09/24 21:09:33 albertel Exp $
+# $Id: grades.pm,v 1.252 2005/04/01 23:56:52 banghart Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -25,16 +25,6 @@
#
# http://www.lon-capa.org/
#
-# 2/9,2/13 Guy Albertelli
-# 6/8 Gerd Kortemeyer
-# 7/26 H.K. Ng
-# 8/20 Gerd Kortemeyer
-# Year 2002
-# June-August H.K. Ng
-# Year 2003
-# February, March H.K. Ng
-# July, H. K. Ng
-#
package Apache::grades;
use strict;
@@ -101,31 +91,12 @@ sub get_symb_and_url {
return ($symb,$url);
}
-# --- Retrieve the fullname for a user. Return lastname, first middle ---
-# --- Generation is attached next to the lastname if it exists. ---
-sub get_fullname {
- my ($uname,$udom) = @_;
- my %name=&Apache::lonnet::get('environment', ['lastname','generation',
- 'firstname','middlename'],
- $udom,$uname);
- my $fullname;
- my ($tmp) = keys(%name);
- if ($tmp !~ /^(con_lost|error|no_such_host)/i) {
- $fullname = &Apache::loncoursedata::ProcessFullName
- (@name{qw/lastname generation firstname middlename/});
- } else {
- &Apache::lonnet::logthis('grades.pm: no name data for '.$uname.
- '@'.$udom.':'.$tmp);
- }
- return $fullname;
-}
-
#--- Format fullname, username:domain if different for display
#--- Use anywhere where the student names are listed
sub nameUserString {
my ($type,$fullname,$uname,$udom) = @_;
if ($type eq 'header') {
- return ' Fullname (Username) ';
+ return ' Fullname (Username)';
} else {
return ' '.$fullname.' ('.$uname.
($ENV{'user.domain'} eq $udom ? '' : ' ('.$udom.')').')';
@@ -693,17 +664,21 @@ LISTJAVASCRIPT
$gradeTable.='To '.lc($viewgrade).' a submission or a group of submissions, click on the check box(es) '.
'next to the student\'s name(s). Then click on the Next button. '."\n".
''."\n";
+
+# checkall buttons
+ $gradeTable.=&check_script('gradesub', 'stuinfo');
$gradeTable.='" />'."\n";
+ 'value="Next->" /> '."\n";
+ $gradeTable.=&check_buttons();
$gradeTable.='Check For Plagiarism';
- my (undef, undef, $fullname) = &getclasslist($getsec,'1');
+ my ($classlist, undef, $fullname) = &getclasslist($getsec,'1');
$gradeTable.='
'.
'
';
my $loop = 0;
while ($loop < 2) {
$gradeTable.='
No.
Select
'.
- '
'.&nameUserString('header').'
';
+ '
'.&nameUserString('header').' Section/Group
';
if ($ENV{'form.showgrading'} eq 'yes' && $submitonly ne 'all') {
foreach (sort(@$partlist)) {
my $display_part=&get_display_part((split(/_/))[0],$url,$symb);
@@ -724,10 +699,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;
@@ -737,20 +714,25 @@ 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++;
+ my $section = $classlist->{$student}->[&Apache::loncoursedata::CL_SECTION()];
+
if ( $perm{'vgr'} eq 'F' ) {
$gradeTable.='