Diff for /loncom/homework/grades.pm between versions 1.645 and 1.646

version 1.645, 2011/02/07 19:16:28 version 1.646, 2011/03/31 17:58:25
Line 40  use Apache::lonhomework; Line 40  use Apache::lonhomework;
 use Apache::lonpickcode;  use Apache::lonpickcode;
 use Apache::loncoursedata;  use Apache::loncoursedata;
 use Apache::lonmsg();  use Apache::lonmsg();
 use Apache::Constants qw(:common);  use Apache::Constants qw(:common :http);
 use Apache::lonlocal;  use Apache::lonlocal;
 use Apache::lonenc;  use Apache::lonenc;
 use Apache::lonstathelpers;  use Apache::lonstathelpers;
Line 9217  sub select_problem { Line 9217  sub select_problem {
 sub handler {  sub handler {
     my $request=$_[0];      my $request=$_[0];
     &reset_caches();      &reset_caches();
     if ($env{'browser.mathml'}) {      if ($request->header_only) {
  &Apache::loncommon::content_type($request,'text/xml');          &Apache::loncommon::content_type($request,'text/html');
     } else {          $request->send_http_header;
  &Apache::loncommon::content_type($request,'text/html');          return OK;
     }      }
     $request->send_http_header;  
     return '' if $request->header_only;  
     &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'});      &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'});
   
       &init_perm();
       if (!$env{'request.course.id'}) {
           # Not in a course.
           $env{'user.error.msg'}="/adm/grades::vgr:0:0:Cannot display grades page outside course context";
           return HTTP_NOT_ACCEPTABLE;
       } elsif (!%perm) {
           $request->internal_redirect('/adm/quickgrades');
       }
       &Apache::loncommon::content_type($request,'text/html');
       $request->send_http_header;
   
   
 # see what command we need to execute  # see what command we need to execute
   
     my @commands=&Apache::loncommon::get_env_multiple('form.command');      my @commands=&Apache::loncommon::get_env_multiple('form.command');
Line 9242  sub handler { Line 9252  sub handler {
        (my $url=$env{'form.url'}) =~ s-^https*://($ENV{'SERVER_NAME'}|$ENV{'HTTP_HOST'})--;         (my $url=$env{'form.url'}) =~ s-^https*://($ENV{'SERVER_NAME'}|$ENV{'HTTP_HOST'})--;
        $symb=&Apache::lonnet::symbread($url);         $symb=&Apache::lonnet::symbread($url);
     }      }
     &Apache::lonenc::check_decrypt(\$symb);                                   &Apache::lonenc::check_decrypt(\$symb);
   
     $ssi_error = 0;      $ssi_error = 0;
     if (($symb eq '' || $command eq '') && ($env{'request.course.id'})) {      if (($symb eq '' || $command eq '') && ($env{'request.course.id'})) {
Line 9252  sub handler { Line 9262  sub handler {
         &startpage($request,undef,[],1,1);          &startpage($request,undef,[],1,1);
         &select_problem($request);          &select_problem($request);
     } else {      } else {
  &init_perm();  
  if ($command eq 'submission' && $perm{'vgr'}) {   if ($command eq 'submission' && $perm{'vgr'}) {
             &startpage($request,$symb,[{href=>"", text=>"Student Submissions"}]);              &startpage($request,$symb,[{href=>"", text=>"Student Submissions"}]);
     ($env{'form.student'} eq '' ? &listStudents($request,$symb) : &submission($request,0,0,$symb));      ($env{'form.student'} eq '' ? &listStudents($request,$symb) : &submission($request,0,0,$symb));
Line 9396  sub handler { Line 9405  sub handler {
     &Apache::lonquickgrades::endGradeScreen($request);      &Apache::lonquickgrades::endGradeScreen($request);
     $request->print(&Apache::loncommon::end_page());      $request->print(&Apache::loncommon::end_page());
     &reset_caches();      &reset_caches();
     return '';      return OK;
 }  }
   
 1;  1;

Removed from v.1.645  
changed lines
  Added in v.1.646


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