--- loncom/homework/grades.pm 2002/05/08 18:59:37 1.23
+++ loncom/homework/grades.pm 2002/05/15 23:47:49 1.24
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# The LON-CAPA Grading handler
#
-# $Id: grades.pm,v 1.23 2002/05/08 18:59:37 www Exp $
+# $Id: grades.pm,v 1.24 2002/05/15 23:47:49 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -62,7 +62,6 @@ sub moreinfo {
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'}).'-'.
@@ -75,7 +74,7 @@ sub verifyreceipt {
if ((&Apache::lonnet::allowed('mgr',$courseid)) && ($symb)) {
$request->print('
Verifying Submission Receipt '.$receipt.'
');
my $matches=0;
- my (%classlist) = &getclasslist($cdom,$cnum,$chome,'0');
+ my (%classlist) = &getclasslist($cdom,$cnum,'0');
foreach my $student ( sort(@{ $classlist{'allids'} }) ) {
my ($uname,$udom)=split(/\:/,$student);
if ($receipt eq
@@ -91,7 +90,6 @@ sub verifyreceipt {
sub listStudents {
my ($request) = shift;
- my $chome=$ENV{"course.$ENV{'request.course.id'}.home"};
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'});
@@ -116,7 +114,7 @@ ENDHEADER
Username | Domain | Name | |
ENDTABLEST
- my (%classlist) = &getclasslist($cdom,$cnum,$chome,'0');
+ my (%classlist) = &getclasslist($cdom,$cnum,'0');
foreach my $student ( sort(@{ $classlist{'allids'} }) ) {
my ($sname,$sdom) = split(/:/,$student);
@@ -161,9 +159,8 @@ sub finduser {
if ( $Apache::grades::viewgrades eq 'F' ) {
#get classlist
my ($cdom,$cnum) = split(/_/,$ENV{'request.course.id'});
- my $chome=$ENV{"course.$ENV{'request.course.id'}.home"};
- #print "Found $cdom:$cnum:$chome
";
- my (%classlist) = &getclasslist($cdom,$cnum,$chome,'0');
+ #print "Found $cdom:$cnum
";
+ my (%classlist) = &getclasslist($cdom,$cnum,'0');
foreach my $student ( sort(@{ $classlist{'allids'} }) ) {
my ($posname,$posdomain) = split(/:/,$student);
if ($posname =~ $name) { $name=$posname; $domain=$posdomain; last; }
@@ -175,20 +172,18 @@ sub finduser {
}
sub getclasslist {
- my ($coursedomain,$coursenum,$coursehome,$hideexpired) = @_;
- my $classlist=&Apache::lonnet::reply("dump:$coursedomain:$coursenum:classlist",$coursehome);
- my %classlist=();
+ my ($coursedomain,$coursenum,$hideexpired) = @_;
+ my %classlist=&Apache::lonnet::dump('classlist',$coursedomain,$coursenum);
my $now = time;
- foreach my $record (split /&/, $classlist) {
- my ($name,$value)=split(/=/,&Apache::lonnet::unescape($record));
- my ($end,$start)=split(/:/,$value);
+ foreach my $student (keys(%classlist)) {
+ my ($end,$start)=split(/:/,$classlist{$student});
# still a student?
if (($hideexpired) && ($end) && ($end < $now)) {
#print "Skipping:$name:$end:$now
\n";
next;
}
#print "record=$record
";
- push( @{ $classlist{'allids'} }, $name);
+ push( @{ $classlist{'allids'} }, $student);
}
return (%classlist);
}
@@ -337,9 +332,8 @@ sub viewgrades {
#get classlist
my ($cdom,$cnum) = split(/_/,$ENV{'request.course.id'});
- my $chome=$ENV{"course.$ENV{'request.course.id'}.home"};
- #print "Found $cdom:$cnum:$chome
";
- my (%classlist) = &getclasslist($cdom,$cnum,$chome,'0');
+ #print "Found $cdom:$cnum
";
+ my (%classlist) = &getclasslist($cdom,$cnum,'0');
my $headerclr = '"#ccffff"';
my $cellclr = '"#ffffcc"';
@@ -381,9 +375,8 @@ sub editgrades {
my $url=$ENV{'form.url'};
#get classlist
my ($cdom,$cnum) = split(/_/,$ENV{'request.course.id'});
- my $chome=$ENV{"course.$ENV{'request.course.id'}.home"};
- #print "Found $cdom:$cnum:$chome
";
- my (%classlist) = &getclasslist($cdom,$cnum,$chome,'0');
+ #print "Found $cdom:$cnum
";
+ my (%classlist) = &getclasslist($cdom,$cnum,'0');
#get list of parts for this problem
my (@parts) = &getpartlist($url);