Diff for /loncom/homework/structuretags.pm between versions 1.539 and 1.540

version 1.539, 2015/09/14 13:45:19 version 1.540, 2015/10/05 02:35:40
Line 1510  sub start_problem { Line 1510  sub start_problem {
     my $status;      my $status;
     my $accessmsg;      my $accessmsg;
     my $resource_due;      my $resource_due;
       my $ipused;
   
     my $name= &get_resource_name($parstack,$safeeval);      my $name= &get_resource_name($parstack,$safeeval);
     my ($result,$form_tag_start,$slot_name,$slot,$probpartlist);      my ($result,$form_tag_start,$slot_name,$slot,$probpartlist);
Line 1522  sub start_problem { Line 1523  sub start_problem {
             &Apache::lonnet::set_first_access($interval[1],$timelimit);              &Apache::lonnet::set_first_access($interval[1],$timelimit);
         }          }
   
         ($status,$accessmsg,$slot_name,$slot) =          ($status,$accessmsg,$slot_name,$slot,$ipused) =
             &Apache::lonhomework::check_slot_access('0','problem');              &Apache::lonhomework::check_slot_access('0','problem');
         push (@Apache::inputtags::status,$status);          push (@Apache::inputtags::status,$status);
     }      }
Line 1613  sub start_problem { Line 1614  sub start_problem {
             ( $status eq 'NOTRESERVABLE') ||              ( $status eq 'NOTRESERVABLE') ||
             ( $status eq 'RESERVABLE') ||              ( $status eq 'RESERVABLE') ||
             ( $status eq 'RESERVABLE_LATER') ||              ( $status eq 'RESERVABLE_LATER') ||
     ( $status eq 'INVALID_ACCESS')) {      ( $status eq 'INVALID_ACCESS') ||
               ( $status eq 'NEED_DIFFERENT_IP')) {
     my $bodytext=&Apache::lonxml::get_all_text("/problem",$parser,      my $bodytext=&Apache::lonxml::get_all_text("/problem",$parser,
        $style);         $style);
     if ( $target eq "web" ) {      if ( $target eq "web" ) {
Line 1646  sub start_problem { Line 1648  sub start_problem {
                               &Apache::lonnavmaps::timeToHumanString($accessmsg,'start'));                                &Apache::lonnavmaps::timeToHumanString($accessmsg,'start'));
                 } elsif ($status eq 'NOTRESERVABLE') {                  } elsif ($status eq 'NOTRESERVABLE') {
                     $msg.=&mt('Not available to make a reservation.');                        $msg.=&mt('Not available to make a reservation.');  
  }   } elsif ($status eq 'NEED_DIFFERENT_IP') {
                       if ($ipused) {
                           $msg.=&mt('You must use the same computer ([_1]) you used when you first accessed this resource using your time/place-based reservation.',"IP: $ipused");
                       } else {
                           $msg.=&mt('Each student must use a different computer to access this resource at this time and/or place.').'<br />'.
                                 &mt('Somebody else has already used this particular computer for that purpose.');
                       }
                   }
  $result.=$msg.'<br />';   $result.=$msg.'<br />';
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  my $startminipage = ($env{'form.problem_split'}=~/yes/i)? ''   my $startminipage = ($env{'form.problem_split'}=~/yes/i)? ''
Line 1666  sub start_problem { Line 1675  sub start_problem {
  $result .=    $result .= 
     &Apache::bridgetask::proctor_validation_screen($slot);      &Apache::bridgetask::proctor_validation_screen($slot);
     } elsif ($target eq 'grade') {      } elsif ($target eq 'grade') {
  &Apache::bridgetask::proctor_check_auth($slot_name,$slot,   my $checkinresult = &Apache::bridgetask::proctor_check_auth($slot_name,$slot,
  'problem');                      'problem');
                   if ($checkinresult = /^error:/) {
                       $result .= 'error';
                   }
     }      }
  } elsif ($target eq 'web') {   } elsif ($target eq 'web') {
     if ($status eq 'CAN_ANSWER') {      if ($status eq 'CAN_ANSWER') {
Line 1677  sub start_problem { Line 1689  sub start_problem {
                         $Apache::lonhomework::history{'resource.0.checkedin'};                          $Apache::lonhomework::history{'resource.0.checkedin'};
                     if ($checked_in eq '') {                      if ($checked_in eq '') {
                         # unproctored slot access, self checkin                          # unproctored slot access, self checkin
                         &Apache::bridgetask::check_in('problem',undef,undef,                          my $needsiptied;
                                                       $slot_name);                          if (ref($slot)) {
                         $checked_in =                              $needsiptied = $slot->{'iptied'};
                             $Apache::lonhomework::results{"resource.0.checkedin"};                          }
                           my $check = &Apache::bridgetask::check_in('problem',undef,undef,
                                                                     $slot_name,$needsiptied);
                           if ($check =~ /^error: /) {
                               &Apache::lonnet::logthis("Error during self-checkin of problem (symb: $env{'request.symb'}) using slot: $slot_name");
                           } else {
                               $checked_in =
                                   $Apache::lonhomework::results{"resource.0.checkedin"};
                           }
                     }                      }
                     if ((ref($slot) eq 'HASH') && ($checked_in ne '')) {                      if ((ref($slot) eq 'HASH') && ($checked_in ne '')) {
                         if ($slot->{'starttime'} < time()) {                          if ($slot->{'starttime'} < time()) {

Removed from v.1.539  
changed lines
  Added in v.1.540


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