Diff for /loncom/homework/bridgetask.pm between versions 1.174 and 1.180

version 1.174, 2006/06/20 03:33:55 version 1.180, 2006/06/28 21:46:53
Line 50  my %dimension; Line 50  my %dimension;
 sub initialize_bridgetask {  sub initialize_bridgetask {
     # id of current Dimension, 0 means that no dimension is current       # id of current Dimension, 0 means that no dimension is current 
     # (inside <Task> only)      # (inside <Task> only)
     %Apache::bridgetask::dimension=();      @Apache::bridgetask::dimension=();
     # list of all Dimension ids seen      # list of all Dimension ids seen
     %Apache::bridgetask::top_dimensionlist=();      %Apache::bridgetask::top_dimensionlist=();
     # list of all current Instance ids      # list of all current Instance ids
Line 83  sub proctor_check_auth { Line 83  sub proctor_check_auth {
  }   }
     }      }
     if ($authenticated) {      if ($authenticated) {
  my $useslots = &Apache::lonnet::EXT("resource.0.useslots");   &check_in($type,$user,$domain,$slot_name);
  if ( $useslots eq 'map_map') {  
     &checkin_resource($user,$domain,$slot_name);  
  } else {  
     &create_new_version($type,$user,$domain,$slot_name);  
  }  
  return 1;   return 1;
     }      }
  }   }
Line 112  sub check_in_sequence { Line 107  sub check_in_sequence {
     my $navmap = Apache::lonnavmaps::navmap->new();      my $navmap = Apache::lonnavmaps::navmap->new();
     my ($symb) = &Apache::lonxml::whichuser();      my ($symb) = &Apache::lonxml::whichuser();
     my ($map)  = &Apache::lonnet::decode_symb($symb);      my ($map)  = &Apache::lonnet::decode_symb($symb);
     my @resources = $navmap->retrieveResources($map,undef,1,0);      my @resources = 
    $navmap->retrieveResources($map, sub { $_[0]->is_problem() },0,0);
     my %old_history = %Apache::lonhomework::history;      my %old_history = %Apache::lonhomework::history;
     my %old_results = %Apache::lonhomework::results;      my %old_results = %Apache::lonhomework::results;
   
Line 148  sub create_new_version { Line 144  sub create_new_version {
  #setup new version and who did it   #setup new version and who did it
         $Apache::lonhomework::results{'resource.0.version'}=$version;          $Apache::lonhomework::results{'resource.0.version'}=$version;
  $id = "$version.0";   $id = "$version.0";
  if (!defined($user) || defined($domain)) {   if (!defined($user) || !defined($domain)) {
     $user = $env{'user.name'};      $user = $env{'user.name'};
     $domain = $env{'user.domain'};      $domain = $env{'user.domain'};
  }   }
Line 376  sub nested_parse { Line 372  sub nested_parse {
     @Apache::scripttag::parser_env = @old_env;      @Apache::scripttag::parser_env = @old_env;
     if ($args->{'delayed_dim_results'}) {      if ($args->{'delayed_dim_results'}) {
  my $dim = &get_dim_id();   my $dim = &get_dim_id();
    &Apache::lonxml::debug(" tossing out $result ");
    &Apache::lonxml::debug(" usining out $dim 's  ". $dimension{$dim}{'result'});
  return $dimension{$dim}{'result'};   return $dimension{$dim}{'result'};
     }      }
     return $result;      return $result;
Line 534  sub start_Task { Line 532  sub start_Task {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;      my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
   
     my ($status,$accessmsg,$slot);      my ($status,$accessmsg,$slot);
       &Apache::structuretags::init_problem_globals('Task');
     if ($target ne 'webgrade') {      if ($target ne 'webgrade') {
  &Apache::structuretags::init_problem_globals('Task');  
  &Apache::structuretags::initialize_storage();   &Apache::structuretags::initialize_storage();
  &Apache::lonhomework::showhash(%Apache::lonhomework::history);   &Apache::lonhomework::showhash(%Apache::lonhomework::history);
  if ($env{'request.state'} eq 'construct') {   if ($env{'request.state'} eq 'construct') {
Line 598  sub start_Task { Line 596  sub start_Task {
  ($status,$accessmsg,my $slot_name,$slot) =    ($status,$accessmsg,my $slot_name,$slot) = 
     &Apache::lonhomework::check_slot_access('0','Task');      &Apache::lonhomework::check_slot_access('0','Task');
  if ($status eq 'CAN_ANSWER' && $version eq '') {   if ($status eq 'CAN_ANSWER' && $version eq '') {
     # CAN_ANSWR mode, and no current version, unproctored access      # CAN_ANSWER mode, and no current version, unproctored access
     # thus self-checkedin      # thus self-checkedin
     &check_in('Task',undef,undef,$slot_name);      &check_in('Task',undef,undef,$slot_name);
     &add_to_queue('gradingqueue',{'type' => 'Task',      &add_to_queue('gradingqueue',{'type' => 'Task',
Line 1225  DONEBUTTON Line 1223  DONEBUTTON
  $result.=&Apache::response::meta_stores_write('status','string',   $result.=&Apache::response::meta_stores_write('status','string',
       'Bridge Task Status');        'Bridge Task Status');
     }      }
       &Apache::structuretags::reset_problem_globals('Task');
     undef($Apache::lonhomework::parsing_a_task);      undef($Apache::lonhomework::parsing_a_task);
     return $result;      return $result;
 }  }
Line 2224  sub get_criteria { Line 2223  sub get_criteria {
     &nested_parse(\$dimension{$dim}{$instance.'.text'},[@_]);      &nested_parse(\$dimension{$dim}{$instance.'.text'},[@_]);
     $result.=      $result.=
  &nested_parse(\$dimension{$dim}{'questiontext'},[@_],   &nested_parse(\$dimension{$dim}{'questiontext'},[@_],
       {'set_dim_id'        => undef,        {'set_dim_id'          => undef,
        'delay_dim_results' => 1});         'delayed_dim_results' => 1});
     foreach my $id (@{$dimension{$dim}{$instance.'.criterias'}},      foreach my $id (@{$dimension{$dim}{$instance.'.criterias'}},
     @{$dimension{$dim}{'criterias'}} ) {      @{$dimension{$dim}{'criterias'}} ) {
  my $type = $dimension{$dim}{'criteria.'.$id.'.type'};   my $type = $dimension{$dim}{'criteria.'.$id.'.type'};
Line 2262  sub get_criteria { Line 2261  sub get_criteria {
  $result.=&grading_history($version,$dim,$id);   $result.=&grading_history($version,$dim,$id);
  $last_link=$link;   $last_link=$link;
     }      }
     if (&delay_result()) {      if (&nest()) {
  &Apache::lonxml::debug(" for $dim stashing results into ".$dimension{$dim}{'nested'});   &Apache::lonxml::debug(" for $dim stashing results into ".$dimension{$dim}{'nested'});
  $dimension{$dimension{$dim}{'nested'}}{'result'}.=$result;   $dimension{$dimension{$dim}{'nested'}}{'result'}.=$result;
  undef($result);   undef($result);

Removed from v.1.174  
changed lines
  Added in v.1.180


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