--- loncom/homework/grades.pm 2001/07/30 22:21:20 1.11
+++ loncom/homework/grades.pm 2001/08/20 23:27:27 1.15
@@ -2,6 +2,7 @@
# 2/9,2/13 Guy Albertelli
# 6/8 Gerd Kortemeyer
# 7/26 H.K. Ng
+# 8/20 Gerd Kortemeyer
package Apache::grades;
use strict;
@@ -40,7 +41,7 @@ sub listStudents {
my $reply=&Apache::lonnet::reply('get:'.$sdom.':'.$sname.
':environment:lastname&generation&firstname&middlename',
&Apache::lonnet::homeserver($sname,$sdom));
- print "reply=$reply
";
+ #print "reply=$reply
";
my (@nameparts) = split /&/,$reply;
# my $sfullname = $Apache::lonnet::unescape($nameparts[0]);
@@ -90,10 +91,10 @@ sub getclasslist {
my ($end,$start)=split(/:/,$value);
# still a student?
if (($hideexpired) && ($end) && ($end < $now)) {
- print "Skipping:$name:$end:$now
\n";
+ #print "Skipping:$name:$end:$now
\n";
next;
}
- print "record=$record
";
+ #print "record=$record
";
push( @{ $classlist{'allids'} }, $name);
}
return (%classlist);
@@ -331,7 +332,32 @@ sub handler {
&send_header($request);
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('