--- loncom/interface/lonprintout.pm 2003/05/12 18:47:07 1.162
+++ loncom/interface/lonprintout.pm 2003/05/12 20:29:39 1.163
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Printout
#
-# $Id: lonprintout.pm,v 1.162 2003/05/12 18:47:07 sakharuk Exp $
+# $Id: lonprintout.pm,v 1.163 2003/05/12 20:29:39 sakharuk Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1381,6 +1381,24 @@ ENDPART
&Apache::lonnet::appenv(%moreenv);
my $texversion=&Apache::lonnet::ssi($currentURL);
&Apache::lonnet::delenv('form.grade_target','form.textwidth','form.counter');
+ if($helper->{'VARS'}->{'ANSWER_TYPE'} eq 'no') {
+ $moreenv{'form.grade_target'}='answer';
+ &Apache::lonnet::appenv(%moreenv);
+ my $answer=&Apache::lonnet::ssi($currentURL);
+ &Apache::lonnet::delenv('form.grade_target');
+ my $start=index($answer,'
',$start);
+ if ($start!=-1 && $finish!=-1) {$answer=substr($answer,$start,$finish-$start+8);}
+ $answer=~s/<\/td>\s*/ \\\\ \\hline /g;
+ $answer=~s/]*)>/\\vskip 0 mm \\begin{tabular}{|c|}\\hline /;
+ $answer=~s/<\/table>/\\end{tabular}\\vskip 0 mm/;
+ $answer=~s/\s*//;
+ $answer=~s/<\/td>\s*<\/tr>/\\\\ \\hline /;
+ $answer=~s/([^\#]*)<\/b>/\\verb|$1|/;
+ $answer=~s/([^\#]*)<\/i>/\\textit{$1}/;
+# $r->print(''.$answer.' '); return OK;
+ $texversion=~s/(\\end{document})/$answer$1/;
+ }
$result .= $texversion;
if ($currentURL=~m/\.page\s*$/) {
($result,$number_of_columns) = &page_cleanup($result);
@@ -1587,7 +1605,7 @@ sub handler {
foreach $key (keys %{$helper->{'VARS'}}) {
$r->print(' '.$key.'->'.$helper->{'VARS'}->{$key}.'<- ');
}
- return OK;
+# return OK;
&output_data_new($r,$helper);
@@ -1893,8 +1911,8 @@ CHOOSE_FROM_SUBDIR
$paramHash->{'variable'} = 'ANSWER_TYPE';
$helper->declareVar('ANSWER_TYPE');
$paramHash->{CHOICES} = [
- ['Print without answer', '1'],
- ['Print with answers', '0'] ];
+ ['Print without answer', 'yes'],
+ ['Print with answers', 'no'] ];
Apache::lonhelper::choices->new();
}
| |