--- loncom/homework/structuretags.pm 2002/08/26 20:42:36 1.107 +++ loncom/homework/structuretags.pm 2002/09/30 15:10:11 1.119 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: structuretags.pm,v 1.107 2002/08/26 20:42:36 sakharuk Exp $ +# $Id: structuretags.pm,v 1.119 2002/09/30 15:10:11 sakharuk Exp $ # # Copyright Michigan State University Board of Trustees # @@ -161,7 +161,7 @@ sub problem_web_to_edit_header { Show All Foils + $result.= ' /> Show All Foils
]*)>//g;
- $gradesatement =~ s/<\/td>//g;
- $gradesatement =~ s//\\textbf{/g;
- $gradesatement =~ s/<\/b>/}/g;
- $gradesatement =~ s/ /\\vskip 0 mm /g; - $gradesatement =~ s/]*)>//g; - } - $result.= $gradesatement; + my $gradestatus = &Apache::inputtags::gradestatus($Apache::inputtags::part); + #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 ( - (($target eq 'web' || $target eq 'tex') && ($ENV{'request.state'} ne 'construct')) || - ($target eq 'answer') + (($target eq 'web') && ($ENV{'request.state'} ne 'construct')) || + ($target eq 'answer') || ($target eq 'tex') ) { if ($status eq 'CAN_ANSWER') { if ($target ne 'tex') { @@ -421,9 +413,9 @@ sub end_problem { } else { $result .= '\vskip 0.5mm\noindent\makebox[\textwidth/$number_of_columns][b]{\hrulefill}'; if (not $ENV{'request.symb'} =~ m/\.page_/) { - $result .= '\end{document} '; + $result .= '\end{minipage}\end{document} '; } else { - $result .= '} '; + $result .= ''; } } } @@ -442,11 +434,29 @@ sub end_problem { return $result; } +#FIXME I am ugly shoot me +sub html_to_tex { + my ($string)=@_; + $string =~ s/
|