version 1.234, 2003/09/24 15:58:06
|
version 1.238, 2003/10/08 19:22:17
|
Line 127 sub real_handler {
|
Line 127 sub real_handler {
|
# Create the nav map |
# Create the nav map |
my $navmap = Apache::lonnavmaps::navmap->new(); |
my $navmap = Apache::lonnavmaps::navmap->new(); |
|
|
|
|
if (!defined($navmap)) { |
if (!defined($navmap)) { |
my $requrl = $r->uri; |
my $requrl = $r->uri; |
$ENV{'user.error.msg'} = "$requrl:bre:0:0:Course not initialized"; |
$ENV{'user.error.msg'} = "$requrl:bre:0:0:Course not initialized"; |
Line 433 sub timeToHumanString {
|
Line 432 sub timeToHumanString {
|
return &mt('never'); |
return &mt('never'); |
} |
} |
unless (&Apache::lonlocal::current_language()=~/^en/) { |
unless (&Apache::lonlocal::current_language()=~/^en/) { |
return localtime($time); |
return &Apache::lonlocal::locallocaltime($time); |
} |
} |
my $now = time(); |
my $now = time(); |
|
|
Line 502 sub timeToHumanString {
|
Line 501 sub timeToHumanString {
|
# HH:MM |
# HH:MM |
if ( $delta < $day * 5 ) { |
if ( $delta < $day * 5 ) { |
my $timeStr = strftime("%A, %b %e at %I:%M %P", localtime($time)); |
my $timeStr = strftime("%A, %b %e at %I:%M %P", localtime($time)); |
$timeStr =~ s/12:00 am/midnight/; |
$timeStr =~ s/12:00 am/00:00/; |
$timeStr =~ s/12:00 pm/noon/; |
$timeStr =~ s/12:00 pm/noon/; |
return ($inPast ? "last " : "next ") . |
return ($inPast ? "last " : "next ") . |
$timeStr; |
$timeStr; |
Line 512 sub timeToHumanString {
|
Line 511 sub timeToHumanString {
|
if ( $time[5] == $now[5]) { |
if ( $time[5] == $now[5]) { |
# Return on Month Day, HH:MM meridian |
# Return on Month Day, HH:MM meridian |
my $timeStr = strftime("on %A, %b %e at %I:%M %P", localtime($time)); |
my $timeStr = strftime("on %A, %b %e at %I:%M %P", localtime($time)); |
$timeStr =~ s/12:00 am/midnight/; |
$timeStr =~ s/12:00 am/00:00/; |
$timeStr =~ s/12:00 pm/noon/; |
$timeStr =~ s/12:00 pm/noon/; |
return $timeStr; |
return $timeStr; |
} |
} |
|
|
# 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 %G at %I:%M %P", localtime($time)); |
$timeStr =~ s/12:00 am/midnight/; |
$timeStr =~ s/12:00 am/00:00/; |
$timeStr =~ s/12:00 pm/noon/; |
$timeStr =~ s/12:00 pm/noon/; |
return $timeStr; |
return $timeStr; |
} |
} |
Line 1587 sub render {
|
Line 1586 sub render {
|
# If we have the connection, make sure the user is still connected |
# If we have the connection, make sure the user is still connected |
my $c = $r->connection; |
my $c = $r->connection; |
if ($c->aborted()) { |
if ($c->aborted()) { |
Apache::lonnet::logthis("navmaps aborted"); |
|
# Who cares what we do, nobody will see it anyhow. |
# Who cares what we do, nobody will see it anyhow. |
return ''; |
return ''; |
} |
} |
Line 3369 sub opendate {
|
Line 3367 sub opendate {
|
} |
} |
sub problemstatus { |
sub problemstatus { |
(my $self, my $part) = @_; |
(my $self, my $part) = @_; |
return $self->parmval("problemstatus", $part); |
return lc $self->parmval("problemstatus", $part); |
} |
} |
sub sig { |
sub sig { |
(my $self, my $part) = @_; |
(my $self, my $part) = @_; |
Line 3547 sub responseType {
|
Line 3545 sub responseType {
|
my $part = shift; |
my $part = shift; |
|
|
$self->extractParts(); |
$self->extractParts(); |
return @{$self->{RESPONSE_TYPES}->{$part}}; |
if (defined($self->{RESPONSE_TYPES}->{$part})) { |
|
return @{$self->{RESPONSE_TYPES}->{$part}}; |
|
} else { |
|
return undef; |
|
} |
} |
} |
|
|
sub responseIds { |
sub responseIds { |
Line 3555 sub responseIds {
|
Line 3557 sub responseIds {
|
my $part = shift; |
my $part = shift; |
|
|
$self->extractParts(); |
$self->extractParts(); |
return @{$self->{RESPONSE_IDS}->{$part}}; |
if (defined($self->{RESPONSE_IDS}->{$part})) { |
|
return @{$self->{RESPONSE_IDS}->{$part}}; |
|
} else { |
|
return undef; |
|
} |
} |
} |
|
|
# Private function: Extracts the parts information, both part names and |
# Private function: Extracts the parts information, both part names and |
Line 3947 sub status {
|
Line 3953 sub status {
|
#if ($self->{RESOURCE_ERROR}) { return NETWORK_FAILURE; } |
#if ($self->{RESOURCE_ERROR}) { return NETWORK_FAILURE; } |
if ($completionStatus == NETWORK_FAILURE) { return NETWORK_FAILURE; } |
if ($completionStatus == NETWORK_FAILURE) { return NETWORK_FAILURE; } |
|
|
my $suppressFeedback = lc($self->parmval("problemstatus", $part)) eq 'no'; |
my $suppressFeedback = $self->problemstatus($part) eq 'no'; |
|
# If there's an answer date and we're past it, don't |
|
# suppress the feedback; student should know |
|
if ($self->answerdate($part) && $self->answerdate($part) < time()) { |
|
$suppressFeedback = 0; |
|
} |
|
|
# There are a few whole rows we can dispose of: |
# There are a few whole rows we can dispose of: |
if ($completionStatus == CORRECT || |
if ($completionStatus == CORRECT || |