--- loncom/homework/grades.pm 2003/11/10 16:28:10 1.153 +++ loncom/homework/grades.pm 2003/11/10 16:35:57 1.154 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Grading handler # -# $Id: grades.pm,v 1.153 2003/11/10 16:28:10 albertel Exp $ +# $Id: grades.pm,v 1.154 2003/11/10 16:35:57 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -132,6 +132,10 @@ sub response_type { my ($url,$symb) = shift; $symb=($ENV{'form.symb'} ne '' ? $ENV{'form.symb'} : (&Apache::lonnet::symbread($url))) if ($symb eq ''); my $allkeys = &Apache::lonnet::metadata($url,'keys'); + my %vPart; + foreach my $partid (&Apache::loncommon::get_env_multiple('form.vPart')) { + $vPart{$partid}=1; + } my %seen = (); my (@partlist,%handgrade,%responseType); foreach (split(/,/,&Apache::lonnet::metadata($url,'packages'))) { @@ -141,6 +145,9 @@ sub response_type { if (&Apache::loncommon::check_if_partid_hidden($partid,$symb)) { next; } + if (%vPart && !exists($vPart{$partid})) { + next; + } $responsetype =~ s/response$//; # make it compatible w/ navmaps - should move to that!! my ($value) = &Apache::lonnet::EXT('resource.'.$part.'.handgrade',$symb); $handgrade{$part} = ($value eq 'yes' ? 'yes' : 'no'); @@ -157,18 +164,31 @@ sub response_type { #--- Show resource title #--- and parts and response type sub showResourceInfo { - my ($url,$probTitle) = @_; + my ($url,$probTitle,$checkboxes) = @_; + my $col=3; + if ($checkboxes) { $col=4; } my $result =''. - ''."\n"; + ''."\n"; my ($partlist,$handgrade,$responseType) = &response_type($url); my %resptype = (); my $hdgrade='no'; + my %partsseen; for my $part_resID (sort keys(%$handgrade)) { my $handgrade=$$handgrade{$part_resID}; my ($partID,$resID) = split(/_/,$part_resID); my $responsetype = $responseType->{$partID}->{$resID}; $hdgrade = $handgrade if ($handgrade eq 'yes'); - $result.=''; + if ($checkboxes) { + if (exists($partsseen{$partID})) { + $result.=""; + } else { + $result.=""; + } + $partsseen{$partID}=1; + } + $result.=''. ''; # ''; @@ -550,8 +570,7 @@ sub listStudents { my $result='

 '.$viewgrade. ' Submissions for a Student or a Group of Students

'; - my ($table,undef,$hdgrade,$partlist,$handgrade) = &showResourceInfo($url,$ENV{'form.probTitle'}); - $result.=$table; + my ($table,undef,$hdgrade,$partlist,$handgrade) = &showResourceInfo($url,$ENV{'form.probTitle'},($ENV{'form.showgrading'} eq 'yes')); $request->print(< @@ -591,7 +610,8 @@ LISTJAVASCRIPT my $checkhdgrade = ($ENV{'form.handgrade'} eq 'yes' && scalar(@$partlist) > 1 ) ? 'checked' : ''; my $checklastsub = $checkhdgrade eq '' ? 'checked' : ''; - my $gradeTable='
'."\n". + my $gradeTable=''. + "\n".$table. ' View Problem Text: no '."\n". ' one student '."\n". ' all students
'."\n". @@ -1435,6 +1455,9 @@ sub submission { ''."\n". ''."\n". ''."\n"); + foreach my $partid (&Apache::loncommon::get_env_multiple('form.vPart')) { + $request->print(''."\n"); + } } my ($cts,$prnmsg) = (1,''); @@ -3947,11 +3970,6 @@ sub send_header { #remotewindow.close(); #"); $request->print(&Apache::loncommon::bodytag('Grading')); - foreach my $key (sort(keys(%ENV))) { - if ($key =~ /^form\./) { - Apache->request->print("$key => $ENV{$key}
"); - } - } } sub send_footer {
Current Resource: '.$probTitle.'
Current Resource: '. + $probTitle.'
Part '.$partID.' '. + $result.='
 Part '.$partID.' '. $resID.'Type: '.$responsetype.'
Handgrade: '.$handgrade.'