version 1.135, 2003/02/04 16:28:50
|
version 1.138, 2003/02/06 21:26:21
|
Line 77 my %iconAltTags =
|
Line 77 my %iconAltTags =
|
'navmap.wrong.gif' => 'Incorrect', |
'navmap.wrong.gif' => 'Incorrect', |
'navmap.open.gif' => 'Open' ); |
'navmap.open.gif' => 'Open' ); |
|
|
|
# Defines a status->color mapping, null string means don't color |
|
my %colormap = |
|
( Apache::lonnavmaps::resource->NETWORK_FAILURE => '', |
|
Apache::lonnavmaps::resource->CORRECT => '', |
|
Apache::lonnavmaps::resource->EXCUSED => '#3333FF', |
|
Apache::lonnavmaps::resource->PAST_DUE_ANSWER_LATER => '', |
|
Apache::lonnavmaps::resource->PAST_DUE_NO_ANSWER => '', |
|
Apache::lonnavmaps::resource->ANSWER_OPEN => '#006600', |
|
Apache::lonnavmaps::resource->OPEN_LATER => '', |
|
Apache::lonnavmaps::resource->TRIES_LEFT => '', |
|
Apache::lonnavmaps::resource->INCORRECT => '', |
|
Apache::lonnavmaps::resource->OPEN => '', |
|
Apache::lonnavmaps::resource->NOTHING_SET => '' ); |
|
# And a special case in the nav map; what to do when the assignment |
|
# is not yet done and due in less then 24 hours |
|
my $hurryUpColor = "#FF0000"; |
|
|
sub cleanup { |
sub cleanup { |
if (tied(%navmaphash)){ |
if (tied(%navmaphash)){ |
&Apache::lonnet::logthis('Cleanup navmaps: navmaphash'); |
&Apache::lonnet::logthis('Cleanup navmaps: navmaphash'); |
Line 242 sub real_handler {
|
Line 259 sub real_handler {
|
# These are some data tables, which make it easy to change some of |
# These are some data tables, which make it easy to change some of |
# of the specific visualization parameters if desired. |
# of the specific visualization parameters if desired. |
|
|
# Defines a status->color mapping, null string means don't color |
|
my %colormap = |
|
( $res->NETWORK_FAILURE => '', |
|
$res->CORRECT => '', |
|
$res->EXCUSED => '#3333FF', |
|
$res->PAST_DUE_ANSWER_LATER => '', |
|
$res->PAST_DUE_NO_ANSWER => '', |
|
$res->ANSWER_OPEN => '#006600', |
|
$res->OPEN_LATER => '', |
|
$res->TRIES_LEFT => '', |
|
$res->INCORRECT => '', |
|
$res->OPEN => '', |
|
$res->NOTHING_SET => '' ); |
|
# And a special case in the nav map; what to do when the assignment |
|
# is not yet done and due in less then 24 hours |
|
my $hurryUpColor = "#FF0000"; |
|
|
|
my %condenseStatuses = |
my %condenseStatuses = |
( $res->NETWORK_FAILURE => 1, |
( $res->NETWORK_FAILURE => 1, |
$res->NOTHING_SET => 1, |
$res->NOTHING_SET => 1, |
Line 554 sub real_handler {
|
Line 554 sub real_handler {
|
|
|
} |
} |
|
|
my $colorizer = ""; |
|
my $color; |
my $color; |
if ($curRes->is_problem()) { |
if ($curRes->is_problem()) { |
$color = $colormap{$curRes->status}; |
$color = $colormap{$curRes->status}; |
Line 563 sub real_handler {
|
Line 562 sub real_handler {
|
lastTry($curRes, $part)) { |
lastTry($curRes, $part)) { |
$color = $hurryUpColor; |
$color = $hurryUpColor; |
} |
} |
|
|
if ($color ne "") { |
|
$colorizer = "bgcolor=\"$color\""; |
|
} |
|
} |
} |
|
|
if ($curRes->randomout()) { |
if ($curRes->randomout()) { |
Line 1060 sub long_status { return 3; }
|
Line 1055 sub long_status { return 3; }
|
|
|
# Data for render_resource |
# Data for render_resource |
|
|
my $resObj = 'Apache::lonnavmaps::resource'; |
|
# Defines a status->color mapping, null string means don't color |
|
my %colormap = |
|
( $resObj->NETWORK_FAILURE => '', |
|
$resObj->CORRECT => '', |
|
$resObj->EXCUSED => '#3333FF', |
|
$resObj->PAST_DUE_ANSWER_LATER => '', |
|
$resObj->PAST_DUE_NO_ANSWER => '', |
|
$resObj->ANSWER_OPEN => '#006600', |
|
$resObj->OPEN_LATER => '', |
|
$resObj->TRIES_LEFT => '', |
|
$resObj->INCORRECT => '', |
|
$resObj->OPEN => '', |
|
$resObj->NOTHING_SET => '' ); |
|
# And a special case in the nav map; what to do when the assignment |
|
# is not yet done and due in less then 24 hours |
|
my $hurryUpColor = "#FF0000"; |
|
|
|
sub render_resource { |
sub render_resource { |
my ($resource, $part, $params) = @_; |
my ($resource, $part, $params) = @_; |
|
|
Line 1251 sub render_quick_status {
|
Line 1228 sub render_quick_status {
|
} |
} |
sub render_long_status { |
sub render_long_status { |
my ($resource, $part, $params) = @_; |
my ($resource, $part, $params) = @_; |
return "<td align='center'>long_status</td>"; |
my $result = "<td align='right' valign='center'>\n"; |
|
my $firstDisplayed = !$params->{'condensed'} && |
|
$params->{'multipart'} && $part eq "0"; |
|
|
|
my $color; |
|
if ($resource->is_problem()) { |
|
$color = $colormap{$resource->status}; |
|
|
|
if (dueInLessThen24Hours($resource, $part) || |
|
lastTry($resource, $part)) { |
|
$color = $hurryUpColor; |
|
} |
|
} |
|
|
|
if ($resource->kind() eq "res" && |
|
$resource->is_problem() && |
|
!$firstDisplayed) { |
|
if ($color) {$result .= "<font color=\"$color\"><b>"; } |
|
$result .= getDescription($resource, $part); |
|
if ($color) {$result .= "</b></font>"; } |
|
} |
|
if ($resource->is_map() && advancedUser() && $resource->randompick()) { |
|
$result .= '(randomly select ' . $resource->randompick() .')'; |
|
} |
|
|
|
$result .= " </td>\n"; |
|
|
|
return $result; |
} |
} |
|
|
my @preparedColumns = (\&render_resource, \&render_communication_status, |
my @preparedColumns = (\&render_resource, \&render_communication_status, |
Line 1441 sub render {
|
Line 1445 sub render {
|
my $srcHasQuestion = $src =~ /\?/; |
my $srcHasQuestion = $src =~ /\?/; |
$args->{"resourceLink"} = $src. |
$args->{"resourceLink"} = $src. |
($srcHasQuestion?'&':'?') . |
($srcHasQuestion?'&':'?') . |
'symb=' . &Apache::lonnet::escape($curRes->symb()). |
'symb=' . &Apache::lonnet::escape($curRes->symb()); |
'"'; |
|
|
|
# Now, display each column. |
# Now, display each column. |
foreach my $col (@$cols) { |
foreach my $col (@$cols) { |
Line 2225 sub next {
|
Line 2228 sub next {
|
# If this is a blank resource, don't actually return it. |
# If this is a blank resource, don't actually return it. |
# Should you ever find you need it, make sure to add an option to the code |
# Should you ever find you need it, make sure to add an option to the code |
# that you can use; other things depend on this behavior. |
# that you can use; other things depend on this behavior. |
if (!$self->{HERE}->src() || !$self->{HERE}->browsePriv()) { |
my $browsePriv = $self->{HERE}->browsePriv(); |
|
if (!$self->{HERE}->src() || |
|
(!($browsePriv eq 'F') && !($browsePriv eq '2')) ) { |
return $self->next(); |
return $self->next(); |
} |
} |
|
|