Diff for /loncom/homework/lonhomework.pm between versions 1.276 and 1.277

version 1.276, 2007/10/08 09:22:50 version 1.277, 2007/10/17 00:22:51
Line 398  sub check_access { Line 398  sub check_access {
     if ($env{'request.state'} eq "construct") {      if ($env{'request.state'} eq "construct") {
  if ($env{'form.problemstate'}) {   if ($env{'form.problemstate'}) {
     if ($env{'form.problemstate'} =~ /^CANNOT_ANSWER/) {      if ($env{'form.problemstate'} =~ /^CANNOT_ANSWER/) {
  if ( ! ($env{'form.problemstate'} eq 'CANNOT_ANSWER_correct' &&   if ( ! ($env{'form.problemstate'} eq 'CANNOT_ANSWER_correct' 
  lc($Apache::lonhomework::problemstatus) eq 'no')) {   && &hide_problem_status())) {
     return ('CANNOT_ANSWER',      return ('CANNOT_ANSWER',
     &mt('is in this state due to author settings.'));      &mt('is in this state due to author settings.'));
  }   }
Line 489  sub check_access { Line 489  sub check_access {
  # if (correct and show prob status) or excused then CANNOT_ANSWER   # if (correct and show prob status) or excused then CANNOT_ANSWER
  if(($Apache::lonhomework::history{"resource.$id.solved"}=~/^correct/   if(($Apache::lonhomework::history{"resource.$id.solved"}=~/^correct/
     &&      &&
     lc($Apache::lonhomework::problemstatus) ne 'no')      &show_problem_status())
    ||     ||
    $Apache::lonhomework::history{"resource.$id.solved"}=~/^excused/) {     $Apache::lonhomework::history{"resource.$id.solved"}=~/^excused/) {
     $status = 'CANNOT_ANSWER';      $status = 'CANNOT_ANSWER';
Line 861  sub analyze { Line 861  sub analyze {
     return $result;      return $result;
 }  }
   
   {
       my $show_problem_status;
       sub reset_show_problem_status {
    undef($show_problem_status);
       }
   
       sub set_show_problem_status {
    my ($new_status) = @_;
    $show_problem_status = lc($new_status);
       }
   
       sub hide_problem_status {
    return ($show_problem_status eq 'no'
    || $show_problem_status eq 'no_feedback_ever');
       }
   
       sub show_problem_status {
    return ($show_problem_status eq 'yes'
    || $show_problem_status eq '');
       }
       
       sub show_some_problem_status {
    return ($show_problem_status eq 'no');
       }
   
       sub show_no_problem_status {
    return ($show_problem_status eq 'no_feedback_ever');
       }
   }
   
 sub editxmlmode {  sub editxmlmode {
     my ($request,$file) = @_;      my ($request,$file) = @_;
     my $result;      my $result;

Removed from v.1.276  
changed lines
  Added in v.1.277


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