--- loncom/homework/grades.pm 2003/07/29 20:54:39 1.128
+++ loncom/homework/grades.pm 2003/07/31 15:08:41 1.129
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# The LON-CAPA Grading handler
#
-# $Id: grades.pm,v 1.128 2003/07/29 20:54:39 ng Exp $
+# $Id: grades.pm,v 1.129 2003/07/31 15:08:41 ng Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -96,6 +96,18 @@ sub get_fullname {
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) ';
+ } else {
+ return ' '.$fullname.' ('.$uname.
+ ($ENV{'user.domain'} eq $udom ? '' : ' ('.$udom.')').')';
+ }
+}
+
#--- Get the partlist and the response type for a given problem. ---
#--- Indicate if a response type is coded handgraded or not. ---
sub response_type {
@@ -539,8 +551,7 @@ LISTJAVASCRIPT
my $loop = 0;
while ($loop < 2) {
$gradeTable.='
No.
Select
'.
- '
Fullname '.
- '(Username)
';
+ '
'.&nameUserString('header').'
';
if ($ENV{'form.showgrading'} eq 'yes' && $submitonly ne 'all') {
foreach (sort(@$partlist)) {
$gradeTable.='
'."\n";
if ($ENV{'form.showgrading'} eq 'yes' && $submitonly ne 'all') {
foreach (sort keys(%status)) {
@@ -758,7 +768,9 @@ sub sub_page_js {
var points = formname["GD_BOX"+i+"_"+partid].value;
if (points == "") {
var name = formname["name"+i].value;
- var resp = confirm("You did not assign a score for "+name+", part "+partid+". Continue?");
+ var studentID = (name != '' ? name : formname["unamedom"+i].value);
+ var resp = confirm("You did not assign a score for "+studentID+
+ ", part "+partid+". Continue?");
if (resp == false) {
formname["GD_BOX"+i+"_"+partid].focus();
return false;
@@ -1351,9 +1363,7 @@ KEYWORDS
my $result='
'."\n".
'
'."\n";
- $result.='Fullname: '.$ENV{'form.fullname'}.
- ' Username: '.$uname.
- ($ENV{'user.domain'} eq $udom ? '' : ' ('.$udom.')').' '."\n";
+ $result.='Fullname: '.&nameUserString(undef,$ENV{'form.fullname'},$uname,$udom).' '."\n";
$result.=''."\n";
@@ -1531,17 +1541,21 @@ KEYWORDS
my %seen = ();
my @partlist;
+ my @gradePartRespid;
for (sort keys(%$handgrade)) {
my ($partid,$respid) = split(/_/);
next if ($seen{$partid} > 0);
$seen{$partid}++;
next if ($$handgrade{$_} =~ /:no$/ && $ENV{'form.lastSub'} =~ /^(hdgrade)$/);
push @partlist,$partid;
+ push @gradePartRespid,$partid.'.'.$respid;
$request->print(&gradeBox($request,$symb,$uname,$udom,$counter,$partid,\%record));
}
$result=''."\n";
+ $result.=''."\n" if ($counter == 0);
my $ctr = 0;
while ($ctr < scalar(@partlist)) {
$result.=''."\n".
'
No.
'.
- '
Fullname (Username)
'."\n";
+ '
'.&nameUserString('header')."
\n";
my (@parts) = sort(&getpartlist($url));
foreach my $part (@parts) {
my $display=&Apache::lonnet::metadata($url,$part.'.display');
@@ -2216,8 +2231,9 @@ sub editgrades {
$title.='Section: '.$ENV{'form.section'}.''."\n";
my $result= '
'."\n";
- $result.= '
No.
'.
- '
Fullname (username)
'."\n";
+ $result.= '
'.
+ '
No.
'.
+ '
'.&nameUserString('header')."
\n";
my %scoreptr = (
'correct' =>'correct_by_override',
@@ -2276,8 +2292,7 @@ sub editgrades {
my ($uname,$udom)=split(/_/,$user);
my %newrecord;
my $updateflag = 0;
- $line .= '