Diff for /loncom/homework/bridgetask.pm between versions 1.265 and 1.271

version 1.265, 2015/10/05 02:35:40 version 1.271, 2020/09/01 16:36:38
Line 65  sub initialize_bridgetask { Line 65  sub initialize_bridgetask {
 sub proctor_check_auth {  sub proctor_check_auth {
     my ($slot_name,$slot,$type)=@_;      my ($slot_name,$slot,$type)=@_;
     my $user=$env{'form.proctorname'};      my $user=$env{'form.proctorname'};
       $user =~ s/^\s+|\s+$//g;
     my $domain=$env{'form.proctordomain'};      my $domain=$env{'form.proctordomain'};
           
     my @allowed=split(",",$slot->{'proctor'});      my @allowed=split(",",$slot->{'proctor'});
Line 97  sub proctor_check_auth { Line 98  sub proctor_check_auth {
 sub check_in {  sub check_in {
     my ($type,$user,$domain,$slot_name,$needsiptied) = @_;      my ($type,$user,$domain,$slot_name,$needsiptied) = @_;
     my $useslots = &Apache::lonnet::EXT("resource.0.useslots");      my $useslots = &Apache::lonnet::EXT("resource.0.useslots");
     my $ip=$env{'request.host'} || $ENV{'REMOTE_ADDR'};      my $ip=$ENV{'REMOTE_ADDR'} || $env{'request.host'};
     if ( $useslots eq 'map_map') {      if ( $useslots eq 'map_map') {
  my $result = &check_in_sequence($user,$domain,$slot_name,$ip,$needsiptied);   my $result = &check_in_sequence($user,$domain,$slot_name,$ip,$needsiptied);
         if ($result =~ /^error: /) {          if ($result =~ /^error: /) {
Line 123  sub check_in_sequence { Line 124  sub check_in_sequence {
     my ($symb) = &Apache::lonnet::whichuser();      my ($symb) = &Apache::lonnet::whichuser();
     my ($map)  = &Apache::lonnet::decode_symb($symb);      my ($map)  = &Apache::lonnet::decode_symb($symb);
     my @resources =       my @resources = 
  $navmap->retrieveResources($map, sub { $_[0]->is_problem() },0,0);   $navmap->retrieveResources($map, sub { $_[0]->is_problem() || $_[0]->is_tool() },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 131  sub check_in_sequence { Line 132  sub check_in_sequence {
     foreach my $res (@resources) {      foreach my $res (@resources) {
  &Apache::lonxml::debug("doing ".$res->src);   &Apache::lonxml::debug("doing ".$res->src);
  &Apache::structuretags::initialize_storage($res->symb);   &Apache::structuretags::initialize_storage($res->symb);
  my $type = ($res->is_task()) ? 'Task' : 'problem';   my $type;
           if ($res->is_task()) {
               $type = 'Task';
           } elsif ($res->is_tool) {
               $type = 'tool';
           } else {
               $type = 'problem';
           }
  my $result = &create_new_version($type,$user,$domain,$slot_name,$res->symb,$ip,$needsiptied);   my $result = &create_new_version($type,$user,$domain,$slot_name,$res->symb,$ip,$needsiptied);
         if ($result eq 'ok') {          if ($result eq 'ok') {
     &Apache::structuretags::finalize_storage($res->symb);      &Apache::structuretags::finalize_storage($res->symb);
Line 187  sub create_new_version { Line 195  sub create_new_version {
     $domain = $env{'user.domain'};      $domain = $env{'user.domain'};
  }   }
   
     } elsif ($type eq 'problem') {      } elsif (($type eq 'problem') || ($type eq 'tool')) {
  &Apache::lonxml::debug("authed $slot_name");   &Apache::lonxml::debug("authed $slot_name");
     }      }
     if (!defined($user) || !defined($domain)) {      if (!defined($user) || !defined($domain)) {
Line 711  sub start_Task { Line 719  sub start_Task {
         $target eq 'tex') {          $target eq 'tex') {
         if ($env{'form.markaccess'}) {          if ($env{'form.markaccess'}) {
             my @interval=&Apache::lonnet::EXT("resource.0.interval");              my @interval=&Apache::lonnet::EXT("resource.0.interval");
             &Apache::lonnet::set_first_access($interval[1],$interval[0]);              my ($timelimit) = ($interval[0] =~ /^(\d+)/);
               &Apache::lonnet::set_first_access($interval[1],$timelimit);
         }          }
     }      }
   
Line 1443  DONEBUTTON Line 1452  DONEBUTTON
             if ($canstore) {              if ($canstore) {
         &Apache::structuretags::finalize_storage();          &Apache::structuretags::finalize_storage();
                 my @interval = &Apache::lonnet::EXT("resource.0.interval");                  my @interval = &Apache::lonnet::EXT("resource.0.interval");
                 if ($interval[0] =~ /^\d+$/ && $interval[1] eq 'resource') {                  if ($interval[0] =~ /^\d+/ && $interval[1] eq 'resource') {
                     my $key=$courseid."\0".$symb;                      my $key=$courseid."\0".$symb;
                     my %times=&Apache::lonnet::get('firstaccesstimes',                      my %times=&Apache::lonnet::get('firstaccesstimes',
                                                    [$key],$domain,$name);                                                     [$key],$domain,$name);
Line 3321  sub proctor_validation_screen { Line 3330  sub proctor_validation_screen {
 <input type="hidden" name="validate" value="yes" />  <input type="hidden" name="validate" value="yes" />
 <input type="hidden" name="submitted" value="yes" />  <input type="hidden" name="submitted" value="yes" />
 <table>  <table>
   <tr><td>$lt{'prus'}</td><td><input type="string" name="proctorname" value="$env{'form.proctorname'}" /></td></tr>    <tr><td>$lt{'prus'}</td><td><input type="string" name="proctorname" value="$env{'form.proctorname'}" autocomplete="off" /></td></tr>
   <tr><td>$lt{'pasw'}</td><td><input type="password" name="proctorpassword" value="" /></td></tr>    <tr><td>$lt{'pasw'}</td><td><input type="password" name="proctorpassword" value="" autocomplete="off" /></td></tr>
   <tr><td>$lt{'prdo'}</td><td><input type="string" name="proctordomain" value="$env{'form.proctordomain'}" /></td></tr>    <tr><td>$lt{'prdo'}</td><td><input type="string" name="proctordomain" value="$env{'form.proctordomain'}" autocomplete="off" /></td></tr>
 </table>  </table>
 <input type="submit" name="checkoutbutton" value="$lt{'vali'}"  /><br />  <input type="submit" name="checkoutbutton" value="$lt{'vali'}"  /><br />
 <table border="1">  <table border="1">

Removed from v.1.265  
changed lines
  Added in v.1.271


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