version 1.10, 2005/09/06 20:53:36
|
version 1.13, 2005/09/09 18:27:56
|
Line 473 sub show_table {
|
Line 473 sub show_table {
|
(keys(%slots))) { |
(keys(%slots))) { |
if (defined($slots{$slot}->{'type'}) |
if (defined($slots{$slot}->{'type'}) |
&& $slots{$slot}->{'type'} ne 'schedulable_student') { |
&& $slots{$slot}->{'type'} ne 'schedulable_student') { |
next; |
#next; |
} |
} |
my $description=&get_description($slot,$slots{$slot}); |
my $description=&get_description($slot,$slots{$slot}); |
my %consumed=&Apache::lonnet::dump('slot_reservations',$cdom,$cnum, |
my %consumed=&Apache::lonnet::dump('slot_reservations',$cdom,$cnum, |
Line 514 sub handler {
|
Line 514 sub handler {
|
return OK; |
return OK; |
} |
} |
$env{'request.symb'}=$symb; |
$env{'request.symb'}=$symb; |
my ($status) = &Apache::lonhomework::check_task_access('0'); |
|
if ($status eq 'CAN_ANSWER' || |
|
$status eq 'NEEDS_CHECKIN' || |
|
$status eq 'WAITING_FOR_GRADE') { |
|
&fail($r,'not_allowed'); |
|
return OK; |
|
} |
|
my $vgr=&Apache::lonnet::allowed('vgr',$env{'request.course.id'}); |
my $vgr=&Apache::lonnet::allowed('vgr',$env{'request.course.id'}); |
if ($env{'form.command'} eq 'showslots' && $vgr eq 'F') { |
if ($env{'form.command'} eq 'showslots' && $vgr eq 'F') { |
&show_table($r,$symb); |
&show_table($r,$symb); |
} elsif ($env{'form.requestattempt'}) { |
|
&show_choices($r,$symb); |
|
} elsif ($env{'form.command'} eq 'release') { |
|
&release_slot($r,$symb); |
|
} elsif ($env{'form.command'} eq 'get') { |
|
&get_slot($r,$symb); |
|
} elsif ($env{'form.command'} eq 'change') { |
|
&release_slot($r,$symb,$env{'form.releaseslot'},1); |
|
&get_slot($r,$symb); |
|
} else { |
} else { |
$r->print("<p>Unknown command: ".$env{'form.command'}."</p>"); |
my ($status) = &Apache::lonhomework::check_task_access('0'); |
|
if ($status eq 'CAN_ANSWER' || |
|
$status eq 'NEEDS_CHECKIN' || |
|
$status eq 'WAITING_FOR_GRADE') { |
|
&fail($r,'not_allowed'); |
|
return OK; |
|
} |
|
if ($env{'form.requestattempt'}) { |
|
&show_choices($r,$symb); |
|
} elsif ($env{'form.command'} eq 'release') { |
|
&release_slot($r,$symb); |
|
} elsif ($env{'form.command'} eq 'get') { |
|
&get_slot($r,$symb); |
|
} elsif ($env{'form.command'} eq 'change') { |
|
&release_slot($r,$symb,$env{'form.releaseslot'},1); |
|
&get_slot($r,$symb); |
|
} else { |
|
$r->print("<p>Unknown command: ".$env{'form.command'}."</p>"); |
|
} |
} |
} |
&end_page($r); |
&end_page($r); |
return OK; |
return OK; |