Diff for /loncom/homework/inputtags.pm between versions 1.333.2.12 and 1.333.2.12.2.4

version 1.333.2.12, 2021/12/12 21:21:44 version 1.333.2.12.2.4, 2023/09/11 12:09:06
Line 450  sub start_textline { Line 450  sub start_textline {
  if ($addchars) {   if ($addchars) {
     $result.=&addchars('HWVAL_'.$id,$addchars);      $result.=&addchars('HWVAL_'.$id,$addchars);
  }   }
                   my $numrespclass;
  my $readonly=&Apache::lonxml::get_param('readonly',$parstack,   my $readonly=&Apache::lonxml::get_param('readonly',$parstack,
  $safeeval);   $safeeval);
  if (lc($readonly) eq 'yes'    if (lc($readonly) eq 'yes' 
Line 457  sub start_textline { Line 458  sub start_textline {
     $readonly=' readonly="readonly" ';      $readonly=' readonly="readonly" ';
  } else {   } else {
     $readonly='';      $readonly='';
                       if (($Apache::inputtags::status['-1'] eq 'CAN_ANSWER') &&
                           ($tagstack->[-2] eq 'numericalresponse')) {
                           $numrespclass = ' LC_numresponse_text';
                       }
  }   }
  my $name = 'HWVAL_'.$id;   my $name = 'HWVAL_'.$id;
                 my $itemid = 'HWVAL_'.$partid.'_'.$id;                  my $itemid = 'HWVAL_'.$partid.'_'.$id;
Line 469  sub start_textline { Line 474  sub start_textline {
      . ' type="text" '.$readonly.' name="'. $name . '"'       . ' type="text" '.$readonly.' name="'. $name . '"'
      . ' id="' . $input_tag_id . '"'       . ' id="' . $input_tag_id . '"'
      . ' value="'.  $oldresponse.'"'       . ' value="'.  $oldresponse.'"'
      . ' class="LC_textline spellchecked"  size="'.$size.'"'.$maxlength.' />';       . ' class="LC_textline spellchecked'.$numrespclass.'" size="'.$size.'"'.$maxlength.' />';
   
  $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 1349  sub decideoutput { Line 1356  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 1751  sub gradestatus { Line 1759  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>';
                   }
     }      }
  }   }
   

Removed from v.1.333.2.12  
changed lines
  Added in v.1.333.2.12.2.4


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