Diff for /loncom/homework/inputtags.pm between versions 1.333.2.10 and 1.333.2.12.2.3

version 1.333.2.10, 2021/09/11 16:09:56 version 1.333.2.12.2.3, 2023/09/06 20:42:00
Line 473  sub start_textline { Line 473  sub start_textline {
   
  $result .= &spellcheck_onblur($itemid, $spellcheck);   $result .= &spellcheck_onblur($itemid, $spellcheck);
                 if (($Apache::inputtags::status['-1'] eq 'CAN_ANSWER') &&                  if (($Apache::inputtags::status['-1'] eq 'CAN_ANSWER') &&
                     (($tagstack->[-2] eq 'formularesponse') || ($tagstack->[-2] eq 'mathresponse')) &&                      (((($tagstack->[-2] eq 'formularesponse') || ($tagstack->[-2] eq 'mathresponse')) &&
                     (&Apache::lonnet::EXT('resource.'.$partid.'_'.$id.'.turnoffeditor') ne 'yes')) {                        (&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);                      $result.=&edit_mathresponse_button($input_tag_id);
                 }                  }
     }      }
Line 1152  sub decideoutput { Line 1154  sub decideoutput {
         if ($target ne 'tex') {          if ($target ne 'tex') {
            $message .= &Apache::loncommon::help_open_topic('Some_Items_Were_Not_Submitted');             $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;   $button = 1;
     } elsif ($award eq 'WRONG_NUMBOXESCHECKED') {      } elsif ($award eq 'WRONG_NUMBOXESCHECKED') {
         $message = &mt('Number of boxes checked outside permissible range (either too few or too many).');          $message = &mt('Number of boxes checked outside permissible range (either too few or too many).');
Line 1201  sub decideoutput { Line 1207  sub decideoutput {
     } elsif ($award eq 'SIG_FAIL') {      } elsif ($award eq 'SIG_FAIL') {
  my ($used,$min,$max)=split(':',$awardmsg);   my ($used,$min,$max)=split(':',$awardmsg);
  my $word = ($used < $min) ? 'more' : 'fewer';   my $word = ($used < $min) ? 'more' : 'fewer';
  $message = &mt("Submission not graded. Use $word significant figures.",$used);   $message = &mt("Submission not graded. Use $word significant figures.");
         if (&Apache::lonhomework::show_some_problem_status()) {          if (&Apache::lonhomework::show_some_problem_status()) {
             $css_class=$possible_class{'no_charge_warn'};              $css_class=$possible_class{'no_charge_warn'};
         } else {          } else {
Line 1216  sub decideoutput { Line 1222  sub decideoutput {
     } elsif ($award eq 'UNIT_INVALID_STUDENT') {      } elsif ($award eq 'UNIT_INVALID_STUDENT') {
  $message = &mt('Unable to interpret units. Computer reads units as "[_1]".',&markup_unit($awardmsg,$target));   $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');}    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;   $button=1;
     } elsif ($award eq 'UNIT_FAIL' || $award eq 'UNIT_IRRECONCIBLE') {      } 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));   $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');}    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;   $button=1;
     } elsif ($award eq 'UNIT_NOTNEEDED') {      } elsif ($award eq 'UNIT_NOTNEEDED') {
  $message = &mt('Only a number required. Computer reads units of "[_1]".',&markup_unit($awardmsg,$target));   $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;   $button=1;
     } elsif ($award eq 'NO_UNIT') {      } elsif ($award eq 'NO_UNIT') {
  $message = &mt("Units required").'.';   $message = &mt("Units required").'.';
  if ($target ne 'tex') {$message.=&Apache::loncommon::help_open_topic('Physical_Units')};   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;   $button=1;
     } elsif ($award eq 'COMMA_FAIL') {      } elsif ($award eq 'COMMA_FAIL') {
  $message = &mt("Proper comma separation is required").'.';   $message = &mt("Proper comma separation is required").'.';
Line 1329  sub decideoutput { Line 1351  sub decideoutput {
             my $first_access=&Apache::lonnet::get_first_access($interval[1]);              my $first_access=&Apache::lonnet::get_first_access($interval[1]);
             if (defined($first_access)) {              if (defined($first_access)) {
                 my $due_date= &Apache::lonnet::EXT("resource.$part.duedate");                  my $due_date= &Apache::lonnet::EXT("resource.$part.duedate");
                 unless (($due_date) && ($due_date < $first_access + $interval[0])) {                   my ($timelimit) = ($interval[0] =~ /^(\d+)/);
                   unless (($due_date) && ($due_date < $first_access + $timelimit)) {
                     $message = &mt("Answer Submitted: Your final submission will be graded when the time limit is reached.");                      $message = &mt("Answer Submitted: Your final submission will be graded when the time limit is reached.");
                 }                  }
             }              }
Line 1731  sub gradestatus { Line 1754  sub gradestatus {
  }   }
  if ( $showbutton ) {   if ( $showbutton ) {
     if ($target ne 'tex') {      if ($target ne 'tex') {
  $button =                   if ($env{'form.disable_submit'}) {
                       $button = '<input type="submit" name="submit_'.$id.'" id="submit_'.$id.'" class="LC_hwk_submit" value="'.&mt('Submit Answer').'" disabled="disabled" />&nbsp;'.
                                  '<div id="msg_submit_'.$id.'" style="display:none"></div>';
                   } else {
       $button = 
             '<input onmouseup="javascript:setSubmittedPart(\''.$id.'\');this.form.action+=\'#'.&escape($id).'\';"              '<input onmouseup="javascript:setSubmittedPart(\''.$id.'\');this.form.action+=\'#'.&escape($id).'\';"
                     type="submit" name="submit_'.$id.'" id="submit_'.$id.'" class="LC_hwk_submit"                      type="submit" name="submit_'.$id.'" id="submit_'.$id.'" class="LC_hwk_submit"
                     value="'.&mt('Submit Answer').'" />&nbsp;'.                      value="'.&mt('Submit Answer').'" />&nbsp;'.
                     '<div id="msg_submit_'.$id.'" style="display:none">'.                      '<div id="msg_submit_'.$id.'" style="display:none">'.
                     &mt('Processing your submission ...').'</div>';                      &mt('Processing your submission ...').'</div>';
                   }
     }      }
  }   }
   
Line 1879  sub previous_tries { Line 1907  sub previous_tries {
     my $prefix = $env{'form.request.prefix'};      my $prefix = $env{'form.request.prefix'};
     $prefix =~ tr{.}{_};      $prefix =~ tr{.}{_};
     my $function_name = 'LONCAPA_previous_tries_'.$prefix;      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;          $function_name .= $Apache::lonxml::curdepth;
     } else {      } else {
         $function_name .= &js_escape($id);          $function_name .= $id;
     }      }
     $function_name .= '_'.$Apache::lonxml::counter;      $function_name .= '_'.$Apache::lonxml::counter;
     my $possmathjax = 1;      my $possmathjax = 1;

Removed from v.1.333.2.10  
changed lines
  Added in v.1.333.2.12.2.3


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>