--- loncom/homework/structuretags.pm 2002/08/23 21:17:16 1.105
+++ loncom/homework/structuretags.pm 2003/02/27 20:01:05 1.151
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# definition of tags that give a structure to a document
#
-# $Id: structuretags.pm,v 1.105 2002/08/23 21:17:16 albertel Exp $
+# $Id: structuretags.pm,v 1.151 2003/02/27 20:01:05 sakharuk Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -29,11 +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'));
@@ -42,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;
}
@@ -55,7 +57,7 @@ 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.' ';
}
@@ -80,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);
+ 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'})) {
@@ -109,10 +119,11 @@ sub page_start {
return ($result,$head_tag_start,$body_tag_start,$form_tag_start);
}
+#use Time::HiRes();
sub get_resource_name {
my ($parstack,$safeeval)=@_;
- my $name=&Apache::lonxml::get_param('name',$parstack,$safeeval);
- if ($name eq '') {
+ my $name=&Apache::lonnet::gettitle();
+ if ($name eq '') {
$name=&Apache::lonnet::EXT('resource.title');
if ($name eq 'con_lost') { $name = ''; }
}
@@ -129,6 +140,7 @@ sub setup_rndseed {
$rndseed=time;
$ENV{'form.rndseed'}=$rndseed;
}
+ &Apache::lonxml::debug("Setting rndseed to $rndseed");
&Apache::run::run('$external::randomseed='.$rndseed.';',$safeeval);
}
return $rndseed;
@@ -140,13 +152,13 @@ sub problem_edit_header {
-
-
+
+