[LON-CAPA-cvs] cvs: loncom /xml londefdef.pm

sakharuk lon-capa-cvs@mail.lon-capa.org
Tue, 26 Aug 2003 15:05:43 -0000


sakharuk		Tue Aug 26 11:05:43 2003 EDT

  Modified files:              
    /loncom/xml	londefdef.pm 
  Log:
  Bug 2082 is fixed. The content of the bug message was almost completely wrong but the bug was a real. The table exceeded the column width because I wanted to have a rather smart algorithm for calculating the width of the cell. As a result I made a very stupid assumption how to calculate the width of the last cell in the table. Now I simplified the algorithm and averything seems is O'K.
  
  
Index: loncom/xml/londefdef.pm
diff -u loncom/xml/londefdef.pm:1.166 loncom/xml/londefdef.pm:1.167
--- loncom/xml/londefdef.pm:1.166	Tue Aug 26 10:40:03 2003
+++ loncom/xml/londefdef.pm	Tue Aug 26 11:05:43 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Tags Default Definition Module 
 #
-# $Id: londefdef.pm,v 1.166 2003/08/26 14:40:03 sakharuk Exp $
+# $Id: londefdef.pm,v 1.167 2003/08/26 15:05:43 sakharuk Exp $
 # 
 #
 # Copyright Michigan State University Board of Trustees
@@ -1776,11 +1776,9 @@
 	    }
 	}
 	#continues trying estimate the width of raw data
-#	$currentstring.=' SSS '.$Apache::londefdef::table[-1]{'lengthrow'}[0].' FFF '; ####for test only
 	my @length_raw_row = split(/,/,$Apache::londefdef::table[-1]{'lengthrow'}[0]);
 	for (my $in=1;$in<=$Apache::londefdef::table[-1]{'row_number'};$in++) {
 	    my @length_row = split(/,/,$Apache::londefdef::table[-1]{'lengthrow'}[$in]);
-#	    $currentstring.=' SSS '.$Apache::londefdef::table[-1]{'lengthrow'}[$in].' FFF '; ####for test only
 	    for (my $jn=0;$jn<=$#length_row;$jn++) {
 		if ($length_raw_row[$jn]<$length_row[$jn]) {$length_raw_row[$jn]=$length_row[$jn];}
 	    }
@@ -1797,7 +1795,7 @@
 	$needed=$#length_row_final-$needed+1;
 	for (my $jn=0;$jn<=$#length_row_final;$jn++) {
 	    if ($length_row_final[$jn]==0) {
-		if ($length_raw_row[$jn]<$available_length/3) {
+		if ($length_raw_row[$jn]<$available_length) {
 		    $length_row_final[$jn]=$length_raw_row[$jn];
 		    $available_length=$available_length-$length_raw_row[$jn];
 		    $needed--;