--- loncom/homework/structuretags.pm 2003/04/03 21:58:09 1.164
+++ loncom/homework/structuretags.pm 2003/05/19 21:05:23 1.176
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# definition of tags that give a structure to a document
#
-# $Id: structuretags.pm,v 1.164 2003/04/03 21:58:09 albertel Exp $
+# $Id: structuretags.pm,v 1.176 2003/05/19 21:05:23 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -38,7 +38,7 @@ 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'));
+ &Apache::lonxml::register('Apache::structuretags',('block','languageblock','instructorcomment','while','randomlist','problem','library','web','tex','part','preduedate','postanswerdate','solved','notsolved','startouttext','endouttext'));
}
sub start_web {
@@ -104,8 +104,9 @@ sub page_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 ($symb,undef,undef,undef,$publicuser)=
+ &Apache::lonxml::whichuser();
+ if ($symb eq '' && !$publicuser) {
my $help = &Apache::loncommon::help_open_topic("Ambiguous_Reference");
$help="Browsing resource, all submissions are temporary.
";
$body_tag_start.=$help;
@@ -145,8 +146,13 @@ sub setup_rndseed {
$ENV{'form.rndseed'}=$rndseed;
}
}
- if ($ENV{'form.resetdata'} eq 'New Problem Variation') {
+ if ($ENV{'form.resetdata'} eq 'New Problem Variation' ||
+ $ENV{'form.newrandomization'} eq 'New Randomization') {
$rndseed=time;
+ if ($rndseed eq $ENV{'form.rndseed'}) {
+ srand($rndseed);
+ $rndseed=int(rand(1000000000));
+ }
$ENV{'form.rndseed'}=$rndseed;
}
&Apache::lonxml::debug("Setting rndseed to $rndseed");
@@ -176,19 +182,24 @@ sub problem_web_to_edit_header {
my $result.='
- Random Seed:
-
+
+