--- loncom/interface/lonnavmaps.pm 2005/09/29 17:14:14 1.341
+++ loncom/interface/lonnavmaps.pm 2005/10/07 17:57:39 1.343
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Navigate Maps Handler
#
-# $Id: lonnavmaps.pm,v 1.341 2005/09/29 17:14:14 albertel Exp $
+# $Id: lonnavmaps.pm,v 1.343 2005/10/07 17:57:39 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -690,7 +690,6 @@ sub timeToHumanString {
} elsif ($type eq 'end') {
$conjunction='by';
}
- &Apache::lonnet::logthis("
$conjunction $type
");
# Is it this year?
if ( $time[5] == $now[5]) {
# Return on Month Day, HH:MM meridian
@@ -1134,6 +1133,9 @@ sub render_resource {
if ($resource->randomout()) {
$nonLinkedText .= ' (hidden) ';
}
+ if (!$resource->condval()) {
+ $nonLinkedText .= ' (conditionally hidden) ';
+ }
# We're done preparing and finally ready to start the rendering
my $result = "";
@@ -3582,7 +3584,19 @@ sub condition {
my $condition=&Apache::lonnet::directcondval($condid);
return $condition;
}
-
+sub condval {
+ my $self=shift;
+ my $uri=&Apache::lonnet::deversion(&Apache::lonnet::declutter($self->src()));
+ my ($pathname,$filename)=($uri=~m|(.*)/([^/]*)|);
+ $pathname=~s/^adm\/wrapper\///;
+
+ my $match=($env{'acc.res.'.$env{'request.course.id'}.'.'.$pathname}=~
+ /\&\Q$filename\E\:([\d\|]+)\&/);
+ if ($match) {
+ return &Apache::lonnet::condval($1);
+ }
+ return 0;
+}
sub compTitle {
my $self = shift;
my $title = $self->title();
@@ -4568,6 +4582,13 @@ sub status {
return CORRECT;
}
+ # If it's WRONG... and not open
+ if ( ($completionStatus == INCORRECT ||
+ $completionStatus == INCORRECT_BY_OVERRIDE)
+ && (!$self->opendate($part) || $self->opendate($part) > time()) ) {
+ return INCORRECT;
+ }
+
if ($completionStatus == ATTEMPTED) {
return ATTEMPTED;
}
@@ -4773,7 +4794,7 @@ sub getNext {
my $to = $self->to();
foreach my $branch ( split(/,/, $to) ) {
my $choice = $self->{NAV_MAP}->getById($branch);
- if (!$choice->condition()) { next; }
+ #if (!$choice->condition()) { next; }
my $next = $choice->goesto();
$next = $self->{NAV_MAP}->getById($next);
|