--- loncom/homework/structuretags.pm 2004/06/03 16:42:02 1.255 +++ loncom/homework/structuretags.pm 2004/08/13 18:51:33 1.260.2.1 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: structuretags.pm,v 1.255 2004/06/03 16:42:02 www Exp $ +# $Id: structuretags.pm,v 1.260.2.1 2004/08/13 18:51:33 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -58,10 +58,11 @@ sub start_tex { my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; my $result=''; my $bodytext=&Apache::lonxml::get_all_text("/tex",$parser); + &Apache::lonnet::logthis("Hrrm? $bodytext --"); if ($target eq 'tex') { return $bodytext.' '; } - return $result;; + return $result; } sub end_tex { @@ -84,7 +85,6 @@ sub page_start { $parstack,$parser,$safeeval); $head_tag_start=''.&Apache::lonmenu::registerurl(undef,$target). &Apache::lonhtmlcommon::htmlareaheaders(); - @Apache::lonxml::htmlareafields=(); } my $body_tag_start; if (!defined($found{'body'})) { @@ -192,10 +192,8 @@ sub problem_edit_header {
'. - &Apache::loncommon::help_open_topic('Problem_Editor_XML_Index', - 'Problem Editing Help').''. - &Apache::loncommon::help_open_faq(5). - &Apache::loncommon::help_open_bug('Authoring').'
'. + &Apache::loncommon::help_open_menu('','Problem Editing Help','Problem_Editor_XML_Index','',5,'Authoring',undef,undef,undef,'Problem Editing Help') + .''. '
'; } @@ -568,7 +566,7 @@ sub start_problem { my @due_file_content = <$temp_file>; my $due_file_content = $due_file_content[$#due_file_content]; chomp $due_file_content; - my $name_of_resourse= &Apache::lonxml::latex_special_symbols(&get_resource_name($parstack,$safeeval)); + my $name_of_resourse= &Apache::lonxml::latex_special_symbols(&get_resource_name($parstack,$safeeval),'header'); if ($due_file_content ne $duedate) { $temp_file = Apache::File->new('>'.$filename); print $temp_file "$duedate\n"; @@ -647,6 +645,10 @@ sub end_problem { if (not $ENV{'form.problem_split'}=~/yes/) { $endminipage = '\end{minipage}'; } + if ($ENV{'form.print_discussions'} eq 'yes') { + $result.=&Apache::lonxml::xmlend(); + $result=~s/<\/html>//; + } $result .= '\keephidden{ENDOFPROBLEM}\vskip 0.5mm\noindent\makebox[\textwidth/$number_of_columns][b]{\hrulefill}'; if (not $ENV{'request.symb'} =~ m/\.page_/) { $result .= $endminipage.'\end{document} '; @@ -670,6 +672,7 @@ sub end_problem { $result=&Apache::response::mandatory_part_meta; } $result.=&Apache::response::meta_part_order(); + $result.=&Apache::response::meta_response_order(); } elsif ($target eq 'edit') { &Apache::lonxml::debug("in end_problem with $target, edit"); $result = &problem_edit_footer(); @@ -1038,7 +1041,11 @@ sub start_part { @Apache::inputtags::previous_version=(); $Apache::lonhomework::problemstatus=&get_problem_status($id); my $hidden=&Apache::loncommon::check_if_partid_hidden($Apache::inputtags::part); + my $newtype=&Apache::lonnet::EXT("resource.$id.type"); + if ($newtype) { $Apache::lonhomework::type=$newtype; } + my $expression='$external::part=\''.$Apache::inputtags::part.'\';'; + $expression.='$external::type=\''.$Apache::lonhomework::type.'\';'; &Apache::run::run($expression,$safeeval); if ($target eq 'meta') { @@ -1077,7 +1084,11 @@ sub start_part { } else { if ($target eq 'tex') { if (not $ENV{'form.problem_split'}=~/yes/) { - $result.='\noindent \end{minipage}\vskip 0 mm \noindent \begin{minipage}{\textwidth}\noindent'; + if ($$tagstack[-2] eq 'td') { + $result.='\vskip 0 mm \noindent \begin{minipage}{\textwidth}\noindent'; + } else { + $result.='\noindent \end{minipage}\vskip 0 mm \noindent \begin{minipage}{\textwidth}\noindent'; + } } my $weight = &Apache::lonnet::EXT("resource.$id.weight"); my $allkeys=&Apache::lonnet::metadata($ENV{'request.uri'},'packages'); @@ -1137,6 +1148,7 @@ sub end_part { $gradestatus=''; } $result=$gradestatus; + if ($$tagstack[-2] eq 'td') {$result.='\end{minipage}';} } elsif ($target eq 'edit') { $result=&Apache::edit::end_table(); }