version 1.119, 2002/12/02 14:19:38
|
version 1.124, 2003/01/10 18:45:30
|
Line 96 sub real_handler {
|
Line 96 sub real_handler {
|
'')); |
'')); |
$r->print('<script>window.focus();</script>'); |
$r->print('<script>window.focus();</script>'); |
|
|
|
$r->rflush(); |
|
|
|
# Now that we've displayed some stuff to the user, init the navmap |
|
$navmap->init(); |
|
|
$r->print('<table border="0" cellpadding="2" cellspacing="0">'); |
$r->print('<table border="0" cellpadding="2" cellspacing="0">'); |
my $date=localtime; |
my $date=localtime; |
$r->print('<tr><td align="right" valign="bottom">Key: </td>'); |
$r->print('<tr><td align="right" valign="bottom">Key: </td>'); |
Line 178 sub real_handler {
|
Line 183 sub real_handler {
|
$r->print('<br> '); |
$r->print('<br> '); |
$r->rflush(); |
$r->rflush(); |
|
|
# Now that we've displayed some stuff to the user, init the navmap |
|
$navmap->init(); |
|
|
|
# Check that it's defined |
# Check that it's defined |
if (!($navmap->courseMapDefined())) { |
if (!($navmap->courseMapDefined())) { |
$r->print('<font size="+2" color="red">Coursemap undefined.</font>' . |
$r->print('<font size="+2" color="red">Coursemap undefined.</font>' . |
Line 274 sub real_handler {
|
Line 276 sub real_handler {
|
my $foundJump = ($jumpType == $NOTHING); # look for jump point if we have one |
my $foundJump = ($jumpType == $NOTHING); # look for jump point if we have one |
my $looped = 0; |
my $looped = 0; |
|
|
$r->print($hereType); |
|
|
|
# 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 ($depth > 0 && !$ENV{'form.alreadyHere'}) { |
while ($depth > 0 && !$ENV{'form.alreadyHere'}) { |
if ($curRes == $mapIterator->BEGIN_MAP()) { $depth++; } |
if ($curRes == $mapIterator->BEGIN_MAP()) { $depth++; } |
if ($curRes == $mapIterator->END_MAP()) { $depth--; } |
if ($curRes == $mapIterator->END_MAP()) { $depth--; } |
$r->print($curRes . ' '); |
|
if (ref($curRes) && !$ENV{'form.alreadyHere'} && |
if (ref($curRes) && !$ENV{'form.alreadyHere'} && |
($hereType == $SYMB && $curRes->symb() eq $here) || |
($hereType == $SYMB && $curRes->symb() eq $here) || |
(ref($curRes) && $hereType == $URL && $curRes->src() eq $here)) { |
(ref($curRes) && $hereType == $URL && $curRes->src() eq $here)) { |
Line 488 sub real_handler {
|
Line 488 sub real_handler {
|
'"'; |
'"'; |
|
|
my $title = $curRes->compTitle(); |
my $title = $curRes->compTitle(); |
|
if ($src=~/^\/uploaded\//) { |
|
$nonLinkedText=$title; |
|
$title=''; |
|
} |
my $partLabel = ""; |
my $partLabel = ""; |
my $newBranchText = ""; |
my $newBranchText = ""; |
|
|
Line 598 sub real_handler {
|
Line 602 sub real_handler {
|
$r->print("</td>\n"); |
$r->print("</td>\n"); |
|
|
# SECOND COL: Is there text, feedback, errors?? |
# SECOND COL: Is there text, feedback, errors?? |
my $discussionHTML = ""; my $feedbackHTML = ""; |
my $discussionHTML = ""; my $feedbackHTML = ""; my $errorHTML = ""; |
|
|
if ($curRes->hasDiscussion()) { |
if ($curRes->hasDiscussion()) { |
$discussionHTML = $linkopen . |
$discussionHTML = $linkopen . |
Line 618 sub real_handler {
|
Line 622 sub real_handler {
|
} |
} |
} |
} |
|
|
$r->print("<td width=\"75\" align=\"left\" valign=\"center\">$discussionHTML$feedbackHTML </td>"); |
if ($curRes->getErrors()) { |
|
my $errors = $curRes->getErrors(); |
|
foreach (split(/,/, $errors)) { |
|
if ($_) { |
|
$errorHTML .= ' <a href="/adm/email?display=' |
|
. &Apache::lonnet::escape($_) . '">' |
|
. '<img src="/adm/lonMisc/bomb.gif" ' |
|
. 'border="0" /></a>'; |
|
} |
|
} |
|
} |
|
|
|
$r->print("<td width=\"75\" align=\"left\" valign=\"center\">$discussionHTML$feedbackHTML$errorHTML </td>"); |
|
|
# Is this the first displayed part of a multi-part problem |
# Is this the first displayed part of a multi-part problem |
# that has not been condensed, so we should suppress these two |
# that has not been condensed, so we should suppress these two |
Line 983 sub new {
|
Line 999 sub new {
|
return undef; |
return undef; |
} |
} |
|
|
# Now copy the hashes for speed (?) |
$self->{NAV_HASH} = \%navmaphash; |
my %realnav; my %realparm; |
$self->{PARM_HASH} = \%parmhash; |
foreach (%navmaphash) { $realnav{$_} = $navmaphash{$_}; } |
|
foreach (%parmhash) { $realparm{$_} = $navmaphash{$_}; } |
|
$self->{NAV_HASH} = \%realnav; |
|
$self->{PARM_HASH} = \%realparm; |
|
|
|
bless($self); |
bless($self); |
$self->untieHashes(); |
$self->untieHashes(); |
Line 1062 sub init {
|
Line 1074 sub init {
|
my %emailstatus = &Apache::lonnet::dump('email_status'); |
my %emailstatus = &Apache::lonnet::dump('email_status'); |
my $logoutTime = $emailstatus{'logout'}; |
my $logoutTime = $emailstatus{'logout'}; |
my $courseLeaveTime = $emailstatus{'logout_'.$ENV{'request.course.id'}}; |
my $courseLeaveTime = $emailstatus{'logout_'.$ENV{'request.course.id'}}; |
$self->{LAST_CHECK} = ($courseLeaveTime > $logoutTime ? |
$self->{LAST_CHECK} = ($courseLeaveTime < $logoutTime ? |
$courseLeaveTime : $logoutTime); |
$courseLeaveTime : $logoutTime); |
my %discussiontime = &Apache::lonnet::dump('discussiontimes', |
my %discussiontime = &Apache::lonnet::dump('discussiontimes', |
$cdom, $cnum); |
$cdom, $cnum); |
Line 1143 sub DESTROY {
|
Line 1155 sub DESTROY {
|
$self->untieHashes(); |
$self->untieHashes(); |
} |
} |
|
|
# Private function: Does the given resource (as a symb string) have |
# Does the given resource (as a symb string) have |
# current discussion? Returns 0 if chat/mail data not extracted. |
# current discussion? Returns 0 if chat/mail data not extracted. |
sub hasDiscussion { |
sub hasDiscussion { |
my $self = shift; |
my $self = shift; |
my $symb = shift; |
my $symb = shift; |
if (!defined($self->{DISCUSSION_TIME})) { return 0; } |
if (!defined($self->{DISCUSSION_TIME})) { return 0; } |
|
|
|
#return defined($self->{DISCUSSION_TIME}->{$symb}); |
return $self->{DISCUSSION_TIME}->{$symb} > |
return $self->{DISCUSSION_TIME}->{$symb} > |
$self->{LAST_CHECK}; |
$self->{LAST_CHECK}; |
} |
} |
|
|
# Private function: Does the given resource (as a symb string) have |
# Does the given resource (as a symb string) have |
# current feedback? Returns the string in the feedback hash, which |
# current feedback? Returns the string in the feedback hash, which |
# will be false if it does not exist. |
# will be false if it does not exist. |
sub getFeedback { |
sub getFeedback { |
Line 1166 sub getFeedback {
|
Line 1179 sub getFeedback {
|
return $self->{FEEDBACK}->{$symb}; |
return $self->{FEEDBACK}->{$symb}; |
} |
} |
|
|
|
sub getErrors { |
|
my $self = shift; |
|
my $src = shift; |
|
|
|
if (!defined($self->{ERROR_MSG})) { return ""; } |
|
return $self->{ERROR_MSG}->{$src}; |
|
} |
|
|
=pod |
=pod |
|
|
=item * B<getById>(id): Based on the ID of the resource (1.1, 3.2, etc.), get a resource object for that resource. This method, or other methods that use it (as in the resource object) is the only proper way to obtain a resource object. |
=item * B<getById>(id): Based on the ID of the resource (1.1, 3.2, etc.), get a resource object for that resource. This method, or other methods that use it (as in the resource object) is the only proper way to obtain a resource object. |
Line 2231 sub hasDiscussion {
|
Line 2252 sub hasDiscussion {
|
|
|
sub getFeedback { |
sub getFeedback { |
my $self = shift; |
my $self = shift; |
return $self->{NAV_MAP}->getFeedback($self->src()); |
my $source = $self->src(); |
|
if ($source !~ /^\/res\//) { $source = substr $source, 5; } |
|
return $self->{NAV_MAP}->getFeedback($source); |
|
} |
|
|
|
sub getErrors { |
|
my $self = shift; |
|
my $source = $self->src(); |
|
if ($source =~ /^\/res\//) { $source = substr $source, 5; } |
|
return $self->{NAV_MAP}->getErrors($source); |
} |
} |
|
|
=pod |
=pod |