Diff for /loncom/homework/inputtags.pm between versions 1.355 and 1.359

version 1.355, 2021/09/07 20:37:33 version 1.359, 2023/09/10 18:12:53
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 470  sub start_textline { Line 475  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 657  sub file_selector { Line 664  sub file_selector {
     $result .= &Apache::lonhtmlcommon::row_title($addfiles);      $result .= &Apache::lonhtmlcommon::row_title($addfiles);
     my $constraints;      my $constraints;
     if ($uploadedfiletypes ne '*') {      if ($uploadedfiletypes ne '*') {
           my $showtypes = $uploadedfiletypes;
           if ($showtypes =~ /,/) {
               my $conjunc = &mt('or');
               $showtypes =~ s/,([^,]+)$/ $conjunc $1/;
           }
  $constraints =   $constraints =
     &mt('Allowed filetypes: [_1]','<b>'.$uploadedfiletypes.'</b>').'<br />';      &mt('Allowed filetypes: [_1]','<b>'.$showtypes.'</b>').'<br />';
     }      }
     if ($maxfilesize) {      if ($maxfilesize) {
         $constraints .= &mt('Combined size of all files not to exceed: [_1] MB.',          $constraints .= &mt('Combined size of all files not to exceed: [_1] MB.',
Line 1780  sub gradestatus { Line 1792  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.355  
changed lines
  Added in v.1.359


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