[LON-CAPA-cvs] cvs: loncom /homework grades.pm

albertel lon-capa-cvs@mail.lon-capa.org
Fri, 03 Dec 2004 22:44:37 -0000


albertel		Fri Dec  3 17:44:37 2004 EDT

  Modified files:              
    /loncom/homework	grades.pm 
  Log:
  
  - BUG#3662, was puting <input> in a <table> outside of <td> (eg in <table> directly or in <tr) screwed up table rendering on IE
  
  
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.232 loncom/homework/grades.pm:1.233
--- loncom/homework/grades.pm:1.232	Tue Nov 23 09:37:33 2004
+++ loncom/homework/grades.pm	Fri Dec  3 17:44:36 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.232 2004/11/23 14:37:33 albertel Exp $
+# $Id: grades.pm,v 1.233 2004/12/03 22:44:36 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2402,9 +2402,6 @@
     my (undef,undef,$fullname) = &getclasslist($ENV{'form.section'},'1');
     my $ctr = 0;
     foreach (sort {lc($$fullname{$a}) cmp lc($$fullname{$b}) } keys %$fullname) {
-	my $uname = $_;
-	$uname=~s/:/_/;
-	$result.='<input type="hidden" name="ctr'.$ctr.'" value="'.$uname.'" />'."\n";
 	$ctr++;
 	$result.=&viewstudentgrade($url,$symb,$ENV{'request.course.id'},
 				   $_,$$fullname{$_},\@parts,\%weight,$ctr);
@@ -2428,18 +2425,21 @@
     my ($uname,$udom) = split(/:/,$student);
     $student=~s/:/_/;
     my %record=&Apache::lonnet::restore($symb,$courseid,$udom,$uname);
-    my $result='<tr bgcolor="#ffffdd"><td align="right">'.$ctr.'&nbsp;</td><td>&nbsp;'.
+    my $result='<tr bgcolor="#ffffdd"><td align="right">'.
+	'<input type="hidden" name="ctr'.($ctr-1).'" value="'.$student.'" />'.
+	"\n".$ctr.'&nbsp;</td><td>&nbsp;'.
 	'<a href="javascript:viewOneStudent(\''.$uname.'\',\''.$udom.
 	'\')"; TARGET=_self>'.$fullname.'</a> '.
 	'<font color="#999999">('.$uname.($ENV{'user.domain'} eq $udom ? '' : ':'.$udom).')</font></td>'."\n";
     foreach my $apart (@$parts) {
 	my ($part,$type) = &split_part_type($apart);
 	my $score=$record{"resource.$part.$type"};
+	$result.='<td align="middle">';
 	if ($type eq 'awarded') {
 	    my $pts = $score eq '' ? '' : $score*$$weight{$part};
 	    $result.='<input type="hidden" name="'.
 		'GD_'.$student.'_'.$part.'_awarded_s" value="'.$pts.'" />'."\n";
-	    $result.='<td align="middle"><input type="text" name="'.
+	    $result.='<input type="text" name="'.
 		'GD_'.$student.'_'.$part.'_awarded" '.
 		'onChange="javascript:changeSelect(\''.$part.'\',\''.$student.
 		'\')" value="'.$pts.'" size="4" /></td>'."\n";
@@ -2448,7 +2448,7 @@
 	    $status = 'nothing' if ($status eq '');
 	    $result.='<input type="hidden" name="'.'GD_'.$student.'_'.
 		$part.'_solved_s" value="'.$status.'" />'."\n";
-	    $result.='<td align="middle">&nbsp;<select name="'.
+	    $result.='&nbsp;<select name="'.
 		'GD_'.$student.'_'.$part.'_solved" '.
 		'onChange="javascript:changeOneScore(\''.$part.'\',\''.$student.'\')" >'."\n";
 	    $result.= (($status eq 'excused') ? '<option> </option><option selected="on">excused</option>' 
@@ -2459,7 +2459,7 @@
 	    $result.='<input type="hidden" name="'.
 		'GD_'.$student.'_'.$part.'_'.$type.'_s" value="'.$score.'" />'.
 		    "\n";
-	    $result.='<td align="middle"><input type="text" name="'.
+	    $result.='<input type="text" name="'.
 		'GD_'.$student.'_'.$part.'_'.$type.'" '.
 		'value="'.$score.'" size="4" /></td>'."\n";
 	}