version 1.9, 2005/08/15 19:55:37
|
version 1.12, 2005/09/06 21:31:03
|
Line 456 sub show_table {
|
Line 456 sub show_table {
|
my ($cnum,$cdom)=&get_course(); |
my ($cnum,$cdom)=&get_course(); |
my %slots=&Apache::lonnet::dump('slots',$cdom,$cnum); |
my %slots=&Apache::lonnet::dump('slots',$cdom,$cnum); |
my $available; |
my $available; |
$r->print('<table border="1">'); |
$r->print('<table border="1"> |
|
<tr> |
|
<th>Slot name</th> |
|
<th>Type</th> |
|
<th>Description</th> |
|
<th>Start Time</th> |
|
<th>End Time</th> |
|
<th>Max space</th> |
|
<th>Scheduled Students</th> |
|
<th>Proctors</th> |
|
<th>Unique Period</th> |
|
</tr>'); |
foreach my $slot (sort |
foreach my $slot (sort |
{ return $slots{$a}->{'starttime'} <=> $slots{$b}->{'starttime'} } |
{ return $slots{$a}->{'starttime'} <=> $slots{$b}->{'starttime'} } |
(keys(%slots))) { |
(keys(%slots))) { |
Line 477 sub show_table {
|
Line 488 sub show_table {
|
$r->print(<<STUFF); |
$r->print(<<STUFF); |
<tr> |
<tr> |
<td>$slot</td> |
<td>$slot</td> |
|
<td>$slots{$slot}->{'type'}</td> |
<td>$description</td> |
<td>$description</td> |
<td>$start</td> |
<td>$start</td> |
<td>$end</td> |
<td>$end</td> |
<td>$slots{$slot}->{'maxspace'}</td> |
<td>$slots{$slot}->{'maxspace'}</td> |
<td>$ids</td> |
<td>$ids</td> |
|
<td>$slots{$slot}->{'proctor'}</td> |
|
<td>$slots{$slot}->{'uniqueperiod'}</td> |
</tr> |
</tr> |
STUFF |
STUFF |
} |
} |
Line 500 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; |