Diff for /loncom/homework/grades.pm between versions 1.513.2.2 and 1.515

version 1.513.2.2, 2008/03/24 19:14:07 version 1.515, 2008/03/17 20:39:50
Line 73  my $ssi_error_message; Line 73  my $ssi_error_message;
 #                      the number of times requested by the caller.  #                      the number of times requested by the caller.
 #                      If we still have a proble, no text is appended to the  #                      If we still have a proble, no text is appended to the
 #                      output and we set some global variables.  #                      output and we set some global variables.
 #                      to indicate to the caller an SSI error occurred.    #                      to indicate to the caller an SSI error occured.  
 #                      All of this is supposed to deal with the issues described  #                      All of this is supposed to deal with the issues described
 #                      in LonCAPA BZ 5631 see:  #                      in LonCAPA BZ 5631 see:
 #                      http://bugs.lon-capa.org/show_bug.cgi?id=5631  #                      http://bugs.lon-capa.org/show_bug.cgi?id=5631
Line 89  my $ssi_error_message; Line 89  my $ssi_error_message;
 #   On success, returns the rendered resource identified by the resource parameter.  #   On success, returns the rendered resource identified by the resource parameter.
 # Side Effects:  # Side Effects:
 #   The following global variables can be set:  #   The following global variables can be set:
 #    ssi_error           - If an unrecoverable error occurred this becomes true.  #    ssi_error                - If an unrecoverable error occured this becomes true.
 #                               It is up to the caller to initialize this to false  #                               It is up to the caller to initialize this to false
 #                               if desired.  #                               if desired.
 #    ssi_error_resource  - If an unrecoverable error occurred, this is the value  #    ssi_last_error_resource  - If an unrecoverable error occured, this is the value
 #                               of the resource that could not be rendered by the ssi  #                               of the resource that could not be rendered by the ssi
 #                               call.  #                               call.
 #    ssi_error_message   - The error string fetched from the ssi response  #    ssi_last_error           - The error string fetched from the ssi response
 #                               in the event of an error.  #                               in the event of an error.
 #  #
 sub ssi_with_retries {  sub ssi_with_retries {
Line 116  sub ssi_with_retries { Line 116  sub ssi_with_retries {
   
 sub ssi_print_error {  sub ssi_print_error {
     my ($r) = @_;      my ($r) = @_;
     my $helpurl = &Apache::loncommon::top_nav_help('Helpdesk');      $r->print('<h2>Unrecoverable network error</h2>');
     $r->print('      $r->print('<p>Unable to perform a resource fetch from a server: <br />');
 <br />      $r->print("Resource: $ssi_error_resource <br />");
 <h2>'.&mt('An unrecoverable network error occurred:').'</h2>      $r->print("Error: $ssi_error_message <br /> Try again later.");
 <p>      $r->print('If errors persist, contact LonCAPA support for assistance</p>');
 '.&mt('Unable to retrieve a resource from a server:').'<br />  
 '.&mt('Resource:').' '.$ssi_error_resource.'<br />  
 '.&mt('Error:').' '.$ssi_error_message.'  
 </p>  
 <p>'.  
 &mt('It is recommended that you try again later, as this error may mean the server was just temporarily unavailable, or is down for maintenance.').'<br />'.  
 &mt('If the error persists, please contact the [_1] for assistance.',$helpurl).  
 '</p>');  
     return;  
 }  }
   
 #  #
Line 285  sub reset_caches { Line 276  sub reset_caches {
  my (undef,undef,$url)=&Apache::lonnet::decode_symb($symb);   my (undef,undef,$url)=&Apache::lonnet::decode_symb($symb);
  $url=&Apache::lonnet::clutter($url);   $url=&Apache::lonnet::clutter($url);
  my $subresult=&ssi_with_retries($url, $ssi_retries,   my $subresult=&ssi_with_retries($url, $ssi_retries,
    ('grade_target' => 'analyze',     ('grade_target' => 'analyze'),
     'grade_domain' => $udom,     ('grade_domain' => $udom),
     'grade_symb' => $symb,     ('grade_symb' => $symb),
     'grade_courseid' =>      ('grade_courseid' => 
      $env{'request.course.id'},      $env{'request.course.id'}),
     'grade_username' => $uname));     ('grade_username' => $uname));
  (undef,$subresult)=split(/_HASH_REF__/,$subresult,2);   (undef,$subresult)=split(/_HASH_REF__/,$subresult,2);
  my %analyze=&Apache::lonnet::str2hash($subresult);   my %analyze=&Apache::lonnet::str2hash($subresult);
  return $analyze_cache{$key} = \%analyze;   return $analyze_cache{$key} = \%analyze;
Line 1842  sub download_all_link { Line 1833  sub download_all_link {
  join("\n",&Apache::loncommon::get_env_multiple('form.vPart'));   join("\n",&Apache::loncommon::get_env_multiple('form.vPart'));
   
     my $identifier = &Apache::loncommon::get_cgi_id();      my $identifier = &Apache::loncommon::get_cgi_id();
     &Apache::lonnet::appenv('cgi.'.$identifier.'.students' => $all_students,      &Apache::lonnet::appenv({'cgi.'.$identifier.'.students' => $all_students,
                             'cgi.'.$identifier.'.symb' => $symb,                               'cgi.'.$identifier.'.symb' => $symb,
                             'cgi.'.$identifier.'.parts' => $parts,);                               'cgi.'.$identifier.'.parts' => $parts,});
     $r->print('<a href="/cgi-bin/multidownload.pl?'.$identifier.'">'.      $r->print('<a href="/cgi-bin/multidownload.pl?'.$identifier.'">'.
       &mt('Download All Submitted Documents').'</a>');        &mt('Download All Submitted Documents').'</a>');
     return      return
Line 7256  sub scantron_get_maxbubble { Line 7247  sub scantron_get_maxbubble {
             }              }
         }          }
  my $result=&ssi_with_retries($resource->src(), $ssi_retries,   my $result=&ssi_with_retries($resource->src(), $ssi_retries,
  ('symb' => $symb,   ('symb' => $symb),
  'grade_target' => 'analyze',   ('grade_target' => 'analyze'),
  'grade_courseid' => $cid,   ('grade_courseid' => $cid),
  'grade_domain' => $udom,   ('grade_domain' => $udom),
  'grade_username' => $uname));   ('grade_username' => $uname));
  my (undef, $an) =   my (undef, $an) =
     split(/_HASH_REF__/,$result, 2);      split(/_HASH_REF__/,$result, 2);
   
Line 7509  SCANTRONFORM Line 7500  SCANTRONFORM
   ($uname,$udom)=split(/:/,$uname);    ($uname,$udom)=split(/:/,$uname);
   
  &Apache::lonxml::clear_problem_counter();   &Apache::lonxml::clear_problem_counter();
   &Apache::lonnet::appenv(%$scan_record);    &Apache::lonnet::appenv($scan_record);
   
  if (&scantron_clear_skip($scanlines,$scan_data,$i)) {   if (&scantron_clear_skip($scanlines,$scan_data,$i)) {
     &scantron_putfile($scanlines,$scan_data);      &scantron_putfile($scanlines,$scan_data);

Removed from v.1.513.2.2  
changed lines
  Added in v.1.515


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