[LON-CAPA-cvs] cvs: loncom /interface lonprintout.pm

sakharuk lon-capa-cvs@mail.lon-capa.org
Wed, 14 May 2003 18:15:03 -0000


sakharuk		Wed May 14 14:15:03 2003 EDT

  Modified files:              
    /loncom/interface	lonprintout.pm 
  Log:
  It is possible now to print the whole sequence of problems with answers. The same is true with respect to printing the sequence with html/xml resources. Moreover, you can build your own arbitrary set of resources from the whole course and print them with answers.
  
  
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.170 loncom/interface/lonprintout.pm:1.171
--- loncom/interface/lonprintout.pm:1.170	Wed May 14 14:06:36 2003
+++ loncom/interface/lonprintout.pm	Wed May 14 14:15:03 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Printout
 #
-# $Id: lonprintout.pm,v 1.170 2003/05/14 18:06:36 sakharuk Exp $
+# $Id: lonprintout.pm,v 1.171 2003/05/14 18:15:03 sakharuk Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1387,7 +1387,6 @@
 		$form{'answer_output_mode'}='tex';
 		$form{'rndseed'}=$rndseed;
 		my $answer=&Apache::lonnet::ssi($currentURL,%form);
-#		$r->print('<pre>'.$answer.'</pre>'); return OK;
 		$texversion=~s/(\\keephidden{ENDOFPROBLEM})/$answer$1/;
 	    }
 	    $result .= $texversion;
@@ -1420,7 +1419,7 @@
 	    } elsif ($helper->{'VARS'}->{'PRINT_TYPE'} eq 'all_problems') {
 		$selectionmade = 4;
 	    }
-	    my %form;
+	    my %form;	   
 	    $form{'grade_target'}='tex';
 	    $form{'textwidth'}=$LaTeXwidth;
 	    $form{'symb'}=$master_seq[$i];
@@ -1436,6 +1435,13 @@
 		$texversion = &latex_header_footer_remove($texversion);
 	    } else {
 		$texversion =~ s/\\end{document}//;
+	    }
+	    if($helper->{'VARS'}->{'ANSWER_TYPE'} eq 'no') {
+		my %form;
+		$form{'grade_target'}='answer';
+		$form{'answer_output_mode'}='tex';
+		my $answer=&Apache::lonnet::ssi($urlp,%form);
+		$texversion=~s/(\\keephidden{ENDOFPROBLEM})/$answer$1/;
 	    }
 	    $result .= $texversion;         
 	    $flag_latex_header_remove = 'YES';