[LON-CAPA-cvs] cvs: loncom /publisher testbankimport.pm

raeburn raeburn@source.lon-capa.org
Sat, 05 Mar 2011 22:25:09 -0000


raeburn		Sat Mar  5 22:25:09 2011 EDT

  Modified files:              
    /loncom/publisher	testbankimport.pm 
  Log:
  - Bug 6157.
    - Parameter for maxtries automatically set to 2 when creating 
      radiobuttonresponse from testbank import of MC (Multiple Choice)
      question (same default as used in radiobuttonresponse template).
  
  
Index: loncom/publisher/testbankimport.pm
diff -u loncom/publisher/testbankimport.pm:1.29 loncom/publisher/testbankimport.pm:1.30
--- loncom/publisher/testbankimport.pm:1.29	Mon Jan 31 17:49:13 2011
+++ loncom/publisher/testbankimport.pm	Sat Mar  5 22:25:09 2011
@@ -1,5 +1,5 @@
 # Handler for parsing text upload problem descriptions into .problems
-# $Id: testbankimport.pm,v 1.29 2011/01/31 17:49:13 raeburn Exp $
+# $Id: testbankimport.pm,v 1.30 2011/03/05 22:25:09 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1330,7 +1330,11 @@
     my $numfoils = scalar(@{$qstnref}) - 1; 
     my $datestamp = localtime;
     my $numansrs = scalar(@{$answerref});
-    my $output = '<problem>
+    my $output = '<problem>';
+    if ($qtype eq 'MC') {
+        $output .= "\n".'<parameter name="maxtries" type="int_pos" default="2" description="Maximum Number of Tries" />';
+    }
+    $output .= '
  <startouttext />';
     if ($res eq 'application/rtf' || $res eq 'text/html') {
         if ($header ne '') {