--- loncom/homework/structuretags.pm 2002/05/03 19:32:57 1.93
+++ loncom/homework/structuretags.pm 2003/03/07 23:41:29 1.155
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# definition of tags that give a structure to a document
#
-# $Id: structuretags.pm,v 1.93 2002/05/03 19:32:57 albertel Exp $
+# $Id: structuretags.pm,v 1.155 2003/03/07 23:41:29 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -29,10 +29,13 @@
# 6/26/2001 fixed extra web display at end of tags
# 8/17,8/18,8/20 Gerd Kortemeyer
+
package Apache::structuretags;
use strict;
use Apache::lonnet;
+use Apache::File();
+use Apache::lonmenu;
BEGIN {
&Apache::lonxml::register('Apache::structuretags',('block','while','randomlist','problem','library','web','tex','part','preduedate','postanswerdate','solved','notsolved','startouttext','endouttext'));
@@ -41,7 +44,7 @@ BEGIN {
sub start_web {
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
- my $bodytext=&Apache::lonxml::get_all_text("/web",$$parser[$#$parser]);
+ my $bodytext=&Apache::lonxml::get_all_text("/web",$parser);
if ($target eq 'web') {
return $bodytext;
}
@@ -54,9 +57,9 @@ sub end_web {
sub start_tex {
my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
- my $bodytext=&Apache::lonxml::get_all_text("/tex",$$parser[$#$parser]);
+ my $bodytext=&Apache::lonxml::get_all_text("/tex",$parser);
if ($target eq 'tex') {
- return $bodytext
+ return $bodytext.' ';
}
return '';
}
@@ -79,12 +82,12 @@ sub page_start {
if (!defined($found{'html'})) {
$result=&Apache::londefdef::start_html($target,$token,$tagstack,$parstack,
$parser,$safeeval);
- $head_tag_start='
'.&Apache::lonxml::registerurl(undef,$target);
+ $head_tag_start=''.&Apache::lonmenu::registerurl(undef,$target);
}
my $body_tag_start;
if (!defined($found{'body'})) {
- $body_tag_start='';
+ $body_tag_start.='>'.&Apache::lonmenu::menubuttons(undef,$target,1);
+ if ($target eq 'web' && $ENV{'request.state'} ne 'construct') {
+ my ($symb)=&Apache::lonxml::whichuser();
+ if ($symb eq '') {
+ my $help = &Apache::loncommon::help_open_topic("Ambiguous_Reference");
+ $help="Browsing or ambiguous reference, submissions ignored $help
";
+ $body_tag_start.=$help;
+ }
+ }
+ }
+ my $form_tag_start;
+ if (!defined($found{'form'})) {
+ $form_tag_start='