Diff for /loncom/homework/optionresponse.pm between versions 1.201 and 1.203

version 1.201, 2018/02/28 13:20:50 version 1.203, 2025/01/27 14:18:38
Line 106  sub start_foilgroup { Line 106  sub start_foilgroup {
   $Apache::optionresponse::conceptgroup=0;    $Apache::optionresponse::conceptgroup=0;
   &Apache::response::pushrandomnumber(undef,$target);    &Apache::response::pushrandomnumber(undef,$target);
   if ($target eq 'edit') {    if ($target eq 'edit') {
     my $optionlist="<option></option>\n";      my $optionlist="<option value=\"\"></option>\n";
     my $option;      my $option;
     my @opt;      my @opt;
     my @raw_options = &Apache::lonxml::get_param('options', $parstack, $safeeval, 0,  0, 1);      my @raw_options = &Apache::lonxml::get_param('options', $parstack, $safeeval, 0,  0, 1);
Line 745  sub displayfoils { Line 745  sub displayfoils {
   }    }
       }        }
       my $lastopt=$lastresponse{$name};        my $lastopt=$lastresponse{$name};
       my $optionlist="<option></option>\n";        my $optionlist="<option value=\"\"></option>\n";
   
       if($target eq 'tex' and $env{'form.pdfFormFields'} eq 'yes'        if($target eq 'tex' and $env{'form.pdfFormFields'} eq 'yes'
          && $Apache::inputtags::status[-1] eq 'CAN_ANSWER') {           && $Apache::inputtags::status[-1] eq 'CAN_ANSWER') {
Line 793  sub displayfoils { Line 793  sub displayfoils {
 # lastopt is what the user submitted before  # lastopt is what the user submitted before
 # defopt is what the field is going to start out with: either previous choice or altopt  # defopt is what the field is going to start out with: either previous choice or altopt
 # fieldname is this input field's name after HWVAL_  # fieldname is this input field's name after HWVAL_
                   $optionlist='<input type="hidden" name="HWVAL_'.$fieldname.'" value="'.$escdefopt.'" />'.                    $optionlist='<input type="hidden" name="HWVAL_'.$fieldname.'" value="'.$escdefopt.'" /><label>'.
                   '<input type="checkbox" name="HWCHK_'.$fieldname.'" onclick="javascript:if (this.form.elements[\'HWCHK_'.                    '<input type="checkbox" name="HWCHK_'.$fieldname.'" onclick="javascript:if (this.form.elements[\'HWCHK_'.
                   $fieldname.'\'].checked) { this.form.elements[\'HWVAL_'.$fieldname.'\'].value=\''.$esccheckboxopt.'\'; } else { this.form.elements[\'HWVAL_'.$fieldname.'\'].value=\''.$escaltopt.'\'; };javascript:setSubmittedPart(\''.$part.'\');"'.($defopt eq $checkboxopt?' checked="checked"':'')." />\n";                    $fieldname.'\'].checked) { this.form.elements[\'HWVAL_'.$fieldname.'\'].value=\''.$esccheckboxopt.'\'; } else { this.form.elements[\'HWVAL_'.$fieldname.'\'].value=\''.$escaltopt.'\'; };javascript:setSubmittedPart(\''.$part.'\');"'.($defopt eq $checkboxopt?' checked="checked"':'')." />\n";
               } else {                } else {
 # classic selection list  # classic selection list
           $optionlist='<select onchange="javascript:setSubmittedPart(\''.            $optionlist='<label><select onchange="javascript:setSubmittedPart(\''.
   $part.'\');" name="HWVAL_'.    $part.'\');" name="HWVAL_'.
   $Apache::inputtags::response['-1'].':'.$temp.'">'.    $Apache::inputtags::response['-1'].':'.$temp.'">'.
   $optionlist."</select>\n";    $optionlist."</select>\n";
Line 820  sub displayfoils { Line 820  sub displayfoils {
   $result.=$break.$text."\n";    $result.=$break.$text."\n";
   if ($Apache::lonhomework::type eq 'exam') {    if ($Apache::lonhomework::type eq 'exam') {
       $result.=&webbubbles(\@opt,\@alphabet,$temp,$lastopt);        $result.=&webbubbles(\@opt,\@alphabet,$temp,$lastopt);
     } else {
         $result.= '</label>';
   }    }
   $temp++;    $temp++;
       } else {        } else {

Removed from v.1.201  
changed lines
  Added in v.1.203


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