--- loncom/homework/inputtags.pm 2023/02/04 22:38:31 1.356 +++ loncom/homework/inputtags.pm 2023/09/10 18:12:53 1.359 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # input definitons # -# $Id: inputtags.pm,v 1.356 2023/02/04 22:38:31 raeburn Exp $ +# $Id: inputtags.pm,v 1.359 2023/09/10 18:12:53 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -450,6 +450,7 @@ sub start_textline { 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 @@ sub start_textline { $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; @@ -470,7 +475,7 @@ sub start_textline { . ' 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') && @@ -659,8 +664,13 @@ sub file_selector { $result .= &Apache::lonhtmlcommon::row_title($addfiles); my $constraints; if ($uploadedfiletypes ne '*') { + my $showtypes = $uploadedfiletypes; + if ($showtypes =~ /,/) { + my $conjunc = &mt('or'); + $showtypes =~ s/,([^,]+)$/ $conjunc $1/; + } $constraints = - &mt('Allowed filetypes: [_1]',''.$uploadedfiletypes.'').'
'; + &mt('Allowed filetypes: [_1]',''.$showtypes.'').'
'; } if ($maxfilesize) { $constraints .= &mt('Combined size of all files not to exceed: [_1] MB.', @@ -1782,12 +1792,17 @@ sub gradestatus { } if ( $showbutton ) { if ($target ne 'tex') { - $button = + if ($env{'form.disable_submit'}) { + $button = ' '. + ''; + } else { + $button = ' '. ''; + } } }