version 1.459, 2011/05/18 11:26:44
|
version 1.463, 2011/09/15 01:06:41
|
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 1090 sub render_long_status {
|
Line 1090 sub render_long_status {
|
} |
} |
} |
} |
|
|
if (($resource->kind() eq "res" && |
if ($resource->kind() eq "res" && |
($resource->is_problem() || $resource->is_practice()) && |
$resource->is_raw_problem() && |
!$firstDisplayed) && |
!$firstDisplayed) { |
$resource->is_raw_problem()) { |
|
if ($color) {$result .= "<font color=\"$color\"><b>"; } |
if ($color) {$result .= "<font color=\"$color\"><b>"; } |
$result .= getDescription($resource, $part); |
$result .= getDescription($resource, $part); |
if ($color) {$result .= "</b></font>"; } |
if ($color) {$result .= "</b></font>"; } |
Line 2414 sub parmval {
|
Line 2413 sub parmval {
|
} |
} |
} |
} |
my $result = $self->parmval_real($what, $symb, $recurse); |
my $result = $self->parmval_real($what, $symb, $recurse); |
my $dumper = Data::Dumper->new([$result]); |
|
$self->{PARM_CACHE}->{$hashkey} = $result; |
$self->{PARM_CACHE}->{$hashkey} = $result; |
if (wantarray) { |
if (wantarray) { |
return @{$result}; |
return @{$result}; |
Line 3994 Get the weight for the problem.
|
Line 3992 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. |
|
|
my $start = $self->parmval("printopendate", $part); |
my $start = $self->parmval("prinstartdate", $part); |
my $end = $self->parmval("printclosedate", $part); |
my $end = $self->parmval("printenddate", $part); |
my $dumper = Data::Dumper->new([$self, $part, $start, $end]); |
|
&Apache::lonnet::logthis("Start for " . $dumper->Dump); |
|
|
|
# The following cases apply: |
# The following cases apply: |
# - No dates set: Printable. |
# - No dates set: Printable. |
Line 4015 sub printable {
|
Line 4010 sub printable {
|
my $startok = 1; |
my $startok = 1; |
my $endok = 1; |
my $endok = 1; |
|
|
if ($start ne '') { |
if ((defined $start) && ($start ne '')) { |
$startok = $start <= $now; |
$startok = $start <= $now; |
} |
} |
if ($end ne '') { |
if ((defined $end) && ($end != '')) { |
$endok = $end >= $now; |
$endok = $end >= $now; |
} |
} |
return $startok && $endok; |
return $startok && $endok; |
Line 4029 sub resprintable {
|
Line 4024 sub resprintable {
|
|
|
# get parts...or realize there are no parts. |
# get parts...or realize there are no parts. |
|
|
my $parts = $self->parts(); |
my $partsref = $self->parts(); |
if ($parts == 0) { |
my @parts = @$partsref; |
|
|
|
if ((!defined(@parts)) || (scalar(@parts) == 0)) { |
return $self->printable(0); |
return $self->printable(0); |
} else { |
} else { |
foreach my $part (@$parts) { |
foreach my $part (@parts) { |
if (!$self->printable($part)) { return 0; } |
if (!$self->printable($part)) { |
|
return 0; |
|
} |
} |
} |
return 1; |
return 1; |
} |
} |