--- loncom/homework/grades.pm 2002/04/09 03:56:29 1.20
+++ loncom/homework/grades.pm 2002/05/24 21:45:22 1.27
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# The LON-CAPA Grading handler
#
-# $Id: grades.pm,v 1.20 2002/04/09 03:56:29 albertel Exp $
+# $Id: grades.pm,v 1.27 2002/05/24 21:45:22 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -59,29 +59,78 @@ sub moreinfo {
return '';
}
+sub verifyreceipt {
+ my $request=shift;
+ my $courseid=$ENV{'request.course.id'};
+ 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('
Verifying Submission Receipt '.$receipt.'
');
+ my $matches=0;
+ my (%classlist) = &getclasslist($cdom,$cnum,'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.' ');
+ $matches++;
+ }
+ }
+ $request->print('
'.$matches.' match(es)
');
+ }
+ return '';
+}
sub listStudents {
my ($request) = shift;
- my ($cdom,$cnum) = split(/_/,$ENV{'request.course.id'});
- my $chome=$ENV{"course.$ENV{'request.course.id'}.home"};
- $request->print ('
Show Student Submissions on Assessment
'.
- '
Username
Domain
Name
'
- );
- my (%classlist) = &getclasslist($cdom,$cnum,$chome,'0');
+ my $cdom=$ENV{"course.$ENV{'request.course.id'}.domain"};
+ my $cnum=$ENV{"course.$ENV{'request.course.id'}.num"};
+ my $hostver=unpack("%32C*",$Apache::lonnet::perlvar{'lonHostID'});
+ $request->print(<Verify a Submission Receipt Issued by this Server
+