Diff for /loncom/homework/bridgetask.pm between versions 1.52 and 1.53

version 1.52, 2005/09/21 21:54:20 version 1.53, 2005/09/22 22:25:35
Line 204  sub preserve_grade_info { Line 204  sub preserve_grade_info {
     return $result;      return $result;
 }  }
   
   sub style {
       return (<<STYLE);
   <style type="text/css">
   .fail, .pass, .neutral {
       position: relative;
       margin : 5px;
       margin-bottom :10px;
       padding : 4px;
       padding-left : 75px;
    border : thin solid;
       font-weight : bolder;
       font-size: smaller;
       font-family: Arial;
       background-color : rgb(255,240,225);
   }
   
   .fail h4, .pass h4 {
    position:absolute;
    left: -4px;
    top: -8px;
    padding:2px;
    margin:0;
    background-color : rgb(255,240,225);
    border : thin solid;
   }
   
   .fail {
    color: red;
   }
   
   .pass {
       color : green;
   }
   
   .neutral {
    color : blue;
   }
   
   .question {
    border : thin solid black;
    padding : 4px;
    margin-bottom : 1em;
   }
   
   .grade {
    font-size: x-large;
    font-family: Arial;
    position:absolute;
    left: 5px;
    top: -5px;
    width: 70px;
   }
   
   div#feedback h1 {
       color : inherit;
   }
   </style>
   STYLE
   
   }
   
 sub start_Task {  sub start_Task {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;      my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
   
Line 291  sub start_Task { Line 352  sub start_Task {
  } elsif ($target eq 'web') {   } elsif ($target eq 'web') {
     my $name= &Apache::structuretags::get_resource_name($parstack,$safeeval);      my $name= &Apache::structuretags::get_resource_name($parstack,$safeeval);
     $result.="$head_tag_start<title>$name</title></head>      $result.="$head_tag_start<title>$name</title></head>
               $body_tag_start \n";                $body_tag_start \n".&style();
           
     my ($version,$previous)=&get_version();      my ($version,$previous)=&get_version();
     if ($Apache::lonhomework::history{"resource.$version.status"} eq 'fail') {      if ($Apache::lonhomework::history{"resource.$version.status"} eq 'fail') {
Line 1145  sub get_instance { Line 1206  sub get_instance {
  foreach my $id (@{$dimension{$instance.'.criterias'}}) {   foreach my $id (@{$dimension{$instance.'.criterias'}}) {
     my $status=$Apache::lonhomework::history{"resource.$version.$dim.$instance.$id.status"};      my $status=$Apache::lonhomework::history{"resource.$version.$dim.$instance.$id.status"};
     my $comment=$Apache::lonhomework::history{"resource.$version.$dim.$instance.$id.comment"};      my $comment=$Apache::lonhomework::history{"resource.$version.$dim.$instance.$id.comment"};
     $result.='<table border="1"><tr><td>';      my $mandatory=($dimension{$instance.'.criteria.'.$id.'.mandatory'} ne 'N');
       if ($mandatory) {
    $mandatory='Mandatory';
       } else {
    $mandatory='Optional';
       }
     if ($status eq 'fail') {      if ($status eq 'fail') {
  $result.='<font color="red">'.&mt('Did not pass').'</font>';  
     } elsif ($status eq 'pass') {      } elsif ($status eq 'pass') {
  $result.='<font color="green">'.&mt('Passed').'</font>';  
     } else {      } else {
  &Apache::lonxml::error("Student viewing a graded bridgetask was shown a status of $status");   &Apache::lonxml::error("Student viewing a graded bridgetask was shown a status of $status");
     }      }
     $result.='</td></tr><tr><td>';      my $status_display=$status;
       $status_display=~s/^([a-z])/uc($1)/e;
       $result.='<div class="'.$status.'"><h4>'.$mandatory.
    ' Criteria</h4><p>'.
    $dimension{$instance.'.criteria.'.$id}.
    '</p><p class="grade">'.$status_display.'</p>';
     if ($Apache::lonhomework::history{"resource.$version.$dim.$instance.$id.comment"}) {      if ($Apache::lonhomework::history{"resource.$version.$dim.$instance.$id.comment"}) {
  $result.=&mt('Comment from grader: ').$Apache::lonhomework::history{"resource.$version.$dim.$instance.$id.comment"}.'</td></tr><tr><td>';   $result.='<p class="comment">'.$Apache::lonhomework::history{"resource.$version.$dim.$instance.$id.comment"}.'</p>';
     }      }
     $result.=$dimension{$instance.'.criteria.'.$id}.      $result.='</div>';
  '</td></tr></table>';  
  }   }
     }      }
  } elsif ($target eq 'webgrade') {   } elsif ($target eq 'webgrade') {

Removed from v.1.52  
changed lines
  Added in v.1.53


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