Diff for /loncom/homework/response.pm between versions 1.221.2.2 and 1.222

version 1.221.2.2, 2011/11/29 18:44:31 version 1.222, 2011/03/07 19:42:21
Line 321  sub check_for_previous { Line 321  sub check_for_previous {
                         next if (($questiontype eq 'randomizetry') &&                          next if (($questiontype eq 'randomizetry') &&
                              ($curr_rndseed ne $Apache::lonhomework::history{"$history:resource.$partid.rndseed"}));                               ($curr_rndseed ne $Apache::lonhomework::history{"$history:resource.$partid.rndseed"}));
                         push (@{$previous{'versionci'}},$history);                          push (@{$previous{'versionci'}},$history);
                         $previous{'awardci'} = $Apache::lonhomework::history{"$history:resource.$partid.$id.awarddetail"};                          $previous{'awardci'} = $Apache::lonhomework::history{"resource.$partid.$id.awarddetail"};
                         $previous{'usedci'} = 1;                          $previous{'usedci'} = 1;
                     }                      }
                 }                  }
Line 489  sub end_customresponse { Line 489  sub end_customresponse {
  $result .= &Apache::response::answer_footer('customresponse');   $result .= &Apache::response::answer_footer('customresponse');
     }      }
     if ($target eq 'web') {      if ($target eq 'web') {
  &setup_prior_tries_hash(\&format_prior_response_custom);   &setup_prior_tries_hash(\&format_prior_response_math);
     }      }
     if ($target eq 'grade' || $target eq 'web' || $target eq 'answer' ||       if ($target eq 'grade' || $target eq 'web' || $target eq 'answer' || 
  $target eq 'tex' || $target eq 'analyze') {   $target eq 'tex' || $target eq 'analyze') {
Line 510  sub end_customresponse { Line 510  sub end_customresponse {
   
 sub format_prior_response_custom {  sub format_prior_response_custom {
     my ($mode,$answer) =@_;      my ($mode,$answer) =@_;
     if (ref($answer) eq 'ARRAY') {  
         $answer = '('.join(', ', @{ $answer }).')';  
     }  
     return '<span class="LC_prior_custom">'.      return '<span class="LC_prior_custom">'.
     &HTML::Entities::encode($answer,'"<>&').'</span>';      &HTML::Entities::encode($answer,'"<>&').'</span>';
 }  }
Line 1143  sub whichorder { Line 1140  sub whichorder {
   
 sub show_answer {  sub show_answer {
     my $part   = $Apache::inputtags::part;      my $part   = $Apache::inputtags::part;
     my $award  = $Apache::lonhomework::history{"resource.$part.solved"};      my $award  = $Apache::lonhomework::history{"resource.$part.awarded"};
     my $status = $Apache::inputtags::status[-1];      my $status = $Apache::inputtags::status[-1];
     return  ( ($award =~ /^correct/      return  ( ($award ==1
        && &Apache::lonhomework::show_problem_status())         && &Apache::lonhomework::show_problem_status())
       || $status eq "SHOW_ANSWER");        || $status eq "SHOW_ANSWER");
 }  }

Removed from v.1.221.2.2  
changed lines
  Added in v.1.222


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