Diff for /loncom/homework/grades.pm between versions 1.10 and 1.14

version 1.10, 2001/07/27 18:20:16 version 1.14, 2001/08/20 19:28:37
Line 2 Line 2
 # 2/9,2/13 Guy Albertelli  # 2/9,2/13 Guy Albertelli
 # 6/8 Gerd Kortemeyer  # 6/8 Gerd Kortemeyer
 # 7/26 H.K. Ng  # 7/26 H.K. Ng
   # 8/20 Gerd Kortemeyer
   
 package Apache::grades;  package Apache::grades;
 use strict;  use strict;
Line 212  sub submission { Line 213  sub submission {
   if ($uname eq '') { &moreinfo($request,"Unable to find student"); return ''; }    if ($uname eq '') { &moreinfo($request,"Unable to find student"); return ''; }
   my $symb=&Apache::lonnet::symbread($url);    my $symb=&Apache::lonnet::symbread($url);
   if ($symb eq '') { $request->print("Unable to handle ambiguous references:$url:."); return ''; }    if ($symb eq '') { $request->print("Unable to handle ambiguous references:$url:."); return ''; }
   my $home=&Apache::lonnet::homeserver($uname,$udom);    my $answer=&Apache::loncommon::get_previous_attempt($symb,$uname,$udom,
   my $answer=&Apache::loncommon::get_previous_attempt($symb,$uname,$udom,$home,  
       $ENV{'request.course.id'});        $ENV{'request.course.id'});
   my $result="<h2> Submission Record </h2>  $uname:$udom for $url".$answer;    my $result="<h2> Submission Record </h2>  $uname:$udom for $url <br />".$answer;
   return $result;    return $result;
 }  }
   
Line 332  sub handler { Line 332  sub handler {
       
   &send_header($request);    &send_header($request);
   if ($url eq '' && $symb eq '') {    if ($url eq '' && $symb eq '') {
     $request->print("Non-Contextual Access Unsupported:$command:$url:");       if ($ENV{'user.adv'}) {
            if (($ENV{'form.codeone'}) && ($ENV{'form.codetwo'}) &&
                ($ENV{'form.codethree'})) {
                my $token=$ENV{'form.codeone'}.'*'.$ENV{'form.codetwo'}.'*'.
           $ENV{'form.codethree'};
                my ($tsymb,$tuname,$tudom,$tcrsid)=
    &Apache::lonnet::checkin($token);
                if ($tsymb) {
                   my ($map,$id,$url)=split(/\_\_\_/,$tsymb);
                   if (&Apache::lonnet::allowed('mgr',$tcrsid)) {
                      $request->print(
                        &Apache::lonnet::ssi('/res/'.$url,
                           ('grade_username' => $tuname,
                            'grade_domain' => $tudom,
                            'grade_courseid' => $tcrsid,
                            'grade_symb' => $tsymb)));
                   } else {
                      $request->print('<h1>Not authorized: '.$token.'</h1>');
                   }           
       } else {
                   $request->print('<h1>Not a valid DocID: '.$token.'</h1>');
               }
    } else {
                $request->print(&Apache::lonxml::tokeninputfield());
            }
        }
   } else {    } else {
     $Apache::grades::viewgrades=&Apache::lonnet::allowed('vgr',$ENV{'request.course.id'});      $Apache::grades::viewgrades=&Apache::lonnet::allowed('vgr',$ENV{'request.course.id'});
     if ($command eq 'submission') {      if ($command eq 'submission') {

Removed from v.1.10  
changed lines
  Added in v.1.14


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