Diff for /loncom/homework/matchresponse.pm between versions 1.93 and 1.97

version 1.93, 2016/01/22 22:42:51 version 1.97, 2025/02/21 20:55:17
Line 170  sub end_itemgroup { Line 170  sub end_itemgroup {
         undef($columns);          undef($columns);
     }      }
     if ($target eq 'web') {      if ($target eq 'web') {
   
  my $table='<table class="LC_itemgroup">'; # extra space to match what latex does.   my $table='<table class="LC_itemgroup">'; # extra space to match what latex does.
         if ((!$columns) || ($columns < 0)) {          if ((!$columns) || ($columns < 0)) {
             if ($direction eq 'horizontal') {              if ($direction eq 'horizontal') {
Line 201  sub end_itemgroup { Line 200  sub end_itemgroup {
             if ($i % $columns == 0) {              if ($i % $columns == 0) {
                 $table.='<tr>';                  $table.='<tr>';
             }              }
             $table.= '<td>'.$label.'</td><td>'.$item.'</td>';              $table.= '<th>'.$label.'</th><td>'.$item.'</td>';
             if ($columns > 1) {              if ($columns > 1) {
                 $table .= '<td>&nbsp;</td>';                  $table .= '<td>&nbsp;</td>';
             }              }
Line 685  sub displayfoils { Line 684  sub displayfoils {
     my $last_letter=$name_letter_map{$lastopt};      my $last_letter=$name_letter_map{$lastopt};
     my $optionlist = '';      my $optionlist = '';
     if ($target ne 'tex') {      if ($target ne 'tex') {
  $optionlist="<option></option>\n";   $optionlist="<option value=\"\"></option>\n";
     } else {      } else {
  if ($Apache::lonhomework::type ne 'exam') {   if ($Apache::lonhomework::type ne 'exam') {
                     if($env{'form.pdfFormFields'} eq 'yes'                      if($env{'form.pdfFormFields'} eq 'yes'
Line 702  sub displayfoils { Line 701  sub displayfoils {
     foreach $option (@used_letters) {      foreach $option (@used_letters) {
  if ($option eq $last_letter) {   if ($option eq $last_letter) {
     if ($target ne 'tex') {      if ($target ne 'tex') {
                         $optionlist.="<option selected=\"selected\">$option</option>\n";                          $optionlist.="<option value=\"$option\" selected=\"selected\">$option</option>\n";
                     } elsif ($target eq 'tex' && $env{'form.pdfFormFields'} eq 'yes'                      } elsif ($target eq 'tex' && $env{'form.pdfFormFields'} eq 'yes'
                              && $Apache::inputtags::status['-1'] eq 'CAN_ANSWER'                               && $Apache::inputtags::status['-1'] eq 'CAN_ANSWER'
                              && $Apache::lonhomework::type ne 'exam') {                               && $Apache::lonhomework::type ne 'exam') {
Line 710  sub displayfoils { Line 709  sub displayfoils {
                     }                      }
  } else {   } else {
     if ($target ne 'tex') {      if ($target ne 'tex') {
                         $optionlist.="<option>$option</option>\n";                          $optionlist.="<option value=\"$option\">$option</option>\n";
                     } elsif ($target eq 'tex' && $env{'form.pdfFormFields'} eq 'yes'                      } elsif ($target eq 'tex' && $env{'form.pdfFormFields'} eq 'yes'
                              && $Apache::inputtags::status['-1'] eq 'CAN_ANSWER'                               && $Apache::inputtags::status['-1'] eq 'CAN_ANSWER'
                              && $Apache::lonhomework::type ne 'exam') {                               && $Apache::lonhomework::type ne 'exam') {
Line 719  sub displayfoils { Line 718  sub displayfoils {
  }   }
     }      }
     if ($target ne 'tex' && $Apache::lonhomework::type ne 'exam') {      if ($target ne 'tex' && $Apache::lonhomework::type ne 'exam') {
         $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 746  sub displayfoils { Line 745  sub displayfoils {
     }      }
     if ($target ne 'tex') {      if ($target ne 'tex') {
  if ($Apache::lonhomework::type ne 'exam') {   if ($Apache::lonhomework::type ne 'exam') {
     $question.="<br />\n".$optionlist.$text;      $question.='<div class="LC_matchfoil">'."\n".$optionlist.$text.'</label></div>';
  } else {   } else {
     $question.="<br />\n".$text;      $question.="<br />\n".$text;
  }   }
Line 754  sub displayfoils { Line 753  sub displayfoils {
     my @blank;      my @blank;
     $question.=&Apache::optionresponse::webbubbles(\@used_letters,\@blank,$temp,$last_letter);      $question.=&Apache::optionresponse::webbubbles(\@used_letters,\@blank,$temp,$last_letter);
  }   }
     } else {      } else {
  # Note that if left or right positioned, we must   # Note that if left or right positioned, we must
  # confine the bubbles to righttabsize:   # confine the bubbles to righttabsize:
  #   #

Removed from v.1.93  
changed lines
  Added in v.1.97


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