Diff for /loncom/homework/bridgetask.pm between versions 1.126 and 1.128.2.10

version 1.126, 2006/03/28 22:03:47 version 1.128.2.10, 2006/06/05 17:15:37
Line 349  sub webgrade_standard_info { Line 349  sub webgrade_standard_info {
   
     my %lt=&Apache::lonlocal::texthash('done' => 'Next Item',      my %lt=&Apache::lonlocal::texthash('done' => 'Next Item',
        'stop' => 'Quit Grading',         'stop' => 'Quit Grading',
          'fail' => 'Fail Rest',
        );         );
                 
     my $result=<<INFO;      my $result=<<INFO;
   <div class="LC_GRADING_maincontrols">    <div class="LC_GRADING_maincontrols">
     <input type="submit" name="next" value="$lt{'done'}" />      <input type="submit" name="next" value="$lt{'done'}" />
     <input type="submit" name="stop" value="$lt{'stop'}" />      <input type="submit" name="stop" value="$lt{'stop'}" />
       <input type="button" name="fail" value="$lt{'fail'}" 
              onclick="javascript:onFailRest()" />
   </div>    </div>
   $file_list    $file_list
 INFO  INFO
Line 455  sub start_Task { Line 458  sub start_Task {
     my $files = '<ul>';      my $files = '<ul>';
     foreach my $file (@files) {      foreach my $file (@files) {
  my $url="/uploaded/$domain/$user/portfolio$file";   my $url="/uploaded/$domain/$user/portfolio$file";
  if (! &Apache::lonnet::stat_file($url)) {   $file = '<tt>'.$file.'</tt>';
     $file = &mt('<font color="red"> Nonexistant file:</font> <tt>[_1]</tt>',$file);  
  } else {  
     $file = '<tt>'.$file.'</tt>';  
  }  
  $files .= '<li>'.$file.'</li>';   $files .= '<li>'.$file.'</li>';
     }      }
     $files.='</ul>';      $files.='</ul>';
Line 974  DONEBUTTON Line 973  DONEBUTTON
     &Apache::structuretags::finalize_storage();      &Apache::structuretags::finalize_storage();
  }   }
     } elsif ($target eq 'webgrade') {      } elsif ($target eq 'webgrade') {
  $result.="</div>\n<hr />";   $result.="</div>";
  #$result.='<input type="submit" name="next" value="'.   #$result.='<input type="submit" name="next" value="'.
  #    &mt('Save &amp; Next').'" /> ';   #    &mt('Save &amp; Next').'" /> ';
  #$result.='<input type="submit" name="end" value="'.   #$result.='<input type="submit" name="end" value="'.
Line 1319  sub pick_from_queue_data { Line 1318  sub pick_from_queue_data {
     if (@possible) {      if (@possible) {
         # sort entries in order by slot end time          # sort entries in order by slot end time
  @possible = sort { $a->[1] <=> $b->[1] } @possible;   @possible = sort { $a->[1] <=> $b->[1] } @possible;
  # pick one of the first ten entries   # pick one of the entries in the top 10% in small queues and one
  my $max=($#possible < 10) ? $#possible : 10;   # of the first ten entries in large queues
  return $possible[int(rand($max))][0];   #my $ten_percent = int($#possible * 0.1);
    #if ($ten_percent < 1 ) { $ten_percent = 1;  }
    #if ($ten_percent > 10) { $ten_percent = 10; }
    #my $max=($#possible < $ten_percent) ? $#possible : $ten_percent;
   
    #return $possible[int(rand($max))][0];
    return $possible[0][0];
     }      }
     return undef;      return undef;
 }  }
Line 1764  sub get_instance { Line 1769  sub get_instance {
  my $link=&link($instance,$id);   my $link=&link($instance,$id);
  my $status=$Apache::lonhomework::history{"resource.$version.0.$dim.$instance.$id.status"};   my $status=$Apache::lonhomework::history{"resource.$version.0.$dim.$instance.$id.status"};
  $result.='<div class="LC_GRADING_criteria" id="'.$link.'">'."\n".   $result.='<div class="LC_GRADING_criteria" id="'.$link.'">'."\n".
     '<a name="'.$link.'" />'."\n".      '<div class="LC_GRADING_criteriatext" id="next_'.$last_link.'">'."\n";
     '<a name="next_'.$last_link.'" />'."\n".  
     '<div class="LC_GRADING_criteriatext">'."\n";  
  @Apache::scripttag::parser_env = @_;   @Apache::scripttag::parser_env = @_;
  $result.=&Apache::scripttag::xmlparse($dimension{$instance.'.criteria.'.$id});   $result.=&Apache::scripttag::xmlparse($dimension{$instance.'.criteria.'.$id});
  $result.='</div>'."\n".   $result.='</div>'."\n".
Line 1793  sub get_instance { Line 1796  sub get_instance {
     my $mandatory_failed=0;      my $mandatory_failed=0;
     my $ungraded=0;      my $ungraded=0;
     my $review=0;      my $review=0;
   
       @Apache::scripttag::parser_env = @_;
       $result.=&Apache::scripttag::xmlparse($dimension{'intro'});
     foreach my $id (@{$dimension{$instance.'.criterias'}}) {      foreach my $id (@{$dimension{$instance.'.criterias'}}) {
    @Apache::scripttag::parser_env = @_;
    $result.=&Apache::scripttag::xmlparse($dimension{$instance.'.tex
   t'});
  my $link=&link($instance,$id);   my $link=&link($instance,$id);
  my $status=$Apache::lonhomework::results{"resource.$version.0.$dim.$instance.$id.status"}=$env{'form.HWVAL_'.$link};   my $status=$Apache::lonhomework::results{"resource.$version.0.$dim.$instance.$id.status"}=$env{'form.HWVAL_'.$link};
  $Apache::lonhomework::results{"resource.$version.0.$dim.$instance.$id.comment"}=$env{'form.HWVAL_comment_'.$link};   $Apache::lonhomework::results{"resource.$version.0.$dim.$instance.$id.comment"}=$env{'form.HWVAL_comment_'.$link};
Line 1870  sub grading_history { Line 1879  sub grading_history {
 sub start_IntroParagraph {  sub start_IntroParagraph {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;      my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
     my $result;      my $result;
     if ($target eq 'web' || $target eq 'webgrade') {      if ($target eq 'web' || $target eq 'web' || $target eq 'webgrade') {
  if ($tagstack->[-2] eq 'Dimension') {   if ($tagstack->[-2] eq 'Dimension') {
     $dimension{'intro'}=&Apache::lonxml::get_all_text('/introparagraph',$parser,$style);      $dimension{'intro'}=&Apache::lonxml::get_all_text('/introparagraph',$parser,$style);
   
  } elsif ($target eq 'webgrade') {   } elsif ($tagstack->[-2] eq 'Task' && $target eq 'webgrade') {
     &Apache::lonxml::get_all_text('/introparagraph',$parser,$style);      &Apache::lonxml::startredirection();
  }   }
   
     }      }
Line 1883  sub start_IntroParagraph { Line 1892  sub start_IntroParagraph {
 }  }
   
 sub end_IntroParagraph {  sub end_IntroParagraph {
       my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
       if ($tagstack->[-2] eq 'Task' && $target eq 'webgrade') {
    my $result = &Apache::lonxml::endredirection();
       }
 }  }
   
 sub start_Instance {  sub start_Instance {
Line 1907  sub start_InstanceText { Line 1920  sub start_InstanceText {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;      my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
     my $instance_id=$Apache::bridgetask::instance[-1];      my $instance_id=$Apache::bridgetask::instance[-1];
     my $text=&Apache::lonxml::get_all_text('/instancetext',$parser,$style);      my $text=&Apache::lonxml::get_all_text('/instancetext',$parser,$style);
     if ($target eq 'web' || $target eq 'webgrade') {      if ($target eq 'grade' || $target eq 'web' || $target eq 'webgrade') {
  $dimension{$instance_id.'.text'}=$text;   $dimension{$instance_id.'.text'}=$text;
     }      }
     return '';      return '';

Removed from v.1.126  
changed lines
  Added in v.1.128.2.10


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