--- loncom/homework/inputtags.pm 2021/09/05 16:27:16 1.354
+++ loncom/homework/inputtags.pm 2023/03/30 23:25:47 1.357
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# input definitons
#
-# $Id: inputtags.pm,v 1.354 2021/09/05 16:27:16 raeburn Exp $
+# $Id: inputtags.pm,v 1.357 2023/03/30 23:25:47 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -474,8 +474,10 @@ sub start_textline {
$result .= &spellcheck_onblur($itemid, $spellcheck);
if (($Apache::inputtags::status['-1'] eq 'CAN_ANSWER') &&
- (($tagstack->[-2] eq 'formularesponse') || ($tagstack->[-2] eq 'mathresponse')) &&
- (&Apache::lonnet::EXT('resource.'.$partid.'_'.$id.'.turnoffeditor') ne 'yes')) {
+ (((($tagstack->[-2] eq 'formularesponse') || ($tagstack->[-2] eq 'mathresponse')) &&
+ (&Apache::lonnet::EXT('resource.'.$partid.'_'.$id.'.turnoffeditor') ne 'yes')) ||
+ (($tagstack->[-2] eq 'customresponse') &&
+ (&Apache::lonnet::EXT('resource.'.$partid.'_'.$id.'.turnoffeditor') eq 'no')))) {
$result.=&edit_mathresponse_button($input_tag_id);
}
}
@@ -657,8 +659,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.',
@@ -1930,10 +1937,10 @@ sub previous_tries {
my $prefix = $env{'form.request.prefix'};
$prefix =~ tr{.}{_};
my $function_name = 'LONCAPA_previous_tries_'.$prefix;
- if (($env{'request.state'} eq 'construct') || ($id =~ /[._]|[^\w\s\-]/)) {
+ if (($env{'request.state'} eq 'construct') || ($id =~ /\W/)) {
$function_name .= $Apache::lonxml::curdepth;
} else {
- $function_name .= &js_escape($id);
+ $function_name .= $id;
}
$function_name .= '_'.$Apache::lonxml::counter;
my $possmathjax = 1;