version 1.23, 2002/05/08 18:59:37
|
version 1.24, 2002/05/15 23:47:49
|
Line 62 sub moreinfo {
|
Line 62 sub moreinfo {
|
sub verifyreceipt { |
sub verifyreceipt { |
my $request=shift; |
my $request=shift; |
my $courseid=$ENV{'request.course.id'}; |
my $courseid=$ENV{'request.course.id'}; |
my $chome=$ENV{"course.$courseid.home"}; |
|
my $cdom=$ENV{"course.$courseid.domain"}; |
my $cdom=$ENV{"course.$courseid.domain"}; |
my $cnum=$ENV{"course.$courseid.num"}; |
my $cnum=$ENV{"course.$courseid.num"}; |
my $receipt=unpack("%32C*",$Apache::lonnet::perlvar{'lonHostID'}).'-'. |
my $receipt=unpack("%32C*",$Apache::lonnet::perlvar{'lonHostID'}).'-'. |
Line 75 sub verifyreceipt {
|
Line 74 sub verifyreceipt {
|
if ((&Apache::lonnet::allowed('mgr',$courseid)) && ($symb)) { |
if ((&Apache::lonnet::allowed('mgr',$courseid)) && ($symb)) { |
$request->print('<h1>Verifying Submission Receipt '.$receipt.'</h1>'); |
$request->print('<h1>Verifying Submission Receipt '.$receipt.'</h1>'); |
my $matches=0; |
my $matches=0; |
my (%classlist) = &getclasslist($cdom,$cnum,$chome,'0'); |
my (%classlist) = &getclasslist($cdom,$cnum,'0'); |
foreach my $student ( sort(@{ $classlist{'allids'} }) ) { |
foreach my $student ( sort(@{ $classlist{'allids'} }) ) { |
my ($uname,$udom)=split(/\:/,$student); |
my ($uname,$udom)=split(/\:/,$student); |
if ($receipt eq |
if ($receipt eq |
Line 91 sub verifyreceipt {
|
Line 90 sub verifyreceipt {
|
|
|
sub listStudents { |
sub listStudents { |
my ($request) = shift; |
my ($request) = shift; |
my $chome=$ENV{"course.$ENV{'request.course.id'}.home"}; |
|
my $cdom=$ENV{"course.$ENV{'request.course.id'}.domain"}; |
my $cdom=$ENV{"course.$ENV{'request.course.id'}.domain"}; |
my $cnum=$ENV{"course.$ENV{'request.course.id'}.num"}; |
my $cnum=$ENV{"course.$ENV{'request.course.id'}.num"}; |
my $hostver=unpack("%32C*",$Apache::lonnet::perlvar{'lonHostID'}); |
my $hostver=unpack("%32C*",$Apache::lonnet::perlvar{'lonHostID'}); |
Line 116 ENDHEADER
|
Line 114 ENDHEADER
|
<table border="1"> |
<table border="1"> |
<tr><th>Username</th><th>Domain</th><th>Name</th><th> </th></tr> |
<tr><th>Username</th><th>Domain</th><th>Name</th><th> </th></tr> |
ENDTABLEST |
ENDTABLEST |
my (%classlist) = &getclasslist($cdom,$cnum,$chome,'0'); |
my (%classlist) = &getclasslist($cdom,$cnum,'0'); |
foreach my $student ( sort(@{ $classlist{'allids'} }) ) { |
foreach my $student ( sort(@{ $classlist{'allids'} }) ) { |
my ($sname,$sdom) = split(/:/,$student); |
my ($sname,$sdom) = split(/:/,$student); |
|
|
Line 161 sub finduser {
|
Line 159 sub finduser {
|
if ( $Apache::grades::viewgrades eq 'F' ) { |
if ( $Apache::grades::viewgrades eq 'F' ) { |
#get classlist |
#get classlist |
my ($cdom,$cnum) = split(/_/,$ENV{'request.course.id'}); |
my ($cdom,$cnum) = split(/_/,$ENV{'request.course.id'}); |
my $chome=$ENV{"course.$ENV{'request.course.id'}.home"}; |
#print "Found $cdom:$cnum<br />"; |
#print "Found $cdom:$cnum:$chome<br />"; |
my (%classlist) = &getclasslist($cdom,$cnum,'0'); |
my (%classlist) = &getclasslist($cdom,$cnum,$chome,'0'); |
|
foreach my $student ( sort(@{ $classlist{'allids'} }) ) { |
foreach my $student ( sort(@{ $classlist{'allids'} }) ) { |
my ($posname,$posdomain) = split(/:/,$student); |
my ($posname,$posdomain) = split(/:/,$student); |
if ($posname =~ $name) { $name=$posname; $domain=$posdomain; last; } |
if ($posname =~ $name) { $name=$posname; $domain=$posdomain; last; } |
Line 175 sub finduser {
|
Line 172 sub finduser {
|
} |
} |
|
|
sub getclasslist { |
sub getclasslist { |
my ($coursedomain,$coursenum,$coursehome,$hideexpired) = @_; |
my ($coursedomain,$coursenum,$hideexpired) = @_; |
my $classlist=&Apache::lonnet::reply("dump:$coursedomain:$coursenum:classlist",$coursehome); |
my %classlist=&Apache::lonnet::dump('classlist',$coursedomain,$coursenum); |
my %classlist=(); |
|
my $now = time; |
my $now = time; |
foreach my $record (split /&/, $classlist) { |
foreach my $student (keys(%classlist)) { |
my ($name,$value)=split(/=/,&Apache::lonnet::unescape($record)); |
my ($end,$start)=split(/:/,$classlist{$student}); |
my ($end,$start)=split(/:/,$value); |
|
# still a student? |
# still a student? |
if (($hideexpired) && ($end) && ($end < $now)) { |
if (($hideexpired) && ($end) && ($end < $now)) { |
#print "Skipping:$name:$end:$now<br />\n"; |
#print "Skipping:$name:$end:$now<br />\n"; |
next; |
next; |
} |
} |
#print "record=$record<br>"; |
#print "record=$record<br>"; |
push( @{ $classlist{'allids'} }, $name); |
push( @{ $classlist{'allids'} }, $student); |
} |
} |
return (%classlist); |
return (%classlist); |
} |
} |
Line 337 sub viewgrades {
|
Line 332 sub viewgrades {
|
|
|
#get classlist |
#get classlist |
my ($cdom,$cnum) = split(/_/,$ENV{'request.course.id'}); |
my ($cdom,$cnum) = split(/_/,$ENV{'request.course.id'}); |
my $chome=$ENV{"course.$ENV{'request.course.id'}.home"}; |
#print "Found $cdom:$cnum<br />"; |
#print "Found $cdom:$cnum:$chome<br />"; |
my (%classlist) = &getclasslist($cdom,$cnum,'0'); |
my (%classlist) = &getclasslist($cdom,$cnum,$chome,'0'); |
|
my $headerclr = '"#ccffff"'; |
my $headerclr = '"#ccffff"'; |
my $cellclr = '"#ffffcc"'; |
my $cellclr = '"#ffffcc"'; |
|
|
Line 381 sub editgrades {
|
Line 375 sub editgrades {
|
my $url=$ENV{'form.url'}; |
my $url=$ENV{'form.url'}; |
#get classlist |
#get classlist |
my ($cdom,$cnum) = split(/_/,$ENV{'request.course.id'}); |
my ($cdom,$cnum) = split(/_/,$ENV{'request.course.id'}); |
my $chome=$ENV{"course.$ENV{'request.course.id'}.home"}; |
#print "Found $cdom:$cnum<br />"; |
#print "Found $cdom:$cnum:$chome<br />"; |
my (%classlist) = &getclasslist($cdom,$cnum,'0'); |
my (%classlist) = &getclasslist($cdom,$cnum,$chome,'0'); |
|
|
|
#get list of parts for this problem |
#get list of parts for this problem |
my (@parts) = &getpartlist($url); |
my (@parts) = &getpartlist($url); |