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

onken lon-capa-cvs-allow@mail.lon-capa.org
Wed, 10 Sep 2008 08:47:19 -0000


onken		Wed Sep 10 04:47:19 2008 EDT

  Modified files:              
    /loncom/homework	inputtags.pm 
  Log:
  Adds Textfields to PDF-Forms 
  
  
Index: loncom/homework/inputtags.pm
diff -u loncom/homework/inputtags.pm:1.245 loncom/homework/inputtags.pm:1.246
--- loncom/homework/inputtags.pm:1.245	Mon Sep  1 06:01:57 2008
+++ loncom/homework/inputtags.pm	Wed Sep 10 04:47:15 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # input  definitons
 #
-# $Id: inputtags.pm,v 1.245 2008/09/01 10:01:57 bisitz Exp $
+# $Id: inputtags.pm,v 1.246 2008/09/10 08:47:15 onken Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -358,8 +358,15 @@
 	     && $Apache::lonhomework::type ne 'exam') {
 	my $size = &Apache::lonxml::get_param('size',$parstack,$safeeval);
 	if ($size != 0) {$size=$size*2; $size.=' mm';} else {$size='40 mm';}
-	$result='\framebox['.$size.'][s]{\tiny\strut}';
-
+	if ($env{'form.pdfFormFields'} eq 'yes') {
+            my $fieldname = $env{'request.symb'}.
+                                 '&part_'. $Apache::inputtags::part.
+                                 '&textresponse'.
+                                 '&HWVAL_' . $Apache::inputtags::response['-1'];
+            $result="\n\\\\\n".'\textField{'.$fieldname.'}{'.$size.'}{12 bp}';
+        } else {
+            $result='\framebox['.$size.'][s]{\tiny\strut}';
+        }
     } elsif ($target eq 'tex' 
 	     && $Apache::lonhomework::type eq 'exam'
 	     && &needs_exam_box($tagstack)) {