version 1.21, 2002/10/16 20:42:22
|
version 1.26, 2003/05/02 18:56:29
|
Line 33 use Apache::lonnet;
|
Line 33 use Apache::lonnet;
|
use POSIX qw(strftime); |
use POSIX qw(strftime); |
|
|
BEGIN { |
BEGIN { |
&Apache::lonxml::register('Apache::outputtags',('displayduedate','displaytitle')); |
&Apache::lonxml::register('Apache::outputtags',('displayduedate','displaytitle','displayweight')); |
} |
} |
|
|
sub initialize_outputtags { |
sub initialize_outputtags { |
Line 94 sub start_displaytitle {
|
Line 94 sub start_displaytitle {
|
$result=&Apache::edit::tag_start($target,$token); |
$result=&Apache::edit::tag_start($target,$token); |
$result.='</td></tr>'; |
$result.='</td></tr>'; |
$result.=&Apache::edit::end_table(); |
$result.=&Apache::edit::end_table(); |
} elsif ($target eq 'tex') { |
} elsif ($target eq 'tex' and $Apache::lonhomework::type ne 'exam') { |
$Apache::lonhomework::name=~s/%/\%/g; |
$Apache::lonhomework::name=~s/%/\%/g; |
$Apache::lonhomework::name=~s/&/\&/g; |
$Apache::lonhomework::name=~s/&/\&/g; |
$result='\vskip 0 mm\noindent\textbf{'.$Apache::lonhomework::name.'}\vskip 0 mm'; |
$result='\vskip 0 mm\noindent\textbf{'.$Apache::lonhomework::name.'}\vskip 0 mm'; |
Line 106 sub end_displaytitle {
|
Line 106 sub end_displaytitle {
|
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; |
my @result; |
my @result; |
if ($target eq 'edit') { $result[1]='no'; } |
if ($target eq 'edit') { $result[1]='no'; } |
|
return @result; |
|
} |
|
|
|
sub start_displayweight { |
|
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; |
|
my $result; |
|
if (exists($Apache::outputtags::showonce{'displayweight'})) { |
|
if(grep(/^\Q$Apache::inputtags::part\E$/, |
|
@{$Apache::outputtags::showonce{'displayweight'}})) { |
|
return ''; |
|
} |
|
} |
|
push(@{$Apache::outputtags::showonce{'displayweight'}}, |
|
$Apache::inputtags::part); |
|
my $status=$Apache::inputtags::status['-1']; |
|
if ($target eq 'web' || $target eq 'tex') { |
|
my $id = $Apache::inputtags::part; |
|
my $weight = &Apache::lonnet::EXT("resource.$id.weight"); |
|
&Apache::lonxml::debug("duedatebox found $weight for $id"); |
|
if (!defined($weight) || ($weight eq '')) { $weight=1; } |
|
$result.=$weight; |
|
} elsif ( $target eq 'edit' ) { |
|
$result=&Apache::edit::tag_start($target,$token); |
|
$result.='</td></tr>'; |
|
$result.=&Apache::edit::end_table(); |
|
} |
|
return $result; |
|
} |
|
|
|
sub end_displayweight { |
|
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; |
|
my @result; |
|
if ($target eq 'edit') { $result[1]='no'; } |
return @result; |
return @result; |
} |
} |
|
|