version 1.284, 2007/11/13 23:26:08
|
version 1.286, 2007/11/20 17:53:22
|
Line 494 sub check_access {
|
Line 494 sub check_access {
|
$Apache::lonhomework::history{"resource.$id.solved"}=~/^excused/) { |
$Apache::lonhomework::history{"resource.$id.solved"}=~/^excused/) { |
$status = 'CANNOT_ANSWER'; |
$status = 'CANNOT_ANSWER'; |
} |
} |
|
if ($status eq 'CANNOT_ANSWER' |
|
&& &show_answer_problem_status()) { |
|
$status = 'SHOW_ANSWER'; |
|
} |
} |
} |
if ($status eq 'CAN_ANSWER' || $status eq 'CANNOT_ANSWER') { |
if ($status eq 'CAN_ANSWER' || $status eq 'CANNOT_ANSWER') { |
my $interval=&Apache::lonnet::EXT("resource.$id.interval"); |
my @interval=&Apache::lonnet::EXT("resource.$id.interval"); |
&Apache::lonxml::debug("looking for interval $interval"); |
&Apache::lonxml::debug("looking for interval @interval"); |
if ($interval) { |
if ($interval[0]) { |
my $first_access=&Apache::lonnet::get_first_access('map'); |
my $first_access=&Apache::lonnet::get_first_access($interval[1]); |
&Apache::lonxml::debug("looking for accesstime $first_access"); |
&Apache::lonxml::debug("looking for accesstime $first_access"); |
if (!$first_access) { |
if (!$first_access) { |
$status='NOT_YET_VIEWED'; |
$status='NOT_YET_VIEWED'; |
my $due_date = &due_date($id); |
my $due_date = &due_date($id); |
my $seconds_left = $due_date - time; |
my $seconds_left = $due_date - time; |
if ($seconds_left > $interval || $due_date eq '') { |
if ($seconds_left > $interval[0] || $due_date eq '') { |
$seconds_left = $interval; |
$seconds_left = $interval[0]; |
} |
} |
$datemsg=&seconds_to_human_length($seconds_left); |
$datemsg=&seconds_to_human_length($seconds_left); |
} |
} |
Line 532 sub check_access {
|
Line 536 sub check_access {
|
sub due_date { |
sub due_date { |
my ($part_id,$symb,$udom,$uname)=@_; |
my ($part_id,$symb,$udom,$uname)=@_; |
my $date; |
my $date; |
my $interval= &Apache::lonnet::EXT("resource.$part_id.interval",$symb, |
my @interval= &Apache::lonnet::EXT("resource.$part_id.interval",$symb, |
$udom,$uname); |
$udom,$uname); |
&Apache::lonxml::debug("looking for interval $part_id $symb $interval"); |
&Apache::lonxml::debug("looking for interval $part_id $symb @interval"); |
my $due_date= &Apache::lonnet::EXT("resource.$part_id.duedate",$symb, |
my $due_date= &Apache::lonnet::EXT("resource.$part_id.duedate",$symb, |
$udom,$uname); |
$udom,$uname); |
&Apache::lonxml::debug("looking for due_date $part_id $symb $due_date"); |
&Apache::lonxml::debug("looking for due_date $part_id $symb $due_date"); |
if ($interval =~ /\d+/) { |
if ($interval[0] =~ /\d+/) { |
my $first_access=&Apache::lonnet::get_first_access('map',$symb); |
my $first_access=&Apache::lonnet::get_first_access($interval[1],$symb); |
&Apache::lonxml::debug("looking for first_access $first_access"); |
&Apache::lonxml::debug("looking for first_access $first_access ($interval[1])"); |
if (defined($first_access)) { |
if (defined($first_access)) { |
$interval = $first_access+$interval; |
my $interval = $first_access+$interval[0]; |
$date = (!$due_date || $interval < $due_date) ? $interval |
$date = (!$due_date || $interval < $due_date) ? $interval |
: $due_date; |
: $due_date; |
} else { |
} else { |
Line 883 sub analyze {
|
Line 887 sub analyze {
|
|
|
sub show_problem_status { |
sub show_problem_status { |
return ($show_problem_status eq 'yes' |
return ($show_problem_status eq 'yes' |
|
|| $show_problem_status eq 'answer' |
|| $show_problem_status eq ''); |
|| $show_problem_status eq ''); |
} |
} |
|
|
Line 893 sub analyze {
|
Line 898 sub analyze {
|
sub show_no_problem_status { |
sub show_no_problem_status { |
return ($show_problem_status eq 'no_feedback_ever'); |
return ($show_problem_status eq 'no_feedback_ever'); |
} |
} |
|
|
|
sub show_answer_problem_status { |
|
return ($show_problem_status eq 'answer'); |
|
} |
} |
} |
|
|
sub editxmlmode { |
sub editxmlmode { |