version 1.149, 2003/11/07 18:05:33
|
version 1.150, 2003/11/07 19:10:51
|
Line 665 LISTJAVASCRIPT
|
Line 665 LISTJAVASCRIPT
|
my ($foo,$partid,$foo1) = split(/\./,$_); |
my ($foo,$partid,$foo1) = split(/\./,$_); |
if ($status{'resource.'.$partid.'.submitted_by'} ne '') { |
if ($status{'resource.'.$partid.'.submitted_by'} ne '') { |
$submitted = 0; |
$submitted = 0; |
|
my ($part)=split(/\./,$partid); |
$gradeTable.='<input type="hidden" name="'. |
$gradeTable.='<input type="hidden" name="'. |
$student.':submitted_by" value="'. |
$student.':'.$part.':submitted_by" value="'. |
$status{'resource.'.$partid.'.submitted_by'}.'" />'; |
$status{'resource.'.$partid.'.submitted_by'}.'" />'; |
} |
} |
} |
} |
Line 1532 KEYWORDS
|
Line 1533 KEYWORDS
|
$result.=$$fullname{$_}.' '; |
$result.=$$fullname{$_}.' '; |
} |
} |
$result.='<br />'."\n"; |
$result.='<br />'."\n"; |
|
my ($part)=split(/\./,$_); |
$result.='<input type="hidden" name="collaborator'.$counter. |
$result.='<input type="hidden" name="collaborator'.$counter. |
'" value="'.(join ':',@goodcollaborators).'" />'."\n"; |
'" value="'.$part.':'.(join ':',@goodcollaborators).'" />'. |
|
"\n"; |
} |
} |
if (scalar(@badcollaborators) > 0) { |
if (scalar(@badcollaborators) > 0) { |
$result.='<table border="0"><tr bgcolor="#ffbbbb"><td>'; |
$result.='<table border="0"><tr bgcolor="#ffbbbb"><td>'; |
Line 1559 KEYWORDS
|
Line 1562 KEYWORDS
|
# (3) Last submission plus the parts info |
# (3) Last submission plus the parts info |
# (4) The whole record for this student |
# (4) The whole record for this student |
if ($ENV{'form.lastSub'} =~ /^(lastonly|hdgrade)$/) { |
if ($ENV{'form.lastSub'} =~ /^(lastonly|hdgrade)$/) { |
if ($ENV{'form.'.$uname.':'.$udom.':submitted_by'}) { |
|
my $submitby=''. |
|
'<b>Collaborative submission by: </b>'. |
|
'<a href="javascript:viewSubmitter(\''. |
|
$ENV{'form.'.$uname.':'.$udom.':submitted_by'}. |
|
'\')"; TARGET=_self>'. |
|
$$fullname{$ENV{'form.'.$uname.':'.$udom.':submitted_by'}}.'</a>'; |
|
$request->print($submitby); |
|
} else { |
|
my ($string,$timestamp)= &get_last_submission(\%record); |
my ($string,$timestamp)= &get_last_submission(\%record); |
my $lastsubonly=''. |
my $lastsubonly=''. |
($$timestamp eq '' ? '' : '<b>Date Submitted:</b> '. |
($$timestamp eq '' ? '' : '<b>Date Submitted:</b> '. |
Line 1575 KEYWORDS
|
Line 1569 KEYWORDS
|
if ($$timestamp eq '') { |
if ($$timestamp eq '') { |
$lastsubonly.='<tr><td bgcolor="#ffffe6">'.$$string[0]; |
$lastsubonly.='<tr><td bgcolor="#ffffe6">'.$$string[0]; |
} else { |
} else { |
|
my %seenparts; |
for my $part (sort keys(%$handgrade)) { |
for my $part (sort keys(%$handgrade)) { |
my ($partid,$respid) = split(/_/,$part); |
my ($partid,$respid) = split(/_/,$part); |
|
if ($ENV{"form.$uname:$udom:$partid:submitted_by"}) { |
|
if (exists($seenparts{$partid})) { next; } |
|
$seenparts{$partid}=1; |
|
my $submitby='<b>Part '.$partid. |
|
' Collaborative submission by: </b>'. |
|
'<a href="javascript:viewSubmitter(\''. |
|
$ENV{"form.$uname:$udom:$partid:submitted_by"}. |
|
'\')"; TARGET=_self>'. |
|
$$fullname{$ENV{"form.$uname:$udom:$partid:submitted_by"}}.'</a><br />'; |
|
$request->print($submitby); |
|
next; |
|
} |
my $responsetype = $responseType->{$partid}->{$respid}; |
my $responsetype = $responseType->{$partid}->{$respid}; |
if (!exists($record{'resource.'.$partid.'.'.$respid.'.submission'})) { |
if (!exists($record{'resource.'.$partid.'.'.$respid.'.submission'})) { |
$lastsubonly.='<tr><td bgcolor="#ffffe6"><b>Part '. |
$lastsubonly.='<tr><td bgcolor="#ffffe6"><b>Part '. |
Line 1628 KEYWORDS
|
Line 1635 KEYWORDS
|
} |
} |
$lastsubonly.='</td></tr><tr bgcolor="#ffffff"><td>'."\n"; |
$lastsubonly.='</td></tr><tr bgcolor="#ffffff"><td>'."\n"; |
$request->print($lastsubonly); |
$request->print($lastsubonly); |
} |
|
} elsif ($ENV{'form.lastSub'} eq 'datesub') { |
} elsif ($ENV{'form.lastSub'} eq 'datesub') { |
my (undef,$responseType,undef,$parts) = &showResourceInfo($url); |
my (undef,$responseType,undef,$parts) = &showResourceInfo($url); |
$request->print(&displaySubByDates($symb,\%record,$parts,$responseType,$checkIcon,$uname,$udom)); |
$request->print(&displaySubByDates($symb,\%record,$parts,$responseType,$checkIcon,$uname,$udom)); |
Line 1804 sub processHandGrade {
|
Line 1810 sub processHandGrade {
|
$ENV{'form.msgsub'},$message); |
$ENV{'form.msgsub'},$message); |
} |
} |
if ($ENV{'form.collaborator'.$ctr}) { |
if ($ENV{'form.collaborator'.$ctr}) { |
my (@collaborators) = split(/:/,$ENV{'form.collaborator'.$ctr}); |
&Apache::lonnet::logthis('collab '.(join(':',@{ $ENV{'form.collaborator'.$ctr} }))); |
foreach (@collaborators) { |
my @collabstrs; |
my ($errorflag,$pts,$wgt) = |
if (ref($ENV{'form.collaborator'.$ctr}) eq 'ARRAY') { |
&saveHandGrade($request,$url,$symb,$_,$udom,$ctr,$ENV{'form.unamedom'.$ctr}); |
@collabstrs=@{$ENV{'form.collaborator'.$ctr}}; |
if ($errorflag eq 'not_allowed') { |
} else { |
$request->print("<font color=\"red\">Not allowed to modify grades for $_:$udom</font>"); |
@collabstrs=$ENV{'form.collaborator'.$ctr}; |
next; |
} |
} else { |
foreach my $collabstr (@collabstrs) { |
if ($message ne '') { |
my ($part,@collaborators) = split(/:/,$collabstr); |
$msgstatus = &Apache::lonmsg::user_normal_msg ($_,$udom, |
foreach (@collaborators) { |
$ENV{'form.msgsub'}, |
my ($errorflag,$pts,$wgt) = |
$message); |
&saveHandGrade($request,$url,$symb,$_,$udom,$ctr, |
|
$ENV{'form.unamedom'.$ctr},$part); |
|
if ($errorflag eq 'not_allowed') { |
|
$request->print("<font color=\"red\">Not allowed to modify grades for $_:$udom</font>"); |
|
next; |
|
} else { |
|
if ($message ne '') { |
|
$msgstatus = &Apache::lonmsg::user_normal_msg($_,$udom,$ENV{'form.msgsub'},$message); |
|
} |
|
|
} |
} |
} |
} |
} |
} |
Line 1967 sub processHandGrade {
|
Line 1982 sub processHandGrade {
|
|
|
#---- Save the score and award for each student, if changed |
#---- Save the score and award for each student, if changed |
sub saveHandGrade { |
sub saveHandGrade { |
my ($request,$url,$symb,$stuname,$domain,$newflg,$submitter) = @_; |
my ($request,$url,$symb,$stuname,$domain,$newflg,$submitter,$part) = @_; |
my $usec = &Apache::lonnet::getsection($domain,$stuname, |
my $usec = &Apache::lonnet::getsection($domain,$stuname, |
$ENV{'request.course.id'}); |
$ENV{'request.course.id'}); |
if (!&canmodify($usec)) { return('not_allowed'); } |
if (!&canmodify($usec)) { return('not_allowed'); } |
Line 1975 sub saveHandGrade {
|
Line 1990 sub saveHandGrade {
|
my %newrecord = (); |
my %newrecord = (); |
my ($pts,$wgt) = ('',''); |
my ($pts,$wgt) = ('',''); |
foreach (split(/:/,$ENV{'form.partlist'.$newflg})) { |
foreach (split(/:/,$ENV{'form.partlist'.$newflg})) { |
|
&Apache::lonnet::logthis("-$submitter-$stuname-$part-$_"); |
|
#collaborator may vary for different parts |
|
if ($submitter && $_ ne $part) { next; } |
my $dropMenu = $ENV{'form.GD_SEL'.$newflg.'_'.$_}; |
my $dropMenu = $ENV{'form.GD_SEL'.$newflg.'_'.$_}; |
if ($dropMenu eq 'excused') { |
if ($dropMenu eq 'excused') { |
if ($record{'resource.'.$_.'.solved'} ne 'excused') { |
if ($record{'resource.'.$_.'.solved'} ne 'excused') { |
Line 2010 sub saveHandGrade {
|
Line 2028 sub saveHandGrade {
|
$newrecord{$reckey} = 'correct_by_override' |
$newrecord{$reckey} = 'correct_by_override' |
if ($record{$reckey} ne 'correct_by_override'); |
if ($record{$reckey} ne 'correct_by_override'); |
} |
} |
|
|
$newrecord{'resource.'.$_.'.submitted_by'} = $submitter |
$newrecord{'resource.'.$_.'.submitted_by'} = $submitter |
if ($submitter && ($record{'resource.'.$_.'.submitted_by'} ne $submitter)); |
if ($submitter && ($record{'resource.'.$_.'.submitted_by'} ne $submitter)); |
$newrecord{'resource.'.$_.'.regrader'}="$ENV{'user.name'}:$ENV{'user.domain'}"; |
$newrecord{'resource.'.$_.'.regrader'}="$ENV{'user.name'}:$ENV{'user.domain'}"; |
Line 3925 sub send_header {
|
Line 3944 sub send_header {
|
#remotewindow.close(); |
#remotewindow.close(); |
#</script>"); |
#</script>"); |
$request->print(&Apache::loncommon::bodytag('Grading')); |
$request->print(&Apache::loncommon::bodytag('Grading')); |
|
foreach my $key (sort(keys(%ENV))) { |
|
if ($key =~ /^form\./) { |
|
Apache->request->print("$key => $ENV{$key} <br />"); |
|
} |
|
} |
} |
} |
|
|
sub send_footer { |
sub send_footer { |