Diff for /loncom/homework/structuretags.pm between versions 1.120 and 1.123

version 1.120, 2002/10/01 20:44:44 version 1.123, 2002/10/03 13:38:02
Line 389  sub end_problem { Line 389  sub end_problem {
       $status ne 'UNCHECKEDOUT') {        $status ne 'UNCHECKEDOUT') {
       # if part is zero, no <part>s existed, so we need show the current         # if part is zero, no <part>s existed, so we need show the current 
       # grading status        # grading status
       my $gradestatus = &Apache::inputtags::gradestatus($Apache::inputtags::part);        my $gradestatus = &Apache::inputtags::gradestatus($Apache::inputtags::part,$target);
       #FIXME this is ugly we should just generate tex in inputtags  
       if ($target eq 'tex') { $gradestatus=&html_to_tex($gradestatus); }  
       if ($Apache::lonhomework::type ne 'exam') {$result.= $gradestatus;}        if ($Apache::lonhomework::type ne 'exam') {$result.= $gradestatus;}
     }      }
     if (      if (
Line 434  sub end_problem { Line 432  sub end_problem {
   return $result;    return $result;
 }  }
   
 #FIXME I am ugly shoot me  
 sub html_to_tex {  
   my ($string)=@_;  
   $string =~ s/<table>//;  
   $string =~ s/<\/table>//;  
   $string =~ s/<tr([^>]*)>//g;  
   $string =~ s/<\/tr>//g;  
   $string =~ s/<td([^>]*)>//g;  
   $string =~ s/<\/td>//g;  
   $string =~ s/<b>/\\textbf{/g;  
   $string =~ s/<\/b>/}/g;  
   $string =~ s/<br \/>/\\vskip 0 mm /g;  
   $string =~ s/<input([^>]*)>//g;  
   return $string;  
 }  
   
 sub start_library {  sub start_library {
   my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;    my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
Line 644  sub start_part { Line 627  sub start_part {
       }        }
     } else {      } else {
       if ($target eq 'tex') {        if ($target eq 'tex') {
  $result='\vskip 0 mm';   $result='\end{minipage}\vskip 0 mm\begin{minipage}{\textwidth}';
       }        }
     }      }
   }    }
Line 661  sub end_part { Line 644  sub end_part {
     return &Apache::inputtags::grade;      return &Apache::inputtags::grade;
   }    }
   if ($target eq 'web' || $target eq 'tex' ) {    if ($target eq 'web' || $target eq 'tex' ) {
     my $gradestatus=&Apache::inputtags::gradestatus($Apache::inputtags::part);      my $gradestatus=&Apache::inputtags::gradestatus($Apache::inputtags::part,$target);
     #FIXME this is ugly we should just generate tex in inputtags  
     if ($target eq 'tex') { $gradestatus=&html_to_tex($gradestatus); }  
     if ($Apache::lonhomework::type eq 'exam') {$gradestatus='';}      if ($Apache::lonhomework::type eq 'exam') {$gradestatus='';}
     return $gradestatus;      return $gradestatus;
   }    }

Removed from v.1.120  
changed lines
  Added in v.1.123


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>