Diff for /loncom/homework/structuretags.pm between versions 1.408 and 1.414

version 1.408, 2007/10/31 01:37:52 version 1.414, 2007/11/20 17:53:22
Line 199  sub page_start { Line 199  sub page_start {
  }   }
     }      }
   
     if (!defined($found{'body'})) {      if (!defined($found{'body'}) && $env{'request.state'} ne 'construct') {
  $page_start .= &Apache::lonxml::message_location();   $page_start .= &Apache::lonxml::message_location();
     }      }
           
Line 317  sub problem_edit_header { Line 317  sub problem_edit_header {
        <input type="submit" name="submit" accesskey="v" value="'.&mt('Save and View').'" />         <input type="submit" name="submit" accesskey="v" value="'.&mt('Save and View').'" />
   </div>    </div>
 <hr class="LC_edit_problem_divide" />  <hr class="LC_edit_problem_divide" />
   '.&Apache::lonxml::message_location().'
 </div>  </div>
 '.  '.
        '<table border="0" width="100%"><tr><td bgcolor="#DDDDDD">';         '<table border="0" width="100%"><tr><td bgcolor="#DDDDDD">';
 }  }
   
 sub problem_edit_footer {  sub problem_edit_footer {
     return '</td></tr></table><br /><input type="submit" name="submit" value="'.&mt('Submit Changes and Edit').'" />      return '</td></tr></table><br />
     <input type="submit" name="submit" value="'.&mt('Submit Changes and View').'" />'.  <div class="LC_edit_problem_footer">
     <hr class="LC_edit_problem_divide" />
     <div class="LC_edit_problem_discards">
        <input type="submit" name="problemmode" accesskey="d" value="'.&mt('Discard Edits and View').'" />
        <input '.&Apache::edit::submit_ask_anyway().' type="submit" name="problemmode" accesskey="x" value="'.&mt('EditXML').'" />
        <input type="submit" name="Undo" accesskey="u" value="'.&mt('undo').'" />
     </div>
     <div class="LC_edit_problem_saves">
       <input type="submit" name="submit" value="'.&mt('Save and Edit').'" />
       <input type="submit" name="submit" value="'.&mt('Save and View').'" />
     </div>
     <hr class="LC_edit_problem_divide" />
   </div>
   '.
   
     &Apache::lonhtmlcommon::htmlareaselectactive(&Apache::lonhtmlcommon::get_htmlareafields()).      &Apache::lonhtmlcommon::htmlareaselectactive(&Apache::lonhtmlcommon::get_htmlareafields()).
     "\n</form>\n".&Apache::loncommon::end_page();      "\n</form>\n".&Apache::loncommon::end_page();
 }  }
Line 460  $show_all Line 475  $show_all
     $result.='<input type="hidden" name="problemmode" value="'.&mt('View').'" />';      $result.='<input type="hidden" name="problemmode" value="'.&mt('View').'" />';
     $result .= '<input type="submit" name="problemmode" accesskey="e" value="'.&mt('Edit').'" />';      $result .= '<input type="submit" name="problemmode" accesskey="e" value="'.&mt('Edit').'" />';
     $result .= '<input type="submit" name="problemmode" accesskey="x" value="'.&mt('EditXML').'" />';      $result .= '<input type="submit" name="problemmode" accesskey="x" value="'.&mt('EditXML').'" />';
   
     $result.='      $result.='
    </div>     </div>
      '.&Apache::lonxml::message_location().'
 </div>';  </div>';
     return $result;      return $result;
 }  }
Line 605  ENDCHECKOUT Line 620  ENDCHECKOUT
   
 sub firstaccess_msg {  sub firstaccess_msg {
     my ($time,$symb)=@_;      my ($time,$symb)=@_;
     my ($map)=&Apache::lonnet::decode_symb($symb);      my $result;
     my $foldertitle=&Apache::lonnet::gettitle($map);      my @interval=&Apache::lonnet::EXT("resource.0.interval");
     &Apache::lonxml::debug("map is $map title is $foldertitle");      if ($interval[1] eq 'map') {
     my $uri = &Apache::lonenc::check_encrypt($env{'request.uri'});   my ($map)=&Apache::lonnet::decode_symb($symb);
     return (<<ENDCHECKOUT);   my $foldertitle=&Apache::lonnet::gettitle($map);
       
    &Apache::lonxml::debug("map is $map title is $foldertitle");
    $result .= (<<ENDCHECKOUT);
 <h2>The resources in "$foldertitle" are open for a limited time. Once you click the 'Show Resource' button below you have $time to complete all resources "$foldertitle".</h2>  <h2>The resources in "$foldertitle" are open for a limited time. Once you click the 'Show Resource' button below you have $time to complete all resources "$foldertitle".</h2>
   ENDCHECKOUT
       } elsif ($interval[1] eq 'course') {
    my $course = $env{'course.'.$env{'request.course.id'}.'.description'};
    $result .= (<<ENDCHECKOUT);
   <h2>The resources in "$course" are open for a limited time. Once you click the 'Show Resource' button below you have $time to complete all resources in "$course".</h2>
   ENDCHECKOUT
       } else {
    my $title=&Apache::lonnet::gettitle($symb);
    $result .= (<<ENDCHECKOUT);
   <h2>This resource "$title" is open for a limited time. Once you click the 'Show Resource' button below you have $time to complete this resource "$title".</h2>
   ENDCHECKOUT
   
       }
       my $uri = &Apache::lonenc::check_encrypt($env{'request.uri'});
       $result .= (<<ENDCHECKOUT);
 <form name="markaccess" method="POST" action="$uri">  <form name="markaccess" method="POST" action="$uri">
 <input type="hidden" name="markaccess" value="yes" />  <input type="hidden" name="markaccess" value="yes" />
 <input type="button" name="accessbutton" value="Show Resource" onClick="javascript:if (confirm('Start Timer?')) { document.markaccess.submit(); }" />  <input type="button" name="accessbutton" value="Show Resource" onClick="javascript:if (confirm('Start Timer?')) { document.markaccess.submit(); }" />
 </form>  </form>
 ENDCHECKOUT  ENDCHECKOUT
       return $result;
 }  }
   
 sub init_problem_globals {  sub init_problem_globals {
Line 722  sub start_problem { Line 756  sub start_problem {
     if ($target ne 'analyze') {      if ($target ne 'analyze') {
  $Apache::lonhomework::type=&Apache::lonnet::EXT('resource.0.type');   $Apache::lonhomework::type=&Apache::lonnet::EXT('resource.0.type');
  if (($env{'request.state'} eq 'construct') &&   if (($env{'request.state'} eq 'construct') &&
     defined($env{'form.problemtype'})) {      $env{'form.problemtype'} =~ /\S/) {
     $Apache::lonhomework::type=$env{'form.problemtype'};      $Apache::lonhomework::type=$env{'form.problemtype'};
  }   }
  &Apache::lonxml::debug("Found this to be of type :$Apache::lonhomework::type:");   &Apache::lonxml::debug("Found this to be of type :$Apache::lonhomework::type:");
Line 783  sub start_problem { Line 817  sub start_problem {
     $result.=&Apache::lonxml::printtokenheader($target,$token);      $result.=&Apache::lonxml::printtokenheader($target,$token);
  }   }
  if ($env{'form.markaccess'}) {   if ($env{'form.markaccess'}) {
     &Apache::lonnet::set_first_access('map');      my @interval=&Apache::lonnet::EXT("resource.0.interval");
       &Apache::lonnet::set_first_access($interval[1]);
  }   }
  #handle rand seed in construction space   #handle rand seed in construction space
  my $rndseed=&setup_rndseed($safeeval);   my $rndseed=&setup_rndseed($safeeval);

Removed from v.1.408  
changed lines
  Added in v.1.414


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