--- loncom/homework/inputtags.pm 2019/11/21 14:48:31 1.352
+++ loncom/homework/inputtags.pm 2023/04/02 03:16:28 1.358
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# input definitons
#
-# $Id: inputtags.pm,v 1.352 2019/11/21 14:48:31 raeburn Exp $
+# $Id: inputtags.pm,v 1.358 2023/04/02 03:16:28 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.',
@@ -1162,7 +1169,11 @@ sub decideoutput {
if ($target ne 'tex') {
$message .= &Apache::loncommon::help_open_topic('Some_Items_Were_Not_Submitted');
}
- $css_class=$possible_class{'not_charged_try'};
+ if (&Apache::lonhomework::show_some_problem_status()) {
+ $css_class=$possible_class{'no_charge_warn'};
+ } else {
+ $css_class=$possible_class{'not_charged_try'};
+ }
$button = 1;
} elsif ($award eq 'WRONG_NUMBOXESCHECKED') {
$message = &mt('Number of boxes checked outside permissible range (either too few or too many).');
@@ -1226,21 +1237,37 @@ sub decideoutput {
} elsif ($award eq 'UNIT_INVALID_STUDENT') {
$message = &mt('Unable to interpret units. Computer reads units as "[_1]".',&markup_unit($awardmsg,$target));
if ($target ne 'tex') {$message.=&Apache::loncommon::help_open_topic('Physical_Units');}
- $css_class=$possible_class{'not_charged_try'};
+ if (&Apache::lonhomework::show_some_problem_status()) {
+ $css_class=$possible_class{'no_charge_warn'};
+ } else {
+ $css_class=$possible_class{'not_charged_try'};
+ }
$button=1;
} elsif ($award eq 'UNIT_FAIL' || $award eq 'UNIT_IRRECONCIBLE') {
$message = &mt('Incompatible units. No conversion found between "[_1]" and the required units.',&markup_unit($awardmsg,$target));
if ($target ne 'tex') {$message.=&Apache::loncommon::help_open_topic('Physical_Units');}
- $css_class=$possible_class{'not_charged_try'};
+ if (&Apache::lonhomework::show_some_problem_status()) {
+ $css_class=$possible_class{'no_charge_warn'};
+ } else {
+ $css_class=$possible_class{'not_charged_try'};
+ }
$button=1;
} elsif ($award eq 'UNIT_NOTNEEDED') {
$message = &mt('Only a number required. Computer reads units of "[_1]".',&markup_unit($awardmsg,$target));
- $css_class=$possible_class{'not_charged_try'};
+ if (&Apache::lonhomework::show_some_problem_status()) {
+ $css_class=$possible_class{'no_charge_warn'};
+ } else {
+ $css_class=$possible_class{'not_charged_try'};
+ }
$button=1;
} elsif ($award eq 'NO_UNIT') {
$message = &mt("Units required").'.';
if ($target ne 'tex') {$message.=&Apache::loncommon::help_open_topic('Physical_Units')};
- $css_class=$possible_class{'not_charged_try'};
+ if (&Apache::lonhomework::show_some_problem_status()) {
+ $css_class=$possible_class{'no_charge_warn'};
+ } else {
+ $css_class=$possible_class{'not_charged_try'};
+ }
$button=1;
} elsif ($award eq 'COMMA_FAIL') {
$message = &mt("Proper comma separation is required").'.';
@@ -1760,12 +1787,17 @@ sub gradestatus {
}
if ( $showbutton ) {
if ($target ne 'tex') {
- $button =
+ if ($env{'form.disable_submit'}) {
+ $button = ' '.
+ '