version 1.265, 2004/07/03 20:45:23
|
version 1.267.2.8, 2004/10/07 19:55:52
|
Line 513 sub timeToHumanString {
|
Line 513 sub timeToHumanString {
|
} |
} |
|
|
# Not this year, so show the year |
# Not this year, so show the year |
my $timeStr = strftime("on %A, %b %e %G at %I:%M %P", localtime($time)); |
my $timeStr = strftime("on %A, %b %e %Y at %I:%M %P", localtime($time)); |
$timeStr =~ s/12:00 am/00:00/; |
$timeStr =~ s/12:00 am/00:00/; |
$timeStr =~ s/12:00 pm/noon/; |
$timeStr =~ s/12:00 pm/noon/; |
return $timeStr; |
return $timeStr; |
Line 971 sub render_resource {
|
Line 971 sub render_resource {
|
$nonLinkedText .= ' (' . $resource->countParts() . ' parts)'; |
$nonLinkedText .= ' (' . $resource->countParts() . ' parts)'; |
} |
} |
|
|
if (!$params->{'resource_nolink'} && !$resource->is_sequence()) { |
if (!$params->{'resource_nolink'} && !$resource->is_sequence() && !$resource->is_empty_sequence) { |
$result .= " $curMarkerBegin<a href='$link'>$title$partLabel</a>$curMarkerEnd $nonLinkedText</td>"; |
$result .= " $curMarkerBegin<a href='$link'>$title$partLabel</a>$curMarkerEnd $nonLinkedText</td>"; |
} else { |
} else { |
$result .= " $curMarkerBegin$title$partLabel$curMarkerEnd $nonLinkedText</td>"; |
$result .= " $curMarkerBegin$title$partLabel$curMarkerEnd $nonLinkedText</td>"; |
Line 1260 sub render {
|
Line 1260 sub render {
|
# We only need to do this if we need to open the maps to show the |
# We only need to do this if we need to open the maps to show the |
# current position. This will change the counter so we can't count |
# current position. This will change the counter so we can't count |
# for the jump marker with this loop. |
# for the jump marker with this loop. |
while (($curRes = $mapIterator->next()) && !$found) { |
while ($here && ($curRes = $mapIterator->next()) && !$found) { |
if (ref($curRes) && $curRes->symb() eq $here) { |
if (ref($curRes) && $curRes->symb() eq $here) { |
my $mapStack = $mapIterator->getStack(); |
my $mapStack = $mapIterator->getStack(); |
|
|
Line 1369 sub render {
|
Line 1369 sub render {
|
"&here=" . Apache::lonnet::escape($here) . |
"&here=" . Apache::lonnet::escape($here) . |
"\">".&mt('Open All Folders')."</a>"; |
"\">".&mt('Open All Folders')."</a>"; |
} |
} |
$result .= "<br /><br />\n"; |
$result .= "\n"; |
} |
} |
|
|
|
# Check for any unread discussions in all resources. |
|
if (!$args->{'resource_no_folder_link'}) { |
|
my $time=time; |
|
my $mapr = &mt('Mark all posts read'); |
|
$result .= (<<END); |
|
<a href="javascript:document.clearbubbles.submit()">$mapr</a> <a href="javascript:void(open('/adm/help/NavMaps_MarkPosts_Read.hlp', 'Help_for_NavMaps_MarkPosts', 'menubar=0,toolbar=1,scrollbars=1,width=350,height=400,resizable=yes'))" title="Online Help"><image src="/adm/help/gif/smallHelp.gif" border="0" alt="(Help: NavMaps_MarkPostsLink)" /></a> |
|
<form name="clearbubbles" method="post" action="/adm/feedback"> |
|
<input type="hidden" name="navurl" value="$ENV{'QUERY_STRING'}" /> |
|
<input type="hidden" name="navtime" value="$time" /> |
|
</form> |
|
END |
|
} |
|
$result .= "<br />\n"; |
if ($r) { |
if ($r) { |
$r->print($result); |
$r->print($result); |
$r->rflush(); |
$r->rflush(); |
Line 1845 sub generate_email_discuss_status {
|
Line 1858 sub generate_email_discuss_status {
|
|
|
foreach my $msgid (split(/\&/, $keys)) { |
foreach my $msgid (split(/\&/, $keys)) { |
$msgid=&Apache::lonnet::unescape($msgid); |
$msgid=&Apache::lonnet::unescape($msgid); |
my $plain=&Apache::lonnet::unescape(&Apache::lonnet::unescape($msgid)); |
if ((!$emailstatus{$msgid}) || ($emailstatus{$msgid} eq 'new')) { |
if ($plain=~/(Error|Feedback) \[([^\]]+)\]/) { |
my $plain= |
my ($what,$url)=($1,$2); |
&Apache::lonnet::unescape(&Apache::lonnet::unescape($msgid)); |
my %status= |
if ($plain=~/(Error|Feedback) \[([^\]]+)\]/) { |
&Apache::lonnet::get('email_status',[$msgid]); |
my ($what,$url)=($1,$2); |
if ($status{$msgid}=~/^error\:/) { |
|
$status{$msgid}=''; |
|
} |
|
|
|
if (($status{$msgid} eq 'new') || |
|
(!$status{$msgid})) { |
|
if ($what eq 'Error') { |
if ($what eq 'Error') { |
$error{$url}.=','.$msgid; |
$error{$url}.=','.$msgid; |
} else { |
} else { |
Line 1865 sub generate_email_discuss_status {
|
Line 1872 sub generate_email_discuss_status {
|
} |
} |
} |
} |
|
|
|
#url's of resources that have feedbacks |
$self->{FEEDBACK} = \%feedback; |
$self->{FEEDBACK} = \%feedback; |
$self->{ERROR_MSG} = \%error; # what is this? JB |
#or errors |
|
$self->{ERROR_MSG} = \%error; |
$self->{DISCUSSION_TIME} = \%discussiontime; |
$self->{DISCUSSION_TIME} = \%discussiontime; |
$self->{EMAIL_STATUS} = \%emailstatus; |
$self->{EMAIL_STATUS} = \%emailstatus; |
$self->{LAST_READ} = \%lastreadtime; |
$self->{LAST_READ} = \%lastreadtime; |
Line 1942 sub hasDiscussion {
|
Line 1951 sub hasDiscussion {
|
# backward compatibility (bulletin boards used to be 'wrapped') |
# backward compatibility (bulletin boards used to be 'wrapped') |
my $ressymb = $symb; |
my $ressymb = $symb; |
if ($ressymb =~ m|adm/(\w+)/(\w+)/(\d+)/bulletinboard$|) { |
if ($ressymb =~ m|adm/(\w+)/(\w+)/(\d+)/bulletinboard$|) { |
unless ($ressymb =~ m|bulletin___\d+___adm/wrapper|) { |
unless ($ressymb =~ m|adm/wrapper/adm|) { |
$ressymb = 'bulletin___'.$3.'___adm/wrapper/adm/'.$1.'/'.$2.'/'.$3.'/bulletinboard'; |
$ressymb = 'bulletin___'.$3.'___adm/wrapper/adm/'.$1.'/'.$2.'/'.$3.'/bulletinboard'; |
} |
} |
} |
} |
Line 1950 sub hasDiscussion {
|
Line 1959 sub hasDiscussion {
|
if ( defined ( $self->{LAST_READ}->{$ressymb} ) ) { |
if ( defined ( $self->{LAST_READ}->{$ressymb} ) ) { |
return $self->{DISCUSSION_TIME}->{$ressymb} > $self->{LAST_READ}->{$ressymb}; |
return $self->{DISCUSSION_TIME}->{$ressymb} > $self->{LAST_READ}->{$ressymb}; |
} else { |
} else { |
return $self->{DISCUSSION_TIME}->{$ressymb} > $self->{LAST_CHECK}; |
# return $self->{DISCUSSION_TIME}->{$ressymb} > $self->{LAST_CHECK}; # v.1.1 behavior |
|
return $self->{DISCUSSION_TIME}->{$ressymb} > 0; # in 1.2 will display speech bubble icons for all items with posts until marked as read (even if read in v 1.1). |
} |
} |
} |
} |
|
|
Line 3254 sub is_survey {
|
Line 3264 sub is_survey {
|
return 0; |
return 0; |
} |
} |
|
|
|
sub is_empty_sequence { |
|
my $self=shift; |
|
my $src = $self->src(); |
|
return !$self->is_page() && $self->navHash("is_map_", 1) && !$self->navHash("map_type_" . $self->map_pc()); |
|
} |
|
|
# Private method: Shells out to the parmval in the nav map, handler parts. |
# Private method: Shells out to the parmval in the nav map, handler parts. |
sub parmval { |
sub parmval { |
my $self = shift; |
my $self = shift; |
Line 3941 sub getCompletionStatus {
|
Line 3957 sub getCompletionStatus {
|
|
|
# Left as separate if statements in case we ever do more with this |
# Left as separate if statements in case we ever do more with this |
if ($status eq 'correct_by_student') {return $self->CORRECT;} |
if ($status eq 'correct_by_student') {return $self->CORRECT;} |
|
if ($status eq 'correct_by_scantron') {return $self->CORRECT;} |
if ($status eq 'correct_by_override') {return $self->CORRECT_BY_OVERRIDE; } |
if ($status eq 'correct_by_override') {return $self->CORRECT_BY_OVERRIDE; } |
if ($status eq 'incorrect_attempted') {return $self->INCORRECT; } |
if ($status eq 'incorrect_attempted') {return $self->INCORRECT; } |
if ($status eq 'incorrect_by_override') {return $self->INCORRECT_BY_OVERRIDE; } |
if ($status eq 'incorrect_by_override') {return $self->INCORRECT_BY_OVERRIDE; } |
Line 4091 sub status {
|
Line 4108 sub status {
|
|
|
if ($dateStatus == PAST_DUE_ANSWER_LATER || |
if ($dateStatus == PAST_DUE_ANSWER_LATER || |
$dateStatus == PAST_DUE_NO_ANSWER ) { |
$dateStatus == PAST_DUE_NO_ANSWER ) { |
return $dateStatus; |
return $suppressFeedback ? ANSWER_SUBMITTED : $dateStatus; |
} |
} |
|
|
if ($dateStatus == ANSWER_OPEN) { |
if ($dateStatus == ANSWER_OPEN) { |