Diff for /loncom/homework/lonhomework.pm between versions 1.347 and 1.349.2.2

version 1.347, 2015/01/19 15:35:53 version 1.349.2.2, 2015/04/14 21:35:56
Line 469  sub check_access { Line 469  sub check_access {
  if ( $tries eq '' ) { $tries = '0'; }   if ( $tries eq '' ) { $tries = '0'; }
  if ( $maxtries eq '' &&    if ( $maxtries eq '' && 
      $env{'request.state'} ne 'construct') { $maxtries = '2'; }        $env{'request.state'} ne 'construct') { $maxtries = '2'; } 
  $Apache::lonhomework::results{'resource.'.$id.'.maxtries'}=$maxtries;  
  if ($maxtries && $tries >= $maxtries) { $status = 'CANNOT_ANSWER'; }   if ($maxtries && $tries >= $maxtries) { $status = 'CANNOT_ANSWER'; }
  # if (correct and show prob status) or excused then CANNOT_ANSWER   # if (correct and show prob status) or excused then CANNOT_ANSWER
  if ( ($Apache::lonhomework::history{"resource.$id.solved"}=~/^correct/)   if ( ($Apache::lonhomework::history{"resource.$id.solved"}=~/^correct/)
Line 1016  sub editxmlmode { Line 1015  sub editxmlmode {
               '</div><div class="LC_edit_actionbar" id="actionbar">';                '</div><div class="LC_edit_actionbar" id="actionbar">';
   
         $result.='<input type="hidden" name="problemmode" value="saveedit" />'.          $result.='<input type="hidden" name="problemmode" value="saveedit" />'.
                   &Apache::structuretags::problem_actionbar_buttons('editxml');                    &Apache::structuretags::problem_edit_buttons('editxml');
         $result.='<div class="LC_edit_problem_discards">';          $result.='<div class="LC_edit_problem_discards">';
   
  unless ($env{'environment.nocodemirror'}) {   unless ($env{'environment.nocodemirror'}) {
Line 1332  sub update_construct_style { Line 1331  sub update_construct_style {
     }      }
 }  }
   
   # Sets timer to zero for the entire folder containing the current resource for the
   # current user.
   sub zero_timer {
       my $symb = shift;
       my $first_access = &Apache::lonnet::get_first_access("map",$symb);
       my $done_time = time() - $first_access;
       &Apache::lonparmset::storeparm_by_symb($symb,"0_interval","2",$done_time,
               "date_interval",$env{'user.name'},$env{'user.domain'},,'',);
   }
   
   
 sub handler {  sub handler {
     #my $t0 = [&gettimeofday()];      #my $t0 = [&gettimeofday()];
     my $request=$_[0];      my $request=$_[0];
   
       my ($symb) = &Apache::lonnet::whichuser();
   
       # Set the event timer to zero if the "done button" was clicked.  The button is 
       # part of the doneButton form created in lonmenu.pm
       if ($env{"form.done"} eq "true") {
           &zero_timer($symb);
           $env{"form.done"} = "";
       }
   
     $Apache::lonxml::request=$request;      $Apache::lonxml::request=$request;
     $Apache::lonxml::debug=$env{'user.debug'};      $Apache::lonxml::debug=$env{'user.debug'};
     $env{'request.uri'}=$request->uri;      $env{'request.uri'}=$request->uri;
Line 1360  sub handler { Line 1379  sub handler {
     }      }
     &Apache::lonxml::debug("Permissions:$Apache::lonhomework::browse:$Apache::lonhomework::viewgrades:$Apache::lonhomework::modifygrades:$Apache::lonhomework::queuegrade");      &Apache::lonxml::debug("Permissions:$Apache::lonhomework::browse:$Apache::lonhomework::viewgrades:$Apache::lonhomework::modifygrades:$Apache::lonhomework::queuegrade");
     &Apache::lonxml::debug("Problem Mode ".$env{'form.problemmode'});      &Apache::lonxml::debug("Problem Mode ".$env{'form.problemmode'});
     my ($symb) = &Apache::lonnet::whichuser();  
     &Apache::lonxml::debug('symb is '.$symb);      &Apache::lonxml::debug('symb is '.$symb);
     if ($env{'request.state'} eq "construct") {      if ($env{'request.state'} eq "construct") {
  if ( -e $file ) {   if ( -e $file ) {

Removed from v.1.347  
changed lines
  Added in v.1.349.2.2


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