[LON-CAPA-cvs] cvs: loncom /homework essayresponse.pm /interface lonpdfupload.pm

raeburn raeburn at source.lon-capa.org
Thu Mar 26 13:46:57 EDT 2026


raeburn		Thu Mar 26 17:46:57 2026 EDT

  Modified files:              
    /loncom/interface	lonpdfupload.pm 
    /loncom/homework	essayresponse.pm 
  Log:
  - Bug 6121 PDF form fields
    Use radio buttons instead of a checkbox above textarea for essayresponse 
    to indicate if text in filled form field is to be graded or is a draft.
  
  
Index: loncom/interface/lonpdfupload.pm
diff -u loncom/interface/lonpdfupload.pm:1.37 loncom/interface/lonpdfupload.pm:1.38
--- loncom/interface/lonpdfupload.pm:1.37	Thu Mar 26 02:49:57 2026
+++ loncom/interface/lonpdfupload.pm	Thu Mar 26 17:46:56 2026
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # PDF Form Upload Handler
 #
-# $Id: lonpdfupload.pm,v 1.37 2026/03/26 02:49:57 raeburn Exp $
+# $Id: lonpdfupload.pm,v 1.38 2026/03/26 17:46:56 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -266,7 +266,8 @@
             if ((ref($dict)) && (ref($dict->{'V'}))) {
                 $value = $dict->{'V'}{'value'};
             }
-            if (($unencfield =~ /^uuid_/) && ($unencfield =~ /&radiobutton&/)) {
+            if (($unencfield =~ /^uuid_/) &&
+                ($unencfield =~ /(&radiobutton&|&essay&HWDRAFT_)/)) {
                 if (($value eq '') || ($value eq 'Off')) {
                     $radiobutton{$field} = $unencfield;
                 } else {
Index: loncom/homework/essayresponse.pm
diff -u loncom/homework/essayresponse.pm:1.129 loncom/homework/essayresponse.pm:1.130
--- loncom/homework/essayresponse.pm:1.129	Mon Mar 23 00:22:19 2026
+++ loncom/homework/essayresponse.pm	Thu Mar 26 17:46:57 2026
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # essay (ungraded) style responses
 #
-# $Id: essayresponse.pm,v 1.129 2026/03/23 00:22:19 raeburn Exp $
+# $Id: essayresponse.pm,v 1.130 2026/03/26 17:46:57 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -147,15 +147,21 @@
             if ((exists($uuids{$env{'request.course.id'}.':'.$env{'request.symb'}})) &&
                 ($uuids{$env{'request.course.id'}.':'.$env{'request.symb'}})) {
 
-                my $fieldname = 'uuid_'.$uuids{$env{'request.course.id'}.':'.$env{'request.symb'}}
-                               .'&user_'.$digest
-                               .'&part_'.$part
-                               .'&essay'
-                               .'&HWDRAFT_'.$id;
-                return '\vskip 4 mm'.
-                       &Apache::lonxml::print_pdf_checkbox($fieldname,'yes').' '.
-                       &mt('Check if submitting for grading. Uncheck if saving a draft.').
-                       '\strut \\\\ \strut \\\\';
+                my $fieldname = 'uuid\_'.$uuids{$env{'request.course.id'}.':'.$env{'request.symb'}}
+                               .'\&user\_'.$digest
+                               .'\&part\_'.$part
+                               .'\&essay'
+                               .'\&HWDRAFT\_'.$id;
+                return "\\begin{itemize}"
+                      .'\item[{'
+                      .&Apache::lonxml::print_pdf_radiobutton($fieldname,'yes')
+                      .'}]'
+                      .$label{'submit'}{$resptype}
+                      .'\item[{'
+                      .&Apache::lonxml::print_pdf_radiobutton($fieldname,'no')
+                      . '}]'
+                      .$label{'draft'}{$resptype}
+                      ."\\end{itemize}";
             }
         }
     }




More information about the LON-CAPA-cvs mailing list