version 1.18, 2000/12/04 22:08:57
|
version 1.20, 2000/12/12 22:35:52
|
Line 52 sub send_footer {
|
Line 52 sub send_footer {
|
$request->print(&Apache::lontexconvert::footer()); |
$request->print(&Apache::lontexconvert::footer()); |
} |
} |
|
|
|
sub check_date { |
|
my ($type,$id) = @_; |
|
my $date =''; |
|
my $passed = ''; |
|
&Apache::lonxml::debug("checking :$type: for part :$id:"); |
|
if ($type eq 'OPEN_DATE') { |
|
$date = &Apache::lonnet::EXT("resource.$id.opendate"); |
|
} elsif ($type eq 'DUE_DATE') { |
|
$date = &Apache::lonnet::EXT("resource.$id.duedate"); |
|
} elsif ($type eq 'START_DATE') { |
|
$date = &Apache::lonnet::EXT("resource.$id.duedate"); |
|
} else { |
|
&Apache::lonxml::error("Unknown date request $type"); |
|
$date = ''; |
|
} |
|
&Apache::lonxml::debug("found :$date:"); |
|
if ($date eq '') { |
|
$date = "an unknown date"; $passed = 0; |
|
} else { |
|
if (time < $date) { $passed = 0; } else { $passed = 1; } |
|
$date = localtime $date; |
|
} |
|
&Apache::lonxml::debug("sending back :$date:$passed:"); |
|
return ($date,$passed); |
|
} |
|
|
sub handler { |
sub handler { |
my $request=$_[0]; |
my $request=$_[0]; |
|
|
$Apache::lonxml::debug=1; |
if ( $ENV{'user.name'} eq 'albertel' ) { $Apache::lonxml::debug=1; } |
|
|
my (@targets) = &get_target(); |
my (@targets) = &get_target(); |
|
|
Line 69 sub handler {
|
Line 95 sub handler {
|
|
|
&Apache::lonhomework::send_header($request); |
&Apache::lonhomework::send_header($request); |
|
|
|
#check if allowed to see |
|
|
foreach my $target (@targets) { |
foreach my $target (@targets) { |
my $file=&Apache::lonnet::filelocation("",$request->uri); |
my $file=&Apache::lonnet::filelocation("",$request->uri); |
my $problem=&Apache::lonnet::getfile($file); |
my $problem=&Apache::lonnet::getfile($file); |
Line 85 sub handler {
|
Line 113 sub handler {
|
#ignore error conditions |
#ignore error conditions |
my ($temp)=keys %Apache::lonhomework::history ; |
my ($temp)=keys %Apache::lonhomework::history ; |
if ($temp =~ m/^error:.*/) { %Apache::lonhomework::history=(); } |
if ($temp =~ m/^error:.*/) { %Apache::lonhomework::history=(); } |
|
if ($target eq 'web' && &Apache::lonnet::symbread() eq '') { |
|
$request->print("Vieiwing this problem as not a student, submissions will be ignored."); |
|
} |
if ($target eq 'grade') { |
if ($target eq 'grade') { |
my $resultkey; |
my $resultkey; |
foreach $resultkey (sort keys %Apache::lonhomework::history) { |
foreach $resultkey (sort keys %Apache::lonhomework::history) { |