version 1.197, 2005/03/01 03:24:05
|
version 1.202, 2005/03/31 15:56:13
|
Line 162 sub send_footer {
|
Line 162 sub send_footer {
|
$request->print(&Apache::lontexconvert::footer()); |
$request->print(&Apache::lontexconvert::footer()); |
} |
} |
|
|
$Apache::lonxml::browse=''; |
sub proctor_checked_in { |
|
my ($slot)=@_; |
|
my @allowed=split(",",$slot->{'proctor'}); |
|
foreach my $possible (@allowed) { |
|
if ($Apache::lonhomework::history{'resource.checkedin'} eq $possible) { |
|
return 1; |
|
} |
|
} |
|
return 0; |
|
} |
|
|
|
$Apache::lonxml::browse=''; |
sub check_ip_acc { |
sub check_ip_acc { |
my ($acc)=@_; |
my ($acc)=@_; |
if (!defined($acc) || $acc =~ /^\s*$/) { return 1; } |
if (!defined($acc) || $acc =~ /^\s*$/) { return 1; } |
Line 209 sub check_ip_acc {
|
Line 219 sub check_ip_acc {
|
} |
} |
return $allowed; |
return $allowed; |
} |
} |
|
|
|
sub check_task_access { |
|
#does it pass normal muster |
|
my ($status,$datemsg)=&check_access; |
|
if ($status eq 'SHOW_ANSWER' || |
|
$status eq 'CLOSED' || |
|
$status eq 'CANNOT_ANSWER' || |
|
$status eq 'INVALID_ACCESS' || |
|
$status eq 'UNAVAILABLE') { |
|
return ($status,$datemsg); |
|
} |
|
|
|
|
|
my ($id)=@_; |
|
my @slots=split(':',&Apache::lonnet::EXT("resource.$id.available")); |
|
# if (!@slots) { |
|
# return ($status,$datemsg); |
|
# } |
|
my $slotstatus='NOT_IN_A_SLOT'; |
|
my $returned_slot; |
|
foreach my $slot (@slots) { |
|
&Apache::lonxml::debug("getting $slot"); |
|
my %slot=&Apache::lonnet::get_slot($slot); |
|
&Apache::lonhomework::showhash(%slot); |
|
if ($slot{'starttime'} < time && |
|
$slot{'endtime'} > time && |
|
&check_ip_acc($slot{'ip'})) { |
|
&Apache::lonxml::debug("$slot is good"); |
|
$slotstatus='NEEDS_CHECKIN'; |
|
$returned_slot=\%slot; |
|
last; |
|
} |
|
} |
|
if ($slotstatus eq 'NEEDS_CHECKIN' && |
|
&proctor_checked_in($returned_slot)) { |
|
&Apache::lonxml::debug("protoctor checked in"); |
|
$slotstatus='CAN_ANSWER'; |
|
} |
|
return ($slotstatus,$datemsg,$returned_slot); |
|
} |
|
|
# JB, 9/24/2002: Any changes in this function may require a change |
# JB, 9/24/2002: Any changes in this function may require a change |
# in lonnavmaps::resource::getDateStatus. |
# in lonnavmaps::resource::getDateStatus. |
sub check_access { |
sub check_access { |
Line 634 sub editxmlmode {
|
Line 685 sub editxmlmode {
|
<input type="submit" name="Undo" accesskey="u" value="'.&mt('undo').'" /> |
<input type="submit" name="Undo" accesskey="u" value="'.&mt('undo').'" /> |
<hr /> |
<hr /> |
' . $xml_help . ' |
' . $xml_help . ' |
<textarea rows="'.$rows.'" cols="'.$cols.'" name="editxmltext">'. |
<textarea style="width:100%" rows="'.$rows.'" cols="'.$cols.'" name="editxmltext">'. |
&HTML::Entities::encode($problem,'<>&"').'</textarea> |
&HTML::Entities::encode($problem,'<>&"').'</textarea> |
</form></body></html>'; |
</form></body></html>'; |
&Apache::lonxml::add_messages(\$result); |
&Apache::lonxml::add_messages(\$result); |