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

raeburn raeburn at source.lon-capa.org
Mon Sep 11 09:44:18 EDT 2023


raeburn		Mon Sep 11 13:44:18 2023 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/homework	inputtags.pm 
  Log:
  - For 2.11
    Backport 1.359
  
  
Index: loncom/homework/inputtags.pm
diff -u loncom/homework/inputtags.pm:1.333.2.13 loncom/homework/inputtags.pm:1.333.2.14
--- loncom/homework/inputtags.pm:1.333.2.13	Sun Feb  5 00:17:42 2023
+++ loncom/homework/inputtags.pm	Mon Sep 11 13:44:18 2023
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # input  definitons
 #
-# $Id: inputtags.pm,v 1.333.2.13 2023/02/05 00:17:42 raeburn Exp $
+# $Id: inputtags.pm,v 1.333.2.14 2023/09/11 13:44:18 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -450,6 +450,7 @@
 		if ($addchars) {
 		    $result.=&addchars('HWVAL_'.$id,$addchars);
 		}
+                my $numrespclass;
 		my $readonly=&Apache::lonxml::get_param('readonly',$parstack,
 							$safeeval);
 		if (lc($readonly) eq 'yes' 
@@ -457,6 +458,10 @@
 		    $readonly=' readonly="readonly" ';
 		} else {
 		    $readonly='';
+                    if (($Apache::inputtags::status['-1'] eq 'CAN_ANSWER') &&
+                        ($tagstack->[-2] eq 'numericalresponse')) {
+                        $numrespclass = ' LC_numresponse_text';
+                    }
 		}
 		my $name = 'HWVAL_'.$id;
                 my $itemid = 'HWVAL_'.$partid.'_'.$id;
@@ -469,7 +474,7 @@
 		     . ' type="text" '.$readonly.' name="'. $name . '"'
 		     . ' id="' . $input_tag_id . '"'
 		     . ' value="'.  $oldresponse.'"'
-		     . ' class="LC_textline spellchecked"  size="'.$size.'"'.$maxlength.' />';
+		     . ' class="LC_textline spellchecked'.$numrespclass.'" size="'.$size.'"'.$maxlength.' />';
 
 		$result .= &spellcheck_onblur($itemid, $spellcheck);
                 if (($Apache::inputtags::status['-1'] eq 'CAN_ANSWER') &&




More information about the LON-CAPA-cvs mailing list