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

sakharuk lon-capa-cvs@mail.lon-capa.org
Wed, 07 Apr 2004 18:01:19 -0000


sakharuk		Wed Apr  7 14:01:19 2004 EDT

  Modified files:              
    /loncom/interface	lonprintout.pm 
  Log:
  Changes to print problem as exam one from the construction space. It works but may be in not optimal way. Continue to work with this.
  
  
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.289 loncom/interface/lonprintout.pm:1.290
--- loncom/interface/lonprintout.pm:1.289	Tue Apr  6 11:47:52 2004
+++ loncom/interface/lonprintout.pm	Wed Apr  7 14:01:19 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Printout
 #
-# $Id: lonprintout.pm,v 1.289 2004/04/06 15:47:52 sakharuk Exp $
+# $Id: lonprintout.pm,v 1.290 2004/04/07 18:01:19 sakharuk Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -750,7 +750,7 @@
 		    my $put_result = &Apache::lonnet::put('environment',{'construct.style'=>$helper->{'VARS'}->{'style_file'}},$dom,$user);
 		}
 		my %form;
-                if ($helper->{'VARS'}->{'ANSWER_TYPE'} eq 'exam') {$form{'problemtype'}='exam';}
+                if ($helper->{'VARS'}->{'probstatus'} eq 'exam') {$form{'problemtype'}='exam';}
 		$form{'grade_target'}='tex';
 		$form{'textwidth'}=&get_textwidth($helper,$LaTeXwidth);
 		$form{'problem_split'}=$parmhash{'problem_stream_switch'};
@@ -1371,7 +1371,8 @@
     my $helper = Apache::lonhelper::helper->new("Printing Helper");
     $helper->declareVar('symb');
     $helper->declareVar('postdata');    
-    $helper->declareVar('curseed');    
+    $helper->declareVar('curseed'); 
+    $helper->declareVar('probstatus');   
     $helper->declareVar('filename');
     $helper->declareVar('construction');
     $helper->declareVar('assignment');
@@ -1431,6 +1432,9 @@
     if (!$helper->{VARS}->{'curseed'} && $ENV{'form.curseed'}) {
 	$helper->{VARS}->{'curseed'}=$ENV{'form.curseed'};
     }
+    if (!$helper->{VARS}->{'probstatus'} && $ENV{'form.problemtype'}) {
+	$helper->{VARS}->{'probstatus'}=$ENV{'form.problemtype'};
+    }
 
     my $userCanSeeHidden = Apache::lonnavmaps::advancedUser();
     my $userPriviledged = ($ENV{'request.role'}=~m/^cc\./ or
@@ -1758,7 +1762,7 @@
 	if ($helper->{'VARS'}->{'construction'}) { 
 	    my $stylevalue=$ENV{'construct.style'};
 	    my $xmlfrag .= <<"RNDSEED";
-	    <message><tr><td align='right'>Use random seed: </td><td></message>
+	    <message><tr><td align='right'>Use random seed:  </td><td></message>
 	    <string variable="curseed" size="15" maxlength="15">
 		<defaultvalue>
 	            return $helper->{VARS}->{'curseed'};