--- loncom/interface/lonprintout.pm 2004/06/07 19:08:36 1.306 +++ loncom/interface/lonprintout.pm 2004/06/28 19:08:22 1.312 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.306 2004/06/07 19:08:36 sakharuk Exp $ +# $Id: lonprintout.pm,v 1.312 2004/06/28 19:08:22 sakharuk Exp $ # # Copyright Michigan State University Board of Trustees # @@ -472,9 +472,13 @@ sub get_course { } sub page_format_transformation { - my ($papersize,$layout,$numberofcolumns,$choice,$text,$assignment,$tableofcontents,$indexlist) = @_; + my ($papersize,$layout,$numberofcolumns,$choice,$text,$assignment,$tableofcontents,$indexlist,$selectionmade) = @_; my ($textwidth,$textheight,$oddoffset,$evenoffset,$topmargin); - $assignment=&Apache::lonxml::latex_special_symbols($assignment,'header'); + if ($selectionmade eq '4') { + $assignment='Problems from the Whole Course'; + } else { + $assignment=&Apache::lonxml::latex_special_symbols($assignment,'header'); + } ($textwidth,$textheight,$oddoffset,$evenoffset,$topmargin) = &page_format($papersize,$layout,$numberofcolumns,$topmargin); my $name = &get_name(); my $courseidinfo = &get_course(); @@ -674,8 +678,9 @@ sub get_textwidth { sub unsupported { - my $currentURL=shift; - my $result.='\documentclass[letterpaper]{article}\usepackage{calc}\begin{document}Printout of this type of document is currently not supported: '; + my ($currentURL,$mode)=@_; + if ($mode ne '') {$mode='\\'.$mode} + my $result.= &print_latex_header($mode); if ($currentURL=~/\/ext\//) { $result.=' \strut \\\\ THIS IS EXTERNAL RESOURCE WITH URL \strut \\\\ '.$currentURL.' '; } else { @@ -768,7 +773,10 @@ ENDPART $form{'grade_target'}='tex'; $form{'textwidth'}=&get_textwidth($helper,$LaTeXwidth); $form{'problem_split'}=$parmhash{'problem_stream_switch'}; + $form{'suppress_tries'}=$parmhash{'suppress_tries'}; $form{'latex_type'}=$helper->{'VARS'}->{'LATEX_TYPE'}; + $form{'print_discussions'}=$helper->{'VARS'}->{'PRINT_DISCUSSIONS'}; + if ($helper->{'VARS'}->{'PRINT_DISCUSSIONS'} eq 'yes') {$form{'problem_split'}='yes';} if ($helper->{'VARS'}->{'curseed'}) { $rndseed=$helper->{'VARS'}->{'curseed'}; } @@ -833,6 +841,7 @@ ENDPART $form{'grade_target'}='tex'; $form{'textwidth'}=&get_textwidth($helper,$LaTeXwidth); $form{'problem_split'}=$parmhash{'problem_stream_switch'}; + $form{'suppress_tries'}=$parmhash{'suppress_tries'}; $form{'latex_type'}=$helper->{'VARS'}->{'LATEX_TYPE'}; $form{'rndseed'}=$rndseed; $texversion=&Apache::lonnet::ssi($urlp,%form); @@ -883,7 +892,7 @@ ENDPART my $texversion=&Apache::lonnet::ssi($currentURL,%form); $result .= $texversion; } else { - $result.=&unsupported($currentURL); + $result.=&unsupported($currentURL,$helper->{'VARS'}->{'LATEX_TYPE'}); } } elsif (($helper->{'VARS'}->{'PRINT_TYPE'} eq 'map_problems') or ($helper->{'VARS'}->{'PRINT_TYPE'} eq 'map_problems_pages') or @@ -903,7 +912,10 @@ ENDPART $form{'grade_target'}='tex'; $form{'textwidth'}=&get_textwidth($helper,$LaTeXwidth); $form{'problem_split'}=$parmhash{'problem_stream_switch'}; + $form{'suppress_tries'}=$parmhash{'suppress_tries'}; $form{'latex_type'}=$helper->{'VARS'}->{'LATEX_TYPE'}; + $form{'print_discussions'}=$helper->{'VARS'}->{'PRINT_DISCUSSIONS'}; + if ($helper->{'VARS'}->{'PRINT_DISCUSSIONS'} eq 'yes') {$form{'problem_split'}='yes';} my $flag_latex_header_remove = 'NO'; my $flag_page_in_sequence = 'NO'; my @master_seq=split /\|\|\|/, $helper->{'VARS'}->{'RESOURCES'}; @@ -944,7 +956,7 @@ ENDPART if ($helper->{'VARS'}->{'ANSWER_TYPE'} eq 'no') { $texversion=~s/(\\keephidden{ENDOFPROBLEM})/$answer$1/; } else { - if ($urlp=~/\.(problem|exam|quiz|library)$/) { + if ($urlp=~/\.(problem|exam|quiz|assess|survey|form|library)$/) { $texversion=&print_latex_header($helper->{'VARS'}->{'LATEX_TYPE'}); $texversion.='\vskip 0 mm \noindent\textbf{'.&Apache::lonnet::gettitle($urlp).'}\vskip 0 mm '; $texversion.=&path_to_problem ($urlp,$LaTeXwidth); @@ -986,7 +998,7 @@ ENDPART $result .= $texversion; $flag_latex_header_remove = 'YES'; } else { - $texversion=&unsupported($urlp); + $texversion=&unsupported($urlp,$helper->{'VARS'}->{'LATEX_TYPE'}); if ($flag_latex_header_remove ne 'NO') { $texversion = &latex_header_footer_remove($texversion); } else { @@ -1020,9 +1032,16 @@ ENDPART my $flag_latex_header_remove = 'NO'; my %moreenv; $moreenv{'textwidth'}=&get_textwidth($helper,$LaTeXwidth); + $moreenv{'print_discussions'}=$helper->{'VARS'}->{'PRINT_DISCUSSIONS'}; + if ($helper->{'VARS'}->{'PRINT_DISCUSSIONS'} eq 'yes') {$moreenv{'problem_split'}='yes';} my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin($r,'Print Status','Class Print Status',$#students+1); my $student_counter=-1; foreach my $person (@students) { + my $duefile="/home/httpd/prtspool/$ENV{'user.name'}_$ENV{'user.domain'}_printout.due"; + if (-e $duefile) { + my $temp_file = Apache::File->new('>>'.$duefile); + print $temp_file "1969\n"; + } $student_counter++; my $i=int($student_counter/$helper->{'VARS'}{'NUMBER_TO_PRINT'}); my ($output,$fullname)=&print_resources($r,$helper,$person,$type,\%moreenv,\@master_seq,$flag_latex_header_remove); @@ -1155,7 +1174,7 @@ ENDPART $result .= '\end{document}'; } #-------------------------------------------------------- corrections for the different page formats - $result = &page_format_transformation($papersize,$laystyle,$numberofcolumns,$helper->{'VARS'}->{'PRINT_TYPE'},$result,$helper->{VARS}->{'assignment'},$helper->{'VARS'}->{'TABLE_CONTENTS'},$helper->{'VARS'}->{'TABLE_INDEX'}); + $result = &page_format_transformation($papersize,$laystyle,$numberofcolumns,$helper->{'VARS'}->{'PRINT_TYPE'},$result,$helper->{VARS}->{'assignment'},$helper->{'VARS'}->{'TABLE_CONTENTS'},$helper->{'VARS'}->{'TABLE_INDEX'},$selectionmade); $result = &latex_corrections($number_of_columns,$result); for (my $i=1;$i<=$#print_array;$i++) {$print_array[$i] = &latex_corrections($number_of_columns,$print_array[$i]);} #changes page's parameters for the one column output @@ -1331,7 +1350,7 @@ sub print_resources { } $current_output .= $rendered.'\vskip 0.5mm\noindent\makebox[\textwidth/$number_of_columns][b]{\hrulefill}\strut \vskip 0 mm \strut '; } else { - my $rendered = &unsupported($res_url); + my $rendered = &unsupported($res_url,$helper->{'VARS'}->{'LATEX_TYPE'}); if ($remove_latex_header ne 'NO') { $rendered = &latex_header_footer_remove($rendered); } else { @@ -1844,6 +1863,15 @@ CHOOSE_FROM_ANY_SEQUENCE $paramHash->{CHOICES} = [ ['No', 'no'], ['Yes', 'yes'] ]; + Apache::lonhelper::dropdown->new(); + addMessage(""); + addMessage("Print Discussions: "); + $paramHash = Apache::lonhelper::getParamHash(); + $paramHash->{'variable'} = 'PRINT_DISCUSSIONS'; + $helper->declareVar('PRINT_DISCUSSIONS'); + $paramHash->{CHOICES} = [ + ['No', 'no'], + ['Yes', 'yes'] ]; Apache::lonhelper::dropdown->new(); addMessage(""); }