version 1.204, 2005/04/07 06:56:21
|
version 1.210, 2005/06/04 07:47:51
|
Line 87 sub get_target {
|
Line 87 sub get_target {
|
&& ($Apache::lonhomework::viewgrades eq 'F' )) { |
&& ($Apache::lonhomework::viewgrades eq 'F' )) { |
return ($env{'form.grade_target'}); |
return ($env{'form.grade_target'}); |
} |
} |
|
if ($env{'form.webgrade'} && |
|
$Apache::lonhomework::modifygrades eq 'F') { |
|
return ('grade','webgrade'); |
|
} |
if ( defined($env{'form.submitted'}) && |
if ( defined($env{'form.submitted'}) && |
( !defined($env{'form.resetdata'})) && |
( !defined($env{'form.resetdata'})) && |
( !defined($env{'form.newrandomization'}))) { |
( !defined($env{'form.newrandomization'}))) { |
Line 163 sub send_footer {
|
Line 166 sub send_footer {
|
} |
} |
|
|
sub proctor_checked_in { |
sub proctor_checked_in { |
my ($slot)=@_; |
my ($slot_name,$slot)=@_; |
my @allowed=split(",",$slot->{'proctor'}); |
my @allowed=split(",",$slot->{'proctor'}); |
|
my $version=$Apache::lonhomework::history{'resource.version'}; |
foreach my $possible (@allowed) { |
foreach my $possible (@allowed) { |
if ($Apache::lonhomework::history{'resource.checkedin'} eq $possible) { |
if ($Apache::lonhomework::history{"resource.$version.checkedin"} eq |
|
$possible && |
|
$Apache::lonhomework::history{"resource.$version.checkedin.slot"} |
|
eq $slot_name) { |
return 1; |
return 1; |
} |
} |
} |
} |
Line 221 sub check_ip_acc {
|
Line 228 sub check_ip_acc {
|
} |
} |
|
|
sub check_task_access { |
sub check_task_access { |
#does it pass normal muster |
# does it pass normal muster |
|
# yes we really do want the default args passing |
my ($status,$datemsg)=&check_access; |
my ($status,$datemsg)=&check_access; |
if ($status eq 'SHOW_ANSWER' || |
if ($status eq 'SHOW_ANSWER' || |
$status eq 'CLOSED' || |
$status eq 'CLOSED' || |
Line 233 sub check_task_access {
|
Line 241 sub check_task_access {
|
if ($env{'request.state'} eq "construct") { |
if ($env{'request.state'} eq "construct") { |
return ($status,$datemsg); |
return ($status,$datemsg); |
} |
} |
|
my $version=$Apache::lonhomework::history{'resource.version'}; |
|
if ($Apache::lonhomework::history{"resource.$version.checkedin"} && |
|
$Apache::lonhomework::history{"resource.$version.status"} eq 'pass') { |
|
return ('SHOW_ANSWER'); |
|
} |
my ($id)=@_; |
my ($id)=@_; |
my @slots=split(':',&Apache::lonnet::EXT("resource.$id.available")); |
my @slots= |
|
(split(':',&Apache::lonnet::EXT("resource.$id.availablestudent")), |
|
split(':',&Apache::lonnet::EXT("resource.$id.available"))); |
|
|
# if (!@slots) { |
# if (!@slots) { |
# return ($status,$datemsg); |
# return ($status,$datemsg); |
# } |
# } |
my $slotstatus='NOT_IN_A_SLOT'; |
my $slotstatus='NOT_IN_A_SLOT'; |
my $returned_slot; |
my ($returned_slot,$slot_name); |
foreach my $slot (@slots) { |
foreach my $slot (@slots) { |
&Apache::lonxml::debug("getting $slot"); |
&Apache::lonxml::debug("getting $slot"); |
my %slot=&Apache::lonnet::get_slot($slot); |
my %slot=&Apache::lonnet::get_slot($slot); |
Line 251 sub check_task_access {
|
Line 266 sub check_task_access {
|
&Apache::lonxml::debug("$slot is good"); |
&Apache::lonxml::debug("$slot is good"); |
$slotstatus='NEEDS_CHECKIN'; |
$slotstatus='NEEDS_CHECKIN'; |
$returned_slot=\%slot; |
$returned_slot=\%slot; |
|
$slot_name=$slot; |
last; |
last; |
} |
} |
} |
} |
if ($slotstatus eq 'NEEDS_CHECKIN' && |
if ($slotstatus eq 'NEEDS_CHECKIN' && |
&proctor_checked_in($returned_slot)) { |
&proctor_checked_in($slot_name,$returned_slot)) { |
&Apache::lonxml::debug("protoctor checked in"); |
&Apache::lonxml::debug("protoctor checked in"); |
$slotstatus='CAN_ANSWER'; |
$slotstatus='CAN_ANSWER'; |
} |
} |
return ($slotstatus,$datemsg,$returned_slot); |
if ( $slotstatus eq 'NOT_IN_A_SLOT' && |
|
$Apache::lonhomework::history{"resource.$version.checkedin"}) { |
|
if ($Apache::lonhomework::history{"resource.$version.status"} eq 'fail') { |
|
return ('SHOW_ANSWER'); |
|
} else { |
|
return ('WAITING_FOR_GRADE'); |
|
} |
|
} |
|
return ($slotstatus,$datemsg,$slot_name,$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 |
Line 479 sub setuppermissions {
|
Line 503 sub setuppermissions {
|
&Apache::lonnet::devalidatecourseresdata($env{"course.$courseid.num"}, |
&Apache::lonnet::devalidatecourseresdata($env{"course.$courseid.num"}, |
$env{"course.$courseid.domain"}); |
$env{"course.$courseid.domain"}); |
} |
} |
return '' |
my $modifygrades = &Apache::lonnet::allowed('mgr',$env{'request.course.id'}); |
|
if (! $modifygrades && |
|
exists($env{'request.course.sec'}) && |
|
$env{'request.course.sec'} !~ /^\s*$/) { |
|
$modifygrades = |
|
&Apache::lonnet::allowed('mgr',$env{'request.course.id'}. |
|
'/'.$env{'request.course.sec'}); |
|
} |
|
$Apache::lonhomework::modifygrades = $modifygrades; |
|
return ''; |
} |
} |
|
|
sub setupheader { |
sub setupheader { |