[LON-CAPA-cvs] cvs: loncom /homework inputtags.pm

raeburn raeburn at source.lon-capa.org
Fri Dec 28 11:12:07 EST 2012


raeburn		Fri Dec 28 16:12:07 2012 EDT

  Modified files:              
    /loncom/homework	inputtags.pm 
  Log:
  - Modify change in rev 1.309.
  - Print textfields without error when print option is "Without Formfields". 
  
  
Index: loncom/homework/inputtags.pm
diff -u loncom/homework/inputtags.pm:1.312 loncom/homework/inputtags.pm:1.313
--- loncom/homework/inputtags.pm:1.312	Wed Dec 19 17:35:34 2012
+++ loncom/homework/inputtags.pm	Fri Dec 28 16:12:07 2012
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # input  definitons
 #
-# $Id: inputtags.pm,v 1.312 2012/12/19 17:35:34 raeburn Exp $
+# $Id: inputtags.pm,v 1.313 2012/12/28 16:12:07 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -286,12 +286,18 @@
 	    for (my $i=0;$i<int $number_of_lines*2;$i++) {$result.='\strut \\\\ ';}
 	    $result.='\strut \\\\\strut \\\\\strut \\\\\strut \\\\}}}';
 	} else {
-	    my $fieldname = $env{'request.symb'}.
-                    '&part_'. $Apache::inputtags::part.
-                    '&textresponse'.
-                    '&HWVAL_' . $Apache::inputtags::response['-1'];
-            $result.='\TextField[name='.$fieldname.',multiline=true,height=6\baselineskip,width=270,borderwidth=0,backgroundcolor={.85
-                .85 .85}]\\';
+            if ($env{'form.pdfFormFields'} eq 'yes') {
+                my $fieldname = $env{'request.symb'}.
+                                '&part_'. $Apache::inputtags::part.
+                                '&textresponse'.
+                                '&HWVAL_' . $Apache::inputtags::response['-1'];
+                $result.='\TextField[name='.$fieldname.',multiline=true,height=6\baselineskip,width=270,borderwidth=0,backgroundcolor={.85 .85 .85}]\\';
+            } else {
+                my $TeXwidth=$width_of_box/80;
+                $result = '\vskip 1 mm \fbox{\fbox{\parbox{'.$TeXwidth.'\textwidth-5mm}{';
+                for (my $i=0;$i<int $number_of_lines*2;$i++) {$result.='\strut \\\\ ';}
+                $result.='}}}\vskip 2 mm ';
+            }
 	}
     }
     return $result;




More information about the LON-CAPA-cvs mailing list