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

foxr lon-capa-cvs-allow@mail.lon-capa.org
Mon, 10 Mar 2008 10:10:19 -0000


foxr		Mon Mar 10 06:10:19 2008 EDT

  Modified files:              
    /loncom/interface	lonprintout.pm 
  Log:
  BZ 5623 - Properly propagate default value for print mode
  from the consruction space 'Problem type' dropdown.
  
  
  
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.517 loncom/interface/lonprintout.pm:1.518
--- loncom/interface/lonprintout.pm:1.517	Mon Mar 10 04:54:19 2008
+++ loncom/interface/lonprintout.pm	Mon Mar 10 06:10:18 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Printout
 #
-# $Id: lonprintout.pm,v 1.517 2008/03/10 08:54:19 foxr Exp $
+# $Id: lonprintout.pm,v 1.518 2008/03/10 10:10:18 foxr Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2484,6 +2484,10 @@
     $helper->declareVar("showallfoils");
     $helper->declareVar("STUDENTS");
 
+
+   
+
+
     #  The page breaks can get loaded initially from the course environment:
     # But we only do this in the initial state so that they are allowed to change.
     #
@@ -3206,19 +3210,24 @@
 
 
 	    addMessage("<tr><td>Problem Type:</td><td>");
-	    $paramHash = &Apache::lonhelper::getParamHash();
-	    $paramHash->{'variable'} = 'probstatus'; # Already declared:
 	    #
 	    # Initial value from construction space:
 	    #
 	    if (!$helper->{VARS}->{'probstatus'} && $env{'form.problemtype'}) {
 		$helper->{VARS}->{'probstatus'} = $env{'form.problemtype'};	# initial value
 	    }
-	    $paramHash->{CHOICES} = [
-				     ['Homework problem',     'problem'],
-				     ['Exam Problem', 'exam'],
-				     ['Survey question',      'survey']];
-	    Apache::lonhelper::dropdown->new();
+	    $xmlfrag = << "PROBTYPE";
+		<dropdown variable="probstatus" multichoice="0" allowempty="0">
+		   <defaultvalue>
+		      return "$helper->{VARS}->{'probstatus'}";
+                   </defaultvalue>
+		   <choice computer="problem">Homework Problem</choice>
+		   <choice computer="exam">Exam Problem</choice>
+		   <choice computer="survey">Survey question</choice>
+		</dropdown>
+PROBTYPE
+            &Apache::lonxml::xmlparse($r, 'helper', $xmlfrag);
+	    
 	    addMessage("</td></tr>"); 
 
 	}