Diff for /loncom/homework/bridgetask.pm between versions 1.15 and 1.21

version 1.15, 2005/05/03 05:31:51 version 1.21, 2005/05/10 16:44:35
Line 48  sub initialize_bridgetask { Line 48  sub initialize_bridgetask {
     $Apache::bridgetask::dimension='';      $Apache::bridgetask::dimension='';
     # list of all Dimension ids seen      # list of all Dimension ids seen
     @Apache::bridgetask::dimensionlist=();      @Apache::bridgetask::dimensionlist=();
       # mandatory attribute of all Dimensions seen
       %Apache::bridgetask::dimensionmandatory=();
     # list of all current Instance ids      # list of all current Instance ids
     @Apache::bridgetask::instance=();      @Apache::bridgetask::instance=();
     # list of all Instance ids seen in this problem      # list of all Instance ids seen in this problem
Line 95  sub add_grading_button { Line 97  sub add_grading_button {
 sub start_Task {  sub start_Task {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;      my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
   
     &Apache::structuretags::initialize_storage();  
     &Apache::lonhomework::showhash(%Apache::lonhomework::history);  
     my ($status,$accessmsg,$slot);      my ($status,$accessmsg,$slot);
       if ($target ne 'webgrade') {
    &Apache::structuretags::initialize_storage();
    &Apache::lonhomework::showhash(%Apache::lonhomework::history);
       } 
   
     $Apache::lonhomework::parsing_a_task=1;      $Apache::lonhomework::parsing_a_task=1;
     #should get back a <html> or the neccesary stuff to start XML/MathML      #should get back a <html> or the neccesary stuff to start XML/MathML
     my ($result,$head_tag_start,$body_tag_start,$form_tag_start)=      my ($result,$head_tag_start,$body_tag_start,$form_tag_start)=
  &Apache::structuretags::page_start($target,$token,$tagstack,$parstack,$parser,$safeeval);   &Apache::structuretags::page_start($target,$token,$tagstack,$parstack,$parser,$safeeval);
       
     if ($target eq 'web') {      if ($target eq 'web') {
  $body_tag_start.=&add_previous_version_button();   $body_tag_start.=&add_previous_version_button();
  if ($Apache::lonhomework::modifygrades) {   if ($Apache::lonhomework::modifygrades) {
Line 112  sub start_Task { Line 117  sub start_Task {
     $body_tag_start.=$uri.'">'.&add_grading_button()."</form>";      $body_tag_start.=$uri.'">'.&add_grading_button()."</form>";
  }   }
     }      }
     if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' ||      if ($target eq 'web' || ($target eq 'grade' && !$env{'form.webgrade'}) || $target eq 'answer' ||
  $target eq 'tex') {   $target eq 'tex') {
  ($status,$accessmsg,my $slot_name,$slot) =    ($status,$accessmsg,my $slot_name,$slot) = 
     &Apache::lonhomework::check_task_access('0');      &Apache::lonhomework::check_task_access('0');
Line 175  sub start_Task { Line 180  sub start_Task {
  }   }
     }      }
  }   }
     } elsif ($target eq 'webgrade') {      } elsif ( ($target eq 'grade' && $env{'form.webgrade'}) ||
  $result.=$head_tag_start.$body_tag_start.$form_tag_start;        $target eq 'webgrade') {
  $result.=&show_queue();   if ($target eq 'webgrade') {
       $result.=$head_tag_start.$body_tag_start.$form_tag_start;
       $result.='<input type="hidden" name="webgrade" value="yes" />';
       $result.=&show_queue();
    }
  my $todo=&get_from_queue();   my $todo=&get_from_queue();
  if ($todo) {   if ($todo) {
       &setup_env_for_other_user($todo,$safeeval);
     my ($symb,$uname,$udom)=&decode_queue_key($todo);      my ($symb,$uname,$udom)=&decode_queue_key($todo);
     $result.="\n".'<table><tr><td>Found'.      $result.="\n".'<table><tr><td>Found '.
  $symb.':'.$uname.':'.$udom.'</td></tr></table>';   &Apache::lonnet::gettitle($symb).' for '.$uname.' at '.$udom.'</td></tr></table>';
     $result.='<input type="hidden" name="gradingkey" value="'.      $result.='<input type="hidden" name="gradingkey" value="'.
  &HTML::Entites::encode($todo).'" />';   &Apache::lonnet::escape($todo).'" />';
     $Apache::bridgetask::queue_key=$todo;      $Apache::bridgetask::queue_key=$todo;
       &Apache::structuretags::initialize_storage();
       &Apache::lonhomework::showhash(%Apache::lonhomework::history);
       $result.="\n".'<table width="100%" style="width:100%" border="1">';
  } else {   } else {
     $result.="\n".      if ($target eq 'webgrade') {
  '<table><tr><td>No user to be graded.</td></tr></table>';   $result.="\n".
       '<table><tr><td>No user to be graded.</td></tr></table>';
       }
     my $bodytext=&Apache::lonxml::get_all_text("/task",$parser);      my $bodytext=&Apache::lonxml::get_all_text("/task",$parser);
  }   }
   
     } else {      } else {
  # page_start returned a starting result, delete it if we don't need it   # page_start returned a starting result, delete it if we don't need it
  $result = '';   $result = '';
Line 222  sub end_Task { Line 236  sub end_Task {
  $result.=&Apache::lonxml::xmlend().'</html>';   $result.=&Apache::lonxml::xmlend().'</html>';
     }      }
  }   }
  if ($target eq 'grade') {   if ($target eq 'grade' && !$env{'form.webgrade'}) {
     my $award='SUBMITTED';      my $award='SUBMITTED';
     &Apache::essayresponse::file_submission('0','bridgetask','portfiles',\$award);      &Apache::essayresponse::file_submission('0','bridgetask',
       'portfiles',\$award);
     if ($award eq 'SUBMITTED' &&      if ($award eq 'SUBMITTED' &&
  $Apache::lonhomework::results{"resource.0.bridgetask.portfiles"}) {   $Apache::lonhomework::results{"resource.0.bridgetask.portfiles"}) {
  $Apache::lonhomework::results{"resource.0.tries"}=   $Apache::lonhomework::results{"resource.0.tries"}=
Line 237  sub end_Task { Line 252  sub end_Task {
  &add_to_queue();   &add_to_queue();
     }      }
  }   }
    if ($target eq 'grade' && $env{'form.webgrade'}) {
       my $optional_required=
    &Apache::lonxml::get_param('OptionalRequired',$parstack,
      $safeeval);
       my $optional_passed=0;
       my $mandatory_failed=0;
       my $ungraded=0;
       my $review=0;   
       &Apache::lonhomework::showhash(%Apache::lonhomework::results);
       foreach my $dim_id (@Apache::bridgetask::dimensionlist) {
    my $status=
       $Apache::lonhomework::results{"resource.$dim_id.status"};
    my $mandatory=
       ($Apache::bridgetask::dimensionmandatory{$dim_id} ne 'N');
    if ($status eq 'pass') {
       if (!$mandatory) { $optional_passed++; }
    } elsif ($status eq 'fail') {
       if ($mandatory) { $mandatory_failed++; }
    } elsif ($status eq 'ungraded') {
       $ungraded++;
    } elsif ($status eq 'review') {
       $review++;
    }
       }
       if ($optional_passed < $optional_required) {
    $mandatory_failed++;
       }
       &Apache::lonxml::debug("all dim ".join(':',@Apache::bridgetask::dimensionlist)."results -> m_f $mandatory_failed o_p $optional_passed u $ungraded r $review");
       $Apache::lonhomework::results{'resource.grader'}=
    $env{'user.name'}.'@'.$env{'user.domain'};
       if ($review) {
    $Apache::lonhomework::results{'resource.status'}='review';
    &move_to_review_queue();
       } elsif ($ungraded) {
    $Apache::lonhomework::results{'resource.status'}='ungraded';
    &check_queue_unlock();
       } elsif ($mandatory_failed) {
    $Apache::lonhomework::results{'resource.status'}='fail';
    $Apache::lonhomework::results{"resource.0.award"}='EXACT_ANS';
    &remove_from_queue();
       } else {
    $Apache::lonhomework::results{'resource.status'}='pass';
    $Apache::lonhomework::results{"resource.0.award"}='INCORRECT';
    &remove_from_queue();
       }
       &Apache::structuretags::finalize_storage();
    }
     } elsif ($target eq 'webgrade') {      } elsif ($target eq 'webgrade') {
  $result.="\n<hr />";   $result.="</table>\n<hr />";
  $result.='<input type="submit" name="next" value="'.   #$result.='<input type="submit" name="next" value="'.
     &mt('Save & Next').'" /> ';   #    &mt('Save &amp; Next').'" /> ';
  $result.='<input type="submit" name="end" value="'.   #$result.='<input type="submit" name="end" value="'.
     &mt('Save & Stop Grading').'" /> ';   #    &mt('Save &amp; Stop Grading').'" /> ';
  $result.='<input type="submit" name="end" value="'.   #$result.='<input type="submit" name="throwaway" value="'.
     &mt('Throw Away & Stop Grading').'" /> ';   #    &mt('Throw Away &amp; Stop Grading').'" /> ';
    #$result.='<input type="submit" name="save" value="'.
    #    &mt('Save Partial Grade and Continue Grading').'" /> ';
  $result.='</form>'.&Apache::loncommon::endbodytag().'</html>';   $result.='</form>'.&Apache::loncommon::endbodytag().'</html>';
     } elsif ($target eq 'meta') {      } elsif ($target eq 'meta') {
  $result.='<parameter part="0" package="Task"></parameter>'."\n";   $result.='<parameter part="0" package="Task"></parameter>'."\n";
Line 255  sub end_Task { Line 319  sub end_Task {
     return $result;      return $result;
 }  }
   
   sub move_to_review_queue {
       &Apache::lonxml::debug("Want to move");
   }
   
   sub check_queue_unlock {
       &Apache::lonxml::debug("Want to unlock?");
   }
   
   sub remove_from_queue {
       &Apache::lonxml::debug("Want to remove. Done?");
   }
   
   sub setup_env_for_other_user {
       my ($queue_key,$safeeval)=@_;
       my ($symb,$uname,$udom)=&decode_queue_key($queue_key);
       $env{'form.grade_symb'}=$symb;
       $env{'form.grade_domain'}=$udom;
       $env{'form.grade_username'}=$uname;
       $env{'form.grade_courseid'}=$env{'request.course.id'};
       &Apache::lonxml::initialize_rndseed($safeeval);
   }
   
 sub add_to_queue {  sub add_to_queue {
     my ($symb,$cid,$udom,$uname)=&Apache::lonxml::whichuser();      my ($symb,$cid,$udom,$uname)=&Apache::lonxml::whichuser();
     my $cnum=$env{'course.'.$cid.'.num'};      my $cnum=$env{'course.'.$cid.'.num'};
     my $cdom=$env{'course.'.$cid.'.domain'};      my $cdom=$env{'course.'.$cid.'.domain'};
     my %data;      my %data;
     #$data{"$symb\0timestamp"}=time;  
     $data{"$symb\0queue\0$uname\@$udom"}=[$Apache::inputtags::slot_name];      $data{"$symb\0queue\0$uname\@$udom"}=[$Apache::inputtags::slot_name];
     &Apache::lonnet::put('gradingqueue',\%data,$cdom,$cnum);      &Apache::lonnet::put('gradingqueue',\%data,$cdom,$cnum);
 }  }
Line 270  sub show_queue { Line 355  sub show_queue {
     my ($symb,$cid,$udom,$uname)=&Apache::lonxml::whichuser();      my ($symb,$cid,$udom,$uname)=&Apache::lonxml::whichuser();
     my $cnum=$env{'course.'.$cid.'.num'};      my $cnum=$env{'course.'.$cid.'.num'};
     my $cdom=$env{'course.'.$cid.'.domain'};      my $cdom=$env{'course.'.$cid.'.domain'};
     my $regexp="^$symb\0queue";      my $regexp="^$symb\0";
     my %queue=&Apache::lonnet::dump('gradingqueue',$cdom,$cnum,$regexp);      my %queue=&Apache::lonnet::dump('gradingqueue',$cdom,$cnum,$regexp);
     $result.="\n<h3>Current Queue</h3><table><tr><th>resource</th><th>user</th><th>Time available for grading</th></tr>";      $result.="\n<h3>Current Queue</h3><table><tr><th>resource</th>".
    "<th>user</th><th>type</th><th>data</th></tr>";
     foreach my $key (sort(keys(%queue))) {      foreach my $key (sort(keys(%queue))) {
  my ($symb,undef,$user) = split("\0",$key);   if ($key=~/locked$/) {
  my ($uname,$udom) = split('@',$user);      my ($symb,$uname,$udom) = &decode_queue_key($key);
  my $title=&Apache::lonnet::gettitle($symb);      my $title=&Apache::lonnet::gettitle($symb);
  $result.="<tr><td>$title</td><td>$uname</td><td>";      $result.="<tr><td>$title</td><td>$uname</td><td>";
  my $slot=$queue{$key}->[0];      $result.='<td>lock</td><td>'.$queue{$key}.'</td></tr>';
  my %slot_data=&Apache::lonnet::get_slot($slot);   } elsif ($key=~/timestamp$/) {
  $result.="End time: ".&Apache::lonlocal::locallocaltime($slot_data{'endtime'})."</td></tr>";      my ($symb,undef) = split("\0",$key);
       my $title=&Apache::lonnet::gettitle($symb);
       $result.="<tr><td>$title</td><td></td><td>";
       $result.='<td>last queue modification time</td><td>'.
    &Apache::lonlocal::locallocaltime($queue{$key})."</td></tr>";
    } else {
       my ($symb,$uname,$udom) = &decode_queue_key($key);
       my $title=&Apache::lonnet::gettitle($symb);
       $result.="<tr><td>$title</td><td>$uname</td><td>";
       my $slot=$queue{$key}->[0];
       my %slot_data=&Apache::lonnet::get_slot($slot);
       $result.='<td>queue entry</td><td>End time: '.
    &Apache::lonlocal::locallocaltime($slot_data{'endtime'}).
    "</td></tr>";
    }
     }      }
     $result.="</table><hr />\n";      $result.="</table><hr />\n";
     return $result;      return $result;
Line 305  sub queue_key_locked { Line 405  sub queue_key_locked {
   
 sub pick_from_queue_data {  sub pick_from_queue_data {
     my ($check_section,$queue,$cdom,$cnum)=@_;      my ($check_section,$queue,$cdom,$cnum)=@_;
     foreach my $key (sort(keys(%$queue))) {      foreach my $key (keys(%$queue)) {
  my ($symb,$uname,$udom)=&decode_queue_key($key);   my ($symb,$uname,$udom)=&decode_queue_key($key);
  if ($check_section) {   if ($check_section) {
     my $section=&Apache::lonnet::getsection($uname,$udom);      my $section=&Apache::lonnet::getsection($uname,$udom);
     if ($section ne $check_section) {      if ($section eq $check_section) {
  &Apache::lonnet::logthis("not my sec");   &Apache::lonnet::logthis("my sec");
  next;   next;
     }      }
  }   }
Line 331  sub pick_from_queue_data { Line 431  sub pick_from_queue_data {
   
 sub find_mid_grade {  sub find_mid_grade {
     my ($symb,$cdom,$cnum)=@_;      my ($symb,$cdom,$cnum)=@_;
     my $todo=$env{'form.gradingkey'};      my $todo=&Apache::lonnet::unescape($env{'form.gradingkey'});
     my $me=$env{'user.name'}.'@'.$env{'user.domain'};      my $me=$env{'user.name'}.'@'.$env{'user.domain'};
     if ($todo) {      if ($todo) {
  my $who=&queue_key_locked($todo,$cdom,$cnum);   my $who=&queue_key_locked($todo,$cdom,$cnum);
Line 359  sub get_from_queue { Line 459  sub get_from_queue {
     # FIXME need to find if I am 'mid grading'      # FIXME need to find if I am 'mid grading'
     $todo=&find_mid_grade($symb,$cdom,$cnum);      $todo=&find_mid_grade($symb,$cdom,$cnum);
     &Apache::lonnet::logthis("found ".join(':',&decode_queue_key($todo)));      &Apache::lonnet::logthis("found ".join(':',&decode_queue_key($todo)));
       if ($todo) { return $todo; }
     while (1) {      while (1) {
  my $starttime=time;   my $starttime=time;
  &Apache::lonnet::put('gradingqueue',{"$symb\0timestamp"=>$starttime},   &Apache::lonnet::put('gradingqueue',{"$symb\0timestamp"=>$starttime},
Line 438  sub end_ClosingParagraph { Line 539  sub end_ClosingParagraph {
     return $result;      return $result;
 }  }
   
   sub get_id {
       my ($parstack,$safeeval)=@_;
       my $id=&Apache::lonxml::get_param('id',$parstack,$safeeval);
       if (!$id) { $id=$Apache::lonxml::curdepth; }
       return $id;
   }
   
 my %dimension;  my %dimension;
 sub start_Dimension {  sub start_Dimension {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;      my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
     undef(%dimension);      undef(%dimension);
     my $dim_id=$Apache::lonxml::curdepth;      my $dim_id=&get_id($parstack,$safeeval);
     $Apache::bridgetask::dimension=$dim_id;      $Apache::bridgetask::dimension=$dim_id;
     push(@Apache::bridgetask::dimensionlist,$dim_id);      push(@Apache::bridgetask::dimensionlist,$dim_id);
     undef(@Apache::bridgetask::instance);      undef(@Apache::bridgetask::instance);
       $Apache::bridgetask::dimensionmandatory{$dim_id}=
    &Apache::lonxml::get_param('Mandatory',$parstack,$safeeval);
     return '';      return '';
 }  }
   
Line 458  sub get_instance { Line 568  sub get_instance {
     return $order[0];      return $order[0];
 }  }
   
 sub end_Dimension {  {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;      my $last_link;
     my $result;      sub end_Dimension {
     if ($target eq 'web') {   my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
  my $instance=&get_instance();   my $result;
  $result=$dimension{'intro'}.$dimension{$instance.'.text'};   my $dim_id=&get_id($parstack,$safeeval);
     } elsif ($target eq 'webgrade') {  
  my $instance=&get_instance();   my $instance=&get_instance();
  $result.="\n".'<table>';   if ($target eq 'web') {
  foreach my $id (@{$dimension{$instance.'.criterias'}}) {      $result=$dimension{'intro'}.$dimension{$instance.'.text'};
     $result.='<tr><td>'.   } elsif ($target eq 'webgrade') {
  $dimension{$instance.'.criteria.'.$id}.'</td></tr>';      foreach my $id (@{$dimension{$instance.'.criterias'}}) {
    my $link='criteria_'.$instance.'_'.$id;
    my $status=$Apache::lonhomework::history{'resource.'.$instance.'.'.$id.'.status'};
    $result.='<tr><td width="100%" valign="top">'.
       '<a name="'.$link.'" />'.
       '<a name="next_'.$last_link.'" />'.
       '<br /><textarea enabled="false" style="width:100%" rows="8" width="25" wrap="hard">'.$dimension{$instance.'.criteria.'.$id}.'</textarea>'.
       #$dimension{$instance.'.criteria.'.$id}.
       '</td>'.
       '<td><nobr>Additional Comment for Student</nobr> <br />'.
       '<textarea style="width:100%" rows="8" width="25" wrap="hard" name="HWVAL_comment_'.$link.'">'.&HTML::Entities::encode($Apache::lonhomework::history{'resource.'.$instance.'.'.$id.'.comment'}).'</textarea>'.
       '</td>'.
       '<td>'.
       '<nobr><label><input type="radio" name="HWVAL_'.$link.'" value="ungraded" '.($status eq 'ungraded' || !$status ? 'checked="checked"':'').'/>Ungraded</label></nobr><br />'.
       '<label><input type="radio" name="HWVAL_'.$link.'" value="pass" '.($status eq 'pass' ? 'checked="checked"':'').' />Pass</label><br />'.
       '<label><input type="radio" name="HWVAL_'.$link.'" value="fail" '.($status eq 'fail' ? 'checked="checked"':'').' />Fail</label><br />'.
       '<label><input type="radio" name="HWVAL_'.$link.'" value="review" '.($status eq 'review' ? 'checked="checked"':'').' />Review</label><br />'.
       '</td>'.
       '<td>'.
       '<a href="#'.$last_link.'">Prev</a><br />'.
       '<a href="#next_'.$link.'">Next</a><br /><br /><br />'.
       '<input type="submit" name="next" value="'.
       &mt('Done').'" /> '.
       '</td></tr>';
    $last_link=$link;
       }
    } elsif ($target eq 'grade') {
       my $optional_passed=0;
       my $mandatory_failed=0;
       my $ungraded=0;
       my $review=0;
       foreach my $id (@{$dimension{$instance.'.criterias'}}) {
    my $status=$Apache::lonhomework::results{'resource.'.$instance.'.'.$id.'.status'}=$env{'form.HWVAL_criteria_'.$instance.'_'.$id};
    $Apache::lonhomework::results{'resource.'.$instance.'.'.$id.'.comment'}=$env{'form.HWVAL_comment_criteria_'.$instance.'_'.$id};
    my $mandatory=($dimension{$instance.'.criteria.'.$id.'.mandatory'} ne 'N');
    if ($status eq 'pass') {
       if (!$mandatory) { $optional_passed++; }
    } elsif ($status eq 'fail') {
       if ($mandatory) { $mandatory_failed++; }
    } elsif ($status eq 'review') {
       $review++;
    } elsif ($status eq 'ungraded') {
       $ungraded++;
    } else {
       &Apache::lonxml::error("got wierd status --$status--");
    }
       }
       if ($optional_passed < $dimension{$instance.'.optionalrequired'}) {
    $mandatory_failed++;
       }
       &Apache::lonxml::debug("all instance ".join(':',@{$dimension{$instance.'.criterias'}})." results -> m_f $mandatory_failed o_p $optional_passed u $ungraded r $review");
       if ($review) {
    $Apache::lonhomework::results{'resource.'.$dim_id.'.status'}='review';
       } elsif ($ungraded) {
    $Apache::lonhomework::results{'resource.'.$dim_id.'.status'}='ungraded';
       } elsif ($mandatory_failed) {
    $Apache::lonhomework::results{'resource.'.$dim_id.'.status'}='fail';
       } else {
    $Apache::lonhomework::results{'resource.'.$dim_id.'.status'}='pass';
       }
  }   }
  $result.='</table>';   return $result;
     }      }
     return $result;  
 }  }
   
 sub start_IntroParagraph {  sub start_IntroParagraph {
Line 500  sub end_IntroParagraph { Line 667  sub end_IntroParagraph {
   
 sub start_Instance {  sub start_Instance {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;      my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
     push(@{$dimension{'instances'}},$Apache::lonxml::curdepth);      my $id=&get_id($parstack,$safeeval);
     push(@Apache::bridgetask::instance,$Apache::lonxml::curdepth);      push(@{$dimension{'instances'}},$id);
     push(@Apache::bridgetask::instancelist,$Apache::lonxml::curdepth);      push(@Apache::bridgetask::instance,$id);
       push(@Apache::bridgetask::instancelist,$id);
       $dimension{$id.'.optionalrequired'}=
    &Apache::lonxml::get_param('OptionalRequired',$parstack,$safeeval);
     return '';      return '';
 }  }
   
Line 530  sub end_InstanceText { Line 700  sub end_InstanceText {
   
 sub start_Criteria {  sub start_Criteria {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;      my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
     if ($target eq 'web' || $target eq 'webgrade') {      if ($target eq 'web' || $target eq 'webgrade' || $target eq 'grade') {
  &Apache::lonxml::startredirection();   &Apache::lonxml::startredirection();
     }      }
     return '';      return '';
Line 539  sub start_Criteria { Line 709  sub start_Criteria {
 sub end_Criteria {  sub end_Criteria {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;      my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
     my $instance_id=$Apache::bridgetask::instance[-1];      my $instance_id=$Apache::bridgetask::instance[-1];
     if ($target eq 'web' || $target eq 'webgrade') {      if ($target eq 'web' || $target eq 'webgrade' || $target eq 'grade') {
  my $criteria=&Apache::lonxml::endredirection();   my $criteria=&Apache::lonxml::endredirection();
  my $id=$Apache::lonxml::curdepth;   my $id=&get_id($parstack,$safeeval);
  $dimension{$instance_id.'.criteria.'.$id}=$criteria;   $dimension{$instance_id.'.criteria.'.$id}=$criteria;
    $dimension{$instance_id.'.criteria.'.$id.'.mandatory'}=
       &Apache::lonxml::get_param('Mandatory',$parstack,$safeeval);
  push(@{$dimension{$instance_id.'.criterias'}},$id);   push(@{$dimension{$instance_id.'.criterias'}},$id);
     }      }
     return '';      return '';

Removed from v.1.15  
changed lines
  Added in v.1.21


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