--- loncom/homework/structuretags.pm 2002/07/03 15:36:40 1.101
+++ loncom/homework/structuretags.pm 2002/08/20 14:42:22 1.104
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# definition of tags that give a structure to a document
#
-# $Id: structuretags.pm,v 1.101 2002/07/03 15:36:40 sakharuk Exp $
+# $Id: structuretags.pm,v 1.104 2002/08/20 14:42:22 sakharuk Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -57,7 +57,7 @@ sub start_tex {
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
my $bodytext=&Apache::lonxml::get_all_text("/tex",$$parser[$#$parser]);
if ($target eq 'tex') {
- return $bodytext
+ return $bodytext.' ';
}
return '';
}
@@ -285,6 +285,12 @@ sub start_problem {
"
$name\n$body_tag_start\n";
}
} elsif ($target eq 'tex') {
+ my $name= &Apache::lonxml::get_param('name',$parstack,$safeeval);
+ if ($name eq '') {
+ $name=&Apache::lonnet::EXT('resource.title');
+ if ($name eq 'con_lost') { $name = ''; }
+ }
+ $Apache::lonhomework::name=$name;
my $id = $Apache::inputtags::part;
my $duedate = &Apache::lonnet::EXT("resource.$id.duedate");
$duedate = POSIX::strftime("%c",localtime($duedate));
@@ -302,7 +308,11 @@ sub start_problem {
$temp_file = Apache::File->new('>'.$filename);
print $temp_file "$duedate\n";
if (not $ENV{'request.symb'} =~ m/\.page_/) {
- $result .= '\begin{document} \noindent\textit{Due date: '.$duedate.'} \vskip 1 mm';
+ if(not $duedate=~m/1969/) {
+ $result .= '\begin{document} \noindent\textit{Due date: '.$duedate.'} \vskip 1 mm';
+ } else {
+ $result .= '\begin{document} \noindent \vskip 1 mm';
+ }
} else {
$result .= '\parbox{\minipagewidth}{\vskip 1mm\textit{Due date: '.$duedate.'} \\\\\\\\';
}
@@ -616,6 +626,8 @@ sub start_postanswerdate {
if ($Apache::inputtags::status['-1'] ne 'SHOW_ANSWER') {
&Apache::lonxml::get_all_text("/postanswerdate",$$parser[$#$parser]);
}
+ } elsif ($target eq 'tex') {
+ return '\vskip 0 mm \noindent';
}
return '';
}