--- loncom/interface/lonprintout.pm 2003/07/10 20:39:08 1.202
+++ loncom/interface/lonprintout.pm 2003/08/01 19:22:47 1.207
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Printout
#
-# $Id: lonprintout.pm,v 1.202 2003/07/10 20:39:08 sakharuk Exp $
+# $Id: lonprintout.pm,v 1.207 2003/08/01 19:22:47 sakharuk Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -619,6 +619,7 @@ ENDPART
$currentURL=$helper->{'VARS'}->{'filename'};
$currentURL=~s/\/home\//\/~/;
$currentURL=~s/public_html\///;
+ if ($currentURL=~/([^?]+)/) {$currentURL=$1;}
}
$selectionmade = 1;
if ($currentURL=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)$/) {
@@ -627,7 +628,8 @@ ENDPART
my %form;
$form{'grade_target'}='tex';
$form{'textwidth'}=$LaTeXwidth;
- $form{'problem_split'}=$parmhash{'problem_stream_switch'};
+ $form{'problem_split'}=$parmhash{'problem_stream_switch'};
+ $form{'latex_type'}=$helper->{'VARS'}->{'LATEX_TYPE'};
my $rndseed=time;
$form{'rndseed'}=$rndseed;
&Apache::lonnet::appenv(%moreenv);
@@ -649,13 +651,15 @@ ENDPART
($result,$number_of_columns) = &page_cleanup($result);
}
} else {
-# $result='\documentclass[letterpaper]{article}\usepackage{calc}\begin{document}Printout of this type of document is currently not supported: ';
-# if ($ENV{'form.url'}=~/\/(aboutme|syllabus|bulletinboard|smppg)$/) {
-# $result.=$1;
-# } else {
-# $result.=$ENV{'form.url'};
-# }
-# $result.=' \end{document}'
+ $result='\documentclass[letterpaper]{article}\usepackage{calc}\begin{document}Printout of this type of document is currently not supported: ';
+ if ($currentURL=~/\/(aboutme|syllabus|bulletinboard|smppg)$/) {
+ $result.=$1;
+ } elsif ($currentURL=~/\/ext\//) {
+ $result.=' \strut \\\\ THIS IS EXTERNAL RESOURCE WITH URL \strut \\\\ '.$currentURL.' ';
+ } else {
+ $result.=$currentURL;
+ }
+ $result.=' \end{document}'
}
} elsif (($helper->{'VARS'}->{'PRINT_TYPE'} eq 'map_problems') or
($helper->{'VARS'}->{'PRINT_TYPE'} eq 'map_problems_pages') or
@@ -665,6 +669,7 @@ ENDPART
$form{'grade_target'}='tex';
$form{'textwidth'}=$LaTeXwidth;
$form{'problem_split'}=$parmhash{'problem_stream_switch'};
+ $form{'latex_type'}=$helper->{'VARS'}->{'LATEX_TYPE'};
my $flag_latex_header_remove = 'NO';
my $flag_page_in_sequence = 'NO';
my @master_seq=split /\|\|\|/, $helper->{'VARS'}->{'RESOURCES'};
@@ -756,6 +761,7 @@ ENDPART
if($helper->{'VARS'}->{'ANSWER_TYPE'} eq 'no') {
my %form;
$form{'answer_output_mode'}='tex';
+ $form{'latex_type'}=$helper->{'VARS'}->{'LATEX_TYPE'};
my $ansrendered = &Apache::loncommon::get_student_answers($curresline,$username,$userdomain,$ENV{'request.course.id'},%form);
$rendered=~s/(\\keephidden{ENDOFPROBLEM})/$ansrendered$1/;
}
@@ -805,6 +811,7 @@ ENDPART
my %form;
$form{'grade_target'}='answer';
$form{'answer_output_mode'}='tex';
+ $form{'latex_type'}=$helper->{'VARS'}->{'LATEX_TYPE'};
$form{'rndseed'}=$rndseed;
my $answer=&Apache::lonnet::ssi($urlp,%form);
$texversion=~s/(\\keephidden{ENDOFPROBLEM})/$answer$1/;
@@ -896,7 +903,7 @@ sub handler {
my %parmhash=&Apache::lonnet::coursedescription($ENV{'request.course.id'});
- my $key;
+# my $key;
# foreach $key (keys %parmhash) {
# $r->print(' '.$key.'->'.$parmhash{$key}.'<-
');
# }
@@ -1103,9 +1110,10 @@ HELPERFRAGMENT
How should the results be printed?
- Start each student\'s assignment on a new page (add a pagefeed after each assignment)
- Add one empty page after each student\'s assignment
- Add two empty pages after each student\'s assignment
+ Start each student\'s assignment on a new page/column (add a pagefeed after each assignment)
+ Add one empty page/column after each student\'s assignment
+ Add two empty pages/column after each student\'s assignment
+ Add three empty pages/column after each student\'s assignment
CHOOSE_STUDENTS
@@ -1126,7 +1134,7 @@ CHOOSE_FROM_SUBDIR
$xmlfrag .= <<'CHOOSE_FROM_SUBDIR';
return $filename =~
- m/^[^\.]+\.(problem|exam|quiz|assess|survey|form|library)$/;
+ m/\.(problem|exam|quiz|assess|survey|form|library)$/;
@@ -1158,6 +1166,24 @@ CHOOSE_FROM_SUBDIR
['Print with answers', 'no'] ];
Apache::lonhelper::choices->new();
}
+ if ($ENV{'request.role.adv'}) {
+ $paramHash = Apache::lonhelper::getParamHash();
+ $paramHash->{MESSAGE_TEXT} = "
Another option available only for advanced users:
";
+ Apache::lonhelper::message->new();
+ $paramHash = Apache::lonhelper::getParamHash();
+ $paramHash->{'variable'} = 'LATEX_TYPE';
+ $helper->declareVar('LATEX_TYPE');
+ if ($helper->{VARS}->{'construction'} eq '1') {
+ $paramHash->{CHOICES} = [
+ ['Print in standard LaTeX mode', 'standard'],
+ ['Print in LaTeX batchmode', 'batchmode'], ];
+ } else {
+ $paramHash->{CHOICES} = [
+ ['Print in LaTeX batchmode', 'batchmode'],
+ ['Print in standard LaTeX mode', 'standard'] ];
+ }
+ Apache::lonhelper::choices->new();
+ }
Apache::lonprintout::page_format_state->new("FORMAT");