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

sakharuk lon-capa-cvs@mail.lon-capa.org
Thu, 02 Oct 2003 20:34:27 -0000


sakharuk		Thu Oct  2 16:34:27 2003 EDT

  Modified files:              
    /loncom/interface	lonprintout.pm 
  Log:
  Fixed a few small my own bugs - title is now printed for each resource, resources which can not have answers are ignored during printing only answers, ...
  
  
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.248 loncom/interface/lonprintout.pm:1.249
--- loncom/interface/lonprintout.pm:1.248	Thu Oct  2 15:10:06 2003
+++ loncom/interface/lonprintout.pm	Thu Oct  2 16:34:27 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Printout
 #
-# $Id: lonprintout.pm,v 1.248 2003/10/02 19:10:06 bowersj2 Exp $
+# $Id: lonprintout.pm,v 1.249 2003/10/02 20:34:27 sakharuk Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -786,8 +786,9 @@
 			$form{'rndseed'}=$rndseed;
 			$texversion=&Apache::lonnet::ssi($urlp,%form);
 		    }
-		    if(($helper->{'VARS'}->{'ANSWER_TYPE'} eq 'no') ||
-		       ($helper->{'VARS'}->{'ANSWER_TYPE'} eq 'only')) {
+		    if((($helper->{'VARS'}->{'ANSWER_TYPE'} eq 'no') ||
+		       ($helper->{'VARS'}->{'ANSWER_TYPE'} eq 'only')) && 
+		       ($urlp=~/\.(problem|exam|quiz|assess|survey|form|library|page)$/)) {
 			my %form;
 			$form{'grade_target'}='answer';
 			$form{'answer_output_mode'}='tex';
@@ -879,10 +880,14 @@
 		if ($helper->{'VARS'}->{'ANSWER_TYPE'} eq 'no') {
 		    $texversion=~s/(\\keephidden{ENDOFPROBLEM})/$answer$1/;
 		} else {
-		    $texversion=&print_latex_header($helper->{'VARS'}->{'LATEX_TYPE'});
-		    $texversion.='\vskip 0 mm \noindent\textbf{'.&Apache::lonnet::gettitle($helper->{'VARS'}->{'symb'}).'}\vskip 0 mm ';
-		    $texversion.=&path_to_problem ($urlp,$LaTeXwidth);
-		    $texversion.='\vskip 1 mm '.$answer;
+		    if ($urlp=~/\.(problem|exam|quiz|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);
+			$texversion.='\vskip 1 mm '.$answer;
+		    } else {
+			$texversion='';
+		    }
 		}
 	    }
 	    if ($flag_latex_header_remove ne 'NO') {
@@ -1352,7 +1357,7 @@
     # another resource selector for that sequence
     if (!$helper->{VARS}->{'construction'}) {
 	push @$printChoices, ["Resources from <b>selected sequence</b> in course",
-			      'selected_sequence', 'CHOOSE_SEQUENCE'];
+			      'select_sequences', 'CHOOSE_SEQUENCE'];
 	my $escapedSequenceName = $helper->{VARS}->{'SEQUENCE'};
 	#Escape apostrophes and backslashes for Perl
 	$escapedSequenceName =~ s/\\/\\\\/g;