Diff for /loncom/homework/rankresponse.pm between versions 1.2 and 1.3

version 1.2, 2003/01/28 00:14:55 version 1.3, 2003/03/17 20:08:21
Line 91  sub start_foilgroup { Line 91  sub start_foilgroup {
 sub end_foilgroup {  sub end_foilgroup {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;      my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
     my $result;      my $result;
     if ($target eq 'grade' || $target eq 'web' || $target eq 'answer') {      if ($target eq 'grade' || $target eq 'web' || $target eq 'answer' || $target eq 'tex') {
  my $max = &Apache::lonxml::get_param('max',$parstack,$safeeval,'-2');   my $max = &Apache::lonxml::get_param('max',$parstack,$safeeval,'-2');
  my $randomize = &Apache::lonxml::get_param('randomize',$parstack,   my $randomize = &Apache::lonxml::get_param('randomize',$parstack,
    $safeeval,'-2');     $safeeval,'-2');
  my $tol = &Apache::lonxml::get_param('tol',$parstack,$safeeval,'-2');   my $tol = &Apache::lonxml::get_param('tol',$parstack,$safeeval,'-2');
  if (!defined($tol)) { $tol=0; }   if (!defined($tol)) { $tol=0; }
  if ($target eq 'web') {   if ($target eq 'web' || $target eq 'tex') {
     $result=&displayfoils($target,$max,$randomize,$tol);      $result=&displayfoils($target,$max,$randomize,$tol);
  } elsif ($target eq 'answer' ) {   } elsif ($target eq 'answer' ) {
     $result=&displayanswers($max,$randomize,$tol);      $result=&displayanswers($max,$randomize,$tol);
Line 250  sub displayfoils { Line 250  sub displayfoils {
  my $part=$Apache::inputtags::part;   my $part=$Apache::inputtags::part;
  my $lastresponse=$Apache::lonhomework::history{"resource.$part.$id.submission"};   my $lastresponse=$Apache::lonhomework::history{"resource.$part.$id.submission"};
  my %lastresponse=&Apache::lonnet::str2hash($lastresponse);   my %lastresponse=&Apache::lonnet::str2hash($lastresponse);
    my $localcount = 1;
  foreach my $name (@whichfoils) {   foreach my $name (@whichfoils) {
     my $lastopt=$lastresponse{$name};      my $lastopt=$lastresponse{$name};
     my $optionlist="<option></option>\n";      my $optionlist='';
       if ($target ne 'tex') {$optionlist="<option></option>\n";}
     my $option;      my $option;
     foreach $option (@whichopt) {      foreach $option (@whichopt) {
  if ($option eq $lastopt) {   if ($option eq $lastopt) {
     $optionlist.="<option selected=\"on\">$option</option>\n";      if ($target ne 'tex') {$optionlist.="<option selected=\"on\">$option</option>\n";}
  } else {   } else {
     $optionlist.="<option>$option</option>\n";      if ($target ne 'tex') {$optionlist.="<option>$option</option>\n";}
  }   }
     }      }
     $optionlist='<select name="HWVAL_'.      if ($target ne 'tex') {
  $Apache::inputtags::response[-1].':'.$temp.'">'.   $optionlist='<select name="HWVAL_'.
     $optionlist."</select>\n";      $Apache::inputtags::response[-1].':'.$temp.'">'.
           $optionlist."</select>\n";
       } else {
    $optionlist=' '.$temp.' '.$optionlist.' ';
       }
     my $text=$Apache::response::foilgroup{$name.'.text'};      my $text=$Apache::response::foilgroup{$name.'.text'};
     $result.='<br />'.$optionlist.$text."\n";      if ($target ne 'tex') {
    $result.='<br />'.$optionlist.$text."\n";
       } else {$result.=' \\\\ '.$localcount.'. '.$text."\n"; $localcount++;}
     $temp++;      $temp++;
  }   }
     }      }
     $result.="<br />";      if ($target ne 'tex') {$result.="<br />";} else {$result.=' \\\\ ';}
     return $result;      return $result;
 }  }
   
Line 395  sub insert_conceptgroup { Line 403  sub insert_conceptgroup {
 sub start_foil {  sub start_foil {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;      my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
     my $result='';      my $result='';
     if ($target eq 'web' ) {      if ($target eq 'web' || $target eq 'tex') {
  &Apache::lonxml::startredirection;   &Apache::lonxml::startredirection;
     } elsif ($target eq 'edit') {      } elsif ($target eq 'edit') {
  $result=&Apache::edit::tag_start($target,$token,"Foil");   $result=&Apache::edit::tag_start($target,$token,"Foil");
Line 423  sub end_foil { Line 431  sub end_foil {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;      my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
     my $text ='';      my $text ='';
     my $result = '';      my $result = '';
     if ($target eq 'web') {      if ($target eq 'web' || $target eq 'tex') {
  $text=&Apache::lonxml::endredirection;   $text=&Apache::lonxml::endredirection;
     }      }
     if ($target eq 'web' || $target eq 'grade' || $target eq 'answer') {      if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' || $target eq 'tex') {
  my $value = &Apache::lonxml::get_param('value',$parstack,$safeeval);   my $value = &Apache::lonxml::get_param('value',$parstack,$safeeval);
  if ($value ne 'unused') {   if ($value ne 'unused') {
     my $name = &Apache::lonxml::get_param('name',$parstack,$safeeval);      my $name = &Apache::lonxml::get_param('name',$parstack,$safeeval);

Removed from v.1.2  
changed lines
  Added in v.1.3


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