Diff for /loncom/homework/lonhomework.pm between versions 1.344.2.8.4.1 and 1.344.2.10

version 1.344.2.8.4.1, 2017/06/21 19:55:00 version 1.344.2.10, 2018/09/21 04:37:36
Line 235  sub check_slot_access { Line 235  sub check_slot_access {
     $Apache::lonhomework::history{"resource.$version.0.status"} eq 'pass') {      $Apache::lonhomework::history{"resource.$version.0.status"} eq 'pass') {
     return ('SHOW_ANSWER');      return ('SHOW_ANSWER');
  }   }
       } elsif (($type eq 'problem') &&
                ($Apache::lonhomework::browse eq 'F') &&
                ($ENV{'REMOTE_ADDR'} eq '127.0.0.1') &&
                ($env{'form.grade_courseid'} eq $env{'request.course.id'}) &&
                (&Apache::lonnet::allowed('mgr',$env{'request.course.id'}))) {
           return ($status,$datemsg);
     }      }
   
     my $availablestudent = &Apache::lonnet::EXT("resource.0.availablestudent",$symb);      my $availablestudent = &Apache::lonnet::EXT("resource.0.availablestudent",$symb);
Line 311  sub check_slot_access { Line 317  sub check_slot_access {
                         $earlyout = 1;                          $earlyout = 1;
                     }                      }
                 }                  }
                 if (($currtries == $maxtries) || ($is_correct)) {                  if ($currtries == $maxtries) {
                     $earlyout = 1;                      $earlyout = 1;
                 } else {                  } else {
                     $numgraded ++;                      $numgraded ++;
Line 1460  sub update_construct_style { Line 1466  sub update_construct_style {
     }      }
 }  }
   
 #  
 # Sets interval for current user so time left will be zero, either for the entire folder  
 # containing the current resource, or just the resource, depending on value of first item  
 # in interval array retrieved from EXT("resource.0.interval");  
 #  
 sub zero_timer {  
     my ($symb) = @_;  
     my ($hastimeleft,$first_access,$now);  
     my @interval=&Apache::lonnet::EXT("resource.0.interval");  
     if (@interval > 1) {  
         if ($interval[1] eq 'course') {  
             return;  
         } else {  
             my $now = time;  
             my $first_access=&Apache::lonnet::get_first_access($interval[1],$symb);  
             if ($first_access > 0) {  
                 if ($first_access+$interval[0] > $now) {  
                     my $done_time = $now - $first_access;  
                     my $snum = 1;  
                     if ($interval[1] eq 'map') {  
                         $snum = 2;  
                     }  
                     my $result =  
                         &Apache::lonparmset::storeparm_by_symb_inner($symb,'0_interval',  
                                                                      $snum,$done_time,  
                                                                      'date_interval',  
                                                                      $env{'user.name'},  
                                                                      $env{'user.domain'});  
                     return $result;  
                 }  
             }  
         }  
     }  
     return;  
 }  
   
 sub handler {  sub handler {
     #my $t0 = [&gettimeofday()];      #my $t0 = [&gettimeofday()];
Line 1551  sub handler { Line 1522  sub handler {
     &newproblem($request);      &newproblem($request);
  }   }
     } else {      } else {
         # Set the event timer to zero if the "done button" was clicked.  The button is  
         # part of the LCdoneButton form created in lonmenu.pm  
         if ($symb && $env{'form.LC_interval_done'} eq 'true') {  
             &zero_timer($symb);  
             undef($env{'form.LC_interval_done'});  
         }  
  # just render the page normally outside of construction space   # just render the page normally outside of construction space
  &Apache::lonxml::debug("not construct");   &Apache::lonxml::debug("not construct");
  &renderpage($request,$file);   &renderpage($request,$file);
Line 1706  sub helpmenu_datastructure { Line 1671  sub helpmenu_datastructure {
   
     # filename, title, width, height      # filename, title, width, height
     my $helpers = [      my $helpers = [
                     ['Problem_LON-CAPA_Function.hlp', &mt('Script Functions'), 800, 600],                      ['Problem_LON-CAPA_Functions.hlp', &mt('Script Functions'), 800, 600],
                     ['Greek_Symbols.hlp', &mt('Greek Symbols'), 500, 600],                      ['Greek_Symbols.hlp', &mt('Greek Symbols'), 500, 600],
                     ['Other_Symbols.hlp', &mt('Other Symbols'), 500, 600],                      ['Other_Symbols.hlp', &mt('Other Symbols'), 500, 600],
                     ['Authoring_Output_Tags.hlp', &mt('Output Tags'), 800, 600],                      ['Authoring_Output_Tags.hlp', &mt('Output Tags'), 800, 600],

Removed from v.1.344.2.8.4.1  
changed lines
  Added in v.1.344.2.10


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