version 1.1, 2001/02/07 00:29:30
|
version 1.2, 2001/02/09 03:24:45
|
Line 11 use Apache::lonnet;
|
Line 11 use Apache::lonnet;
|
use Apache::lonhomework; |
use Apache::lonhomework; |
use Apache::Constants qw(:common); |
use Apache::Constants qw(:common); |
|
|
|
sub moreinfo { |
|
my ($request,$reason) = @_; |
|
$request->print("Unable to process request: $reason"); |
|
$request->print('<form action="/adm/grades" method="post">'."\n"); |
|
$request->print('<input type="hidden" name="url" value="'.$ENV{'form.url'}.'"></input>'."\n"); |
|
$request->print('<input type="hidden" name="command" value="'.$ENV{'form.command'}.'"></input>'."\n"); |
|
$request->print("Student:".'<input type="text" name="student" value="'.$ENV{'form.student'}.'"></input>'."<br />\n"); |
|
$request->print("Domain:".'<input type="text" name="domain" value="'.$ENV{'user.domain'}.'"></input>'."<br />\n"); |
|
$request->print('<input type="submit" name="submit" value="ReSubmit"></input>'."<br />\n"); |
|
$request->print('</form>'); |
|
} |
|
|
|
|
|
sub finduser { |
|
my ($name) = @_; |
|
|
|
} |
|
|
|
sub submission { |
|
my ($request) = @_; |
|
if ($ENV{'form.student'} eq '') { &moreinfo($request,"Need student login id"); return ''; } |
|
my ($uname,$udom) = &finduser($ENV{'form.student'}); |
|
if ($uname eq '') { &moreinfo($request,"Unable to find student"); return ''; } |
|
# my $answer=&Apache::lonnet::reply( |
|
# "restore:$udom:$uname:". |
|
# $ENV{'request.course.id'}.':'. |
|
# &Apache::lonnet::escape($symb), |
|
# &Apache::lonnet::homeserver($uname,$udom)); |
|
return ''; |
|
} |
|
|
|
sub send_header { |
|
my ($request)= @_; |
|
$request->print(&Apache::lontexconvert::header()); |
|
$request->print('<body bgcolor="#FFFFFF">'); |
|
} |
|
|
|
sub send_footer { |
|
my ($request)= @_; |
|
$request->print('</body>'); |
|
$request->print(&Apache::lontexconvert::footer()); |
|
} |
|
|
sub handler { |
sub handler { |
my $request=$_[0]; |
my $request=$_[0]; |
|
|
Line 24 sub handler {
|
Line 67 sub handler {
|
$request->send_http_header; |
$request->send_http_header; |
return OK if $request->header_only; |
return OK if $request->header_only; |
my $url=$ENV{'form.url'}; |
my $url=$ENV{'form.url'}; |
|
my $command=$ENV{'form.command'}; |
|
|
|
&send_header($request); |
if ($url eq '') { |
if ($url eq '') { |
$request->print("Non-Contextual Access Unsupported"); |
$request->print("Non-Contextual Access Unsupported:$command:$url:"); |
} else { |
} else { |
$Apache::grades::viewgrades=&Apache::lonnet::allowed('vgr',$url); |
$Apache::grades::viewgrades=&Apache::lonnet::allowed('vgr',$url); |
|
if ($command eq 'submission') { |
|
&submission($request); |
|
} else { |
|
$request->print("Unknown action:$command:"); |
|
} |
} |
} |
|
&send_footer($request); |
return OK; |
return OK; |
} |
} |
|
|