version 1.460, 2011/05/22 14:55:30
|
version 1.462, 2011/07/18 11:56:23
|
Line 509 my %statusIconMap =
|
Line 509 my %statusIconMap =
|
my %iconAltTags = #texthash does not work here |
my %iconAltTags = #texthash does not work here |
( 'navmap.correct.gif' => 'Correct', |
( 'navmap.correct.gif' => 'Correct', |
'navmap.wrong.gif' => 'Incorrect', |
'navmap.wrong.gif' => 'Incorrect', |
'navmap.open.gif' => 'Open', |
'navmap.open.gif' => 'Is Open', |
'navmap.partial.gif' => 'Partially Correct', |
'navmap.partial.gif' => 'Partially Correct', |
'navmap.ellipsis.gif' => 'Attempted', |
'navmap.ellipsis.gif' => 'Attempted', |
); |
); |
Line 612 sub getDescription {
|
Line 612 sub getDescription {
|
return &Apache::lonhtmlcommon::direct_parm_link(&mt("Not currently assigned.",$res->symb(),'opendate'),$part); |
return &Apache::lonhtmlcommon::direct_parm_link(&mt("Not currently assigned.",$res->symb(),'opendate'),$part); |
} |
} |
if ($status == $res->OPEN_LATER) { |
if ($status == $res->OPEN_LATER) { |
return &mt("Open ") .&Apache::lonhtmlcommon::direct_parm_link(&timeToHumanString($open,'start'),$res->symb(),'opendate',$part); |
return &mt("Open [_1]",&Apache::lonhtmlcommon::direct_parm_link(&timeToHumanString($open,'start')),$res->symb(),'opendate',$part); |
} |
} |
if ($res->simpleStatus($part) == $res->OPEN) { |
if ($res->simpleStatus($part) == $res->OPEN) { |
unless (&Apache::lonnet::allowed('mgr',$env{'request.course.id'})) { |
unless (&Apache::lonnet::allowed('mgr',$env{'request.course.id'})) { |
Line 646 sub getDescription {
|
Line 646 sub getDescription {
|
if ($status == $res->OPEN) { |
if ($status == $res->OPEN) { |
if ($due) { |
if ($due) { |
if ($res->is_practice()) { |
if ($res->is_practice()) { |
return &mt("Closes ")." " .&Apache::lonhtmlcommon::direct_parm_link(&timeToHumanString($due,'start'),$res->symb(),'duedate',$part); |
return &mt("Closes [_1]",&Apache::lonhtmlcommon::direct_parm_link(&timeToHumanString($due,'start')),$res->symb(),'duedate',$part); |
} else { |
} else { |
return &mt("Due")." " .&Apache::lonhtmlcommon::direct_parm_link(&timeToHumanString($due,'end'),$res->symb(),'duedate',$part); |
return &mt("Due [_1]",&Apache::lonhtmlcommon::direct_parm_link(&timeToHumanString($due,'end')),$res->symb(),'duedate',$part); |
} |
} |
} else { |
} else { |
return &Apache::lonhtmlcommon::direct_parm_link(&mt("Open, no due date"),$res->symb(),'duedate',$part); |
return &Apache::lonhtmlcommon::direct_parm_link(&mt("Open, no due date"),$res->symb(),'duedate',$part); |
} |
} |
} |
} |
if ($status == $res->PAST_DUE_ANSWER_LATER) { |
if ($status == $res->PAST_DUE_ANSWER_LATER) { |
return &mt("Answer open")." " .&Apache::lonhtmlcommon::direct_parm_link(&timeToHumanString($answer,'start'),$res->symb(),'answerdate',$part); |
return &mt("Answer open [_1]",&Apache::lonhtmlcommon::direct_parm_link(&timeToHumanString($answer,'start')),$res->symb(),'answerdate',$part); |
} |
} |
if ($status == $res->PAST_DUE_NO_ANSWER) { |
if ($status == $res->PAST_DUE_NO_ANSWER) { |
if ($res->is_practice()) { |
if ($res->is_practice()) { |
return &mt("Closed")." " . &Apache::lonhtmlcommon::direct_parm_link(&timeToHumanString($due,'start'),$res->symb(),'answerdate,duedate',$part); |
return &mt("Closed [_1]",&Apache::lonhtmlcommon::direct_parm_link(&timeToHumanString($due,'start')),$res->symb(),'answerdate,duedate',$part); |
} else { |
} else { |
return &mt("Was due")." " .&Apache::lonhtmlcommon::direct_parm_link(&timeToHumanString($due,'end'),$res->symb(),'answerdate,duedate',$part); |
return &mt("Was due [_1]",&Apache::lonhtmlcommon::direct_parm_link(&timeToHumanString($due,'end')),$res->symb(),'answerdate,duedate',$part); |
} |
} |
} |
} |
if (($status == $res->ANSWER_OPEN || $status == $res->PARTIALLY_CORRECT) |
if (($status == $res->ANSWER_OPEN || $status == $res->PARTIALLY_CORRECT) |
Line 694 sub getDescription {
|
Line 694 sub getDescription {
|
} |
} |
} |
} |
if ($due) { |
if ($due) { |
return &mt("Due")." " . &Apache::lonhtmlcommon::direct_parm_link(&timeToHumanString($due,'end'),$res->symb(),'duedate',$part) . |
return &mt("Due [_1]",&Apache::lonhtmlcommon::direct_parm_link(&timeToHumanString($due,'end')),$res->symb(),'duedate',$part) . |
" $triesString"; |
" $triesString"; |
} else { |
} else { |
return &Apache::lonhtmlcommon::direct_parm_link(&mt("No due date"),$res->symb(),'duedate',$part)." $triesString"; |
return &Apache::lonhtmlcommon::direct_parm_link(&mt("No due date"),$res->symb(),'duedate',$part)." $triesString"; |
Line 3993 Get the weight for the problem.
|
Line 3993 Get the weight for the problem.
|
|
|
sub printable { |
sub printable { |
|
|
&Apache::lonnet::logthis("Printable"); |
|
my ($self, $part) = @_; |
my ($self, $part) = @_; |
|
|
# Get the print open/close dates for the resource. |
# Get the print open/close dates for the resource. |
Line 4008 sub printable {
|
Line 4007 sub printable {
|
# - both defined: printable if start <= now <= end |
# - both defined: printable if start <= now <= end |
# |
# |
my $now = time(); |
my $now = time(); |
&Apache::lonnet::logthis("now: $now, Opens at $start Closes at $end"); |
|
|
|
my $startok = 1; |
my $startok = 1; |
my $endok = 1; |
my $endok = 1; |
|
|
if ((defined $start) && ($start ne '')) { |
if ((defined $start) && ($start ne '')) { |
&Apache::lonnet::logthis("checking start time."); |
|
$startok = $start <= $now; |
$startok = $start <= $now; |
if (!$startok) { |
|
&Apache::lonnet::logthis("Start date is after now"); |
|
} |
|
} |
} |
if ((defined $end) && ($end != '')) { |
if ((defined $end) && ($end != '')) { |
&Apache::lonnet::logthis("checkin end time"); |
|
$endok = $end >= $now; |
$endok = $end >= $now; |
if (!$endok) { |
|
&Apache::lonnet::logthis("End date is prior to now"); |
|
} |
|
} |
} |
if (!($startok && $endok)) { |
|
&Apache::lonnet::logthis("Resource not printable due to open/close date"); |
|
} |
|
return $startok && $endok; |
return $startok && $endok; |
} |
} |
|
|
Line 4042 sub resprintable {
|
Line 4029 sub resprintable {
|
my @parts = @$partsref; |
my @parts = @$partsref; |
|
|
if ((!defined(@parts)) || (scalar(@parts) == 0)) { |
if ((!defined(@parts)) || (scalar(@parts) == 0)) { |
&Apache::lonnet::logthis("resprintable - no parts trying part 0"); |
|
return $self->printable(0); |
return $self->printable(0); |
} else { |
} else { |
&Apache::lonnet::logthis("resprintable - have " . scalar(@parts) . " parts require all to be good"); |
|
foreach my $part (@parts) { |
foreach my $part (@parts) { |
if (!$self->printable($part)) { |
if (!$self->printable($part)) { |
&Apache::lonnet::logthis("resprintable - one of the parts failed date check"); |
|
return 0; |
return 0; |
} |
} |
} |
} |
&Apache::lonnet::logthis("resprintable - All parts passed date check"); |
|
return 1; |
return 1; |
} |
} |
&Apache::lonnet::logthis("resprintable - should not have gotten here?"); |
|
} |
} |
|
|
sub acc { |
sub acc { |