--- loncom/homework/structuretags.pm 2002/11/10 15:39:37 1.134
+++ loncom/homework/structuretags.pm 2003/02/25 23:18:22 1.150
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# definition of tags that give a structure to a document
#
-# $Id: structuretags.pm,v 1.134 2002/11/10 15:39:37 albertel Exp $
+# $Id: structuretags.pm,v 1.150 2003/02/25 23:18:22 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -35,6 +35,7 @@ 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'));
@@ -43,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;
}
@@ -56,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.' ';
}
@@ -81,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 '') {
@@ -118,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 = ''; }
}
@@ -138,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;
@@ -149,13 +152,13 @@ sub problem_edit_header {
-
-