--- loncom/homework/grades.pm 2007/10/31 18:01:34 1.473 +++ loncom/homework/grades.pm 2007/11/01 00:47:42 1.474 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Grading handler # -# $Id: grades.pm,v 1.473 2007/10/31 18:01:34 albertel Exp $ +# $Id: grades.pm,v 1.474 2007/11/01 00:47:42 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -865,7 +865,7 @@ LISTJAVASCRIPT my $saveStatus = $stu_status eq '' ? 'Active' : $stu_status; $env{'form.Status'} = $saveStatus; $gradeTable.=''."\n". - ''."\n". + ''."\n". ''."\n". '
'."\n". ' Grading Increments: Check For Plagiarism'; my ($classlist, undef, $fullname) = &getclasslist($getsec,'1',$getgroup); - $gradeTable.='
'. - ''; + $gradeTable.= &Apache::loncommon::start_data_table(). + &Apache::loncommon::start_data_table_header_row(); my $loop = 0; while ($loop < 2) { - $gradeTable.=''. - ''; + $gradeTable.=''. + ''; if ($env{'form.showgrading'} eq 'yes' && $submitonly ne 'queued' && $submitonly ne 'all') { foreach (sort(@$partlist)) { my $display_part=&get_display_part((split(/_/))[0],$symb); - $gradeTable.=''; + $gradeTable.=''; + $gradeTable.=''; } $loop++; # $gradeTable.='' if ($loop%2 ==1); } - $gradeTable.=''."\n"; + $gradeTable.=&Apache::loncommon::end_data_table_header_row()."\n"; my $ctr = 0; foreach my $student (sort @@ -978,13 +978,15 @@ LISTJAVASCRIPT my $section = $classlist->{$student}->[&Apache::loncoursedata::CL_SECTION()]; my $group = $classlist->{$student}->[&Apache::loncoursedata::CL_GROUP()]; if ( $perm{'vgr'} eq 'F' ) { - $gradeTable.='' if ($ctr%2 ==1); + if ($ctr%2 ==1) { + $gradeTable.= &Apache::loncommon::start_data_table_row(); + } $gradeTable.=''. ''."\n".''."\n"; + ' '.$section.($group ne '' ?'/'.$group:'').''."\n"; if ($env{'form.showgrading'} eq 'yes' && $submitonly ne 'all') { foreach (sort keys(%status)) { @@ -993,7 +995,9 @@ LISTJAVASCRIPT } } # $gradeTable.='' if ($ctr%2 ==1); - $gradeTable.=''."\n" if ($ctr%2 ==0); + if ($ctr%2 ==0) { + $gradeTable.=&Apache::loncommon::end_data_table_row()."\n"; + } } } if ($ctr%2 ==1) { @@ -1007,10 +1011,10 @@ LISTJAVASCRIPT } elsif ($submitonly eq 'queued') { $gradeTable.=''; } - $gradeTable.=''; + $gradeTable.=&Apache::loncommon::end_data_table_row(); } - $gradeTable.='
 No.  Select '.&nameUserString('header').' Section/GroupNo.Select'.&nameUserString('header').' '.'Section/Group Part: '.$display_part. - ' Status Part: '.$display_part. + ' Status'; } } elsif ($submitonly eq 'queued') { - $gradeTable.=' '.&mt('Queue Status').' '.&mt('Queue Status').' 
'.$ctr.' '. &nameUserString(undef,$$fullname{$student},$uname,$udom). - ' '.$section.'/'.$group.'
 
'."\n". + $gradeTable.=&Apache::loncommon::end_data_table()."\n". ''."\n"; @@ -1028,7 +1032,7 @@ LISTJAVASCRIPT ' students checked for '.$submissions.')
'; } } elsif ($ctr == 1) { - $gradeTable =~ s/type=checkbox/type=checkbox checked/; + $gradeTable =~ s/type="checkbox"/type="checkbox" checked="checked"/; } $gradeTable.=&show_grading_menu_form($symb); $request->print($gradeTable); @@ -3169,14 +3173,12 @@ sub viewgrades { $sectionClass=&mt('Students in Section(s) [_1]',$section_display).''; } $result.='

'.&mt('Assign Common Grade To [_1]',$sectionClass); - $result.= ''."\n"; } } - $result.=''; + $result.=&Apache::loncommon::end_data_table_row(); return $result; }
'."\n". - '
'; + $result.= &Apache::loncommon::start_data_table(); #radio buttons/text box for assigning points for a section or class. #handles different parts of a problem my ($partlist,$handgrade,$responseType) = &response_type($symb); my %weight = (); my $ctsparts = 0; - $result.=''; my %seen = (); my @part_response_id = &flatten_responseType($responseType); foreach my $part_response_id (@part_response_id) { @@ -3188,12 +3190,14 @@ sub viewgrades { my $wgt = &Apache::lonnet::EXT('resource.'.$partid.'.weight',$symb); $weight{$partid} = $wgt eq '' ? '1' : $wgt; + $result.=&Apache::loncommon::start_data_table_row().'
'; $result.=''."\n"; $result.=''."\n"; my $display_part=&get_display_part($partid,$symb); - $result.='
Part: '.$display_part.'   Point: '; + $result.= + 'Part: '.$display_part.'   Point: '; $result.=''; my $ctr = 0; while ($ctr<=$weight{$partid}) { # display radio buttons in a nice table 10 across @@ -3208,26 +3212,27 @@ sub viewgrades { $partid.'" size="4" '.'onChange="javascript:writePoint(\''. $partid.'\','.$weight{$partid}.',\'textval\')" /> /'. $weight{$partid}.' (problem weight)'."\n"; - $result.= ''. - ''."\n"; + ''.&Apache::loncommon::end_data_table_row()."\n"; $ctsparts++; } - $result.='
'.'
'.'
'."\n". + $result.=&Apache::loncommon::end_data_table()."\n". ''; $result.=''; + 'onClick="javascript:resetEntry('.$ctsparts.');" />'; #table listing all the students in a section/class #header of table $result.= '

Assign Grade to Specific Students in '.$sectionClass; - $result.= '
'."\n". - ''. - '\n"; + $result.= &Apache::loncommon::start_data_table(). + &Apache::loncommon::start_data_table_header_row(). + ''. + '\n"; my (@parts) = sort(&getpartlist($symb)); my (undef,undef,$url)=&Apache::lonnet::decode_symb($symb); my @partids = (); @@ -3239,16 +3244,16 @@ sub viewgrades { push(@partids, $partid); my $display_part=&get_display_part($partid,$symb); if ($display =~ /^Partial Credit Factor/) { - $result.=''."\n"; + $result.=''."\n"; next; } else { $display =~s/\[Part: \Q$partid\E\]/Part:<\/b> $display_part/; } $display =~ s|Problem Status|Grade Status
|; - $result.=''."\n"; + $result.=''."\n"; } - $result.=''; + $result.=&Apache::loncommon::end_data_table_header_row(); my %last_resets = &get_last_resets($symb,$env{'request.course.id'},\@partids); @@ -3268,7 +3273,7 @@ sub viewgrades { $result.=&viewstudentgrade($symb,$env{'request.course.id'}, $_,$$fullname{$_},\@parts,\%weight,$ctr,\%last_resets); } - $result.='
 No. '.&nameUserString('header')."No.'.&nameUserString('header')."Score Part: '.$display_part. - '
(weight = '.$weight{$partid}.')
Score Part: '.$display_part. + '
(weight = '.$weight{$partid}.')
'.$display.''.$display.'
'; + $result.=&Apache::loncommon::end_data_table(); $result.=''."\n"; $result.=''."\n"; @@ -3291,7 +3296,7 @@ sub viewstudentgrade { my ($uname,$udom) = split(/:/,$student); my %record=&Apache::lonnet::restore($symb,$courseid,$udom,$uname); my %aggregates = (); - my $result='

'. + my $result=&Apache::loncommon::start_data_table_row().''. ''. "\n".$ctr.'  '. '