version 1.22, 2002/05/03 22:34:25
|
version 1.23, 2002/05/08 18:59:37
|
Line 59 sub moreinfo {
|
Line 59 sub moreinfo {
|
return ''; |
return ''; |
} |
} |
|
|
|
sub verifyreceipt { |
|
my $request=shift; |
|
my $courseid=$ENV{'request.course.id'}; |
|
my $chome=$ENV{"course.$courseid.home"}; |
|
my $cdom=$ENV{"course.$courseid.domain"}; |
|
my $cnum=$ENV{"course.$courseid.num"}; |
|
my $receipt=unpack("%32C*",$Apache::lonnet::perlvar{'lonHostID'}).'-'. |
|
$ENV{'form.receipt'}; |
|
$receipt=~s/[^\-\d]//g; |
|
my $symb=$ENV{'form.symb'}; |
|
unless ($symb) { |
|
$symb=&Apache::lonnet::symbread($ENV{'form.url'}); |
|
} |
|
if ((&Apache::lonnet::allowed('mgr',$courseid)) && ($symb)) { |
|
$request->print('<h1>Verifying Submission Receipt '.$receipt.'</h1>'); |
|
my $matches=0; |
|
my (%classlist) = &getclasslist($cdom,$cnum,$chome,'0'); |
|
foreach my $student ( sort(@{ $classlist{'allids'} }) ) { |
|
my ($uname,$udom)=split(/\:/,$student); |
|
if ($receipt eq |
|
&Apache::lonnet::ireceipt($uname,$udom,$courseid,$symb)) { |
|
$request->print('Matching '.$student.'<br>'); |
|
$matches++; |
|
} |
|
} |
|
$request->print('<p>'.$matches.' match(es)</p>'); |
|
} |
|
return ''; |
|
} |
|
|
sub listStudents { |
sub listStudents { |
my ($request) = shift; |
my ($request) = shift; |
my ($cdom,$cnum) = split(/_/,$ENV{'request.course.id'}); |
|
my $chome=$ENV{"course.$ENV{'request.course.id'}.home"}; |
my $chome=$ENV{"course.$ENV{'request.course.id'}.home"}; |
$request->print ('<h1>Show Student Submissions on Assessment</h1>'. |
my $cdom=$ENV{"course.$ENV{'request.course.id'}.domain"}; |
'<table border="1"><tr><th>Username</th><th>Domain</th><th>Name</th><th> </th></tr>' |
my $cnum=$ENV{"course.$ENV{'request.course.id'}.num"}; |
); |
my $hostver=unpack("%32C*",$Apache::lonnet::perlvar{'lonHostID'}); |
|
$request->print(<<ENDHEADER); |
|
<h1>Verify a Submission Receipt Issued by this Server</h1> |
|
<form action="/adm/grades" method="post"> |
|
<tt>$hostver-<input type="text" name="receipt" size="4"></tt> |
|
<input type="submit" name="submit" value="Verify"> |
|
<input type="hidden" name="command" value="verify"> |
|
ENDHEADER |
|
if ($ENV{'form.url'}) { |
|
$request->print( |
|
'<input type="hidden" name="url" value="'.$ENV{'form.url'}.'" />'); |
|
} |
|
if ($ENV{'form.symb'}) { |
|
$request->print( |
|
'<input type="hidden" name="symb" value="'.$ENV{'form.symb'}.'" />'); |
|
} |
|
$request->print(<<ENDTABLEST); |
|
</form> |
|
<h1>Show Student Submissions on Assessment</h1> |
|
<table border="1"> |
|
<tr><th>Username</th><th>Domain</th><th>Name</th><th> </th></tr> |
|
ENDTABLEST |
my (%classlist) = &getclasslist($cdom,$cnum,$chome,'0'); |
my (%classlist) = &getclasslist($cdom,$cnum,$chome,'0'); |
foreach my $student ( sort(@{ $classlist{'allids'} }) ) { |
foreach my $student ( sort(@{ $classlist{'allids'} }) ) { |
my ($sname,$sdom) = split(/:/,$student); |
my ($sname,$sdom) = split(/:/,$student); |
Line 428 sub handler {
|
Line 477 sub handler {
|
$request->print(&viewgrades($request)); |
$request->print(&viewgrades($request)); |
} elsif ($command eq 'editgrades') { |
} elsif ($command eq 'editgrades') { |
$request->print(&editgrades($request)); |
$request->print(&editgrades($request)); |
|
} elsif ($command eq 'verify') { |
|
$request->print(&verifyreceipt($request)); |
} else { |
} else { |
$request->print("Unknown action:$command:"); |
$request->print("Unknown action: $command:"); |
} |
} |
} |
} |
&send_footer($request); |
&send_footer($request); |