--- loncom/homework/structuretags.pm 2003/10/09 21:49:24 1.215
+++ loncom/homework/structuretags.pm 2003/11/21 20:21:20 1.226
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# definition of tags that give a structure to a document
#
-# $Id: structuretags.pm,v 1.215 2003/10/09 21:49:24 albertel Exp $
+# $Id: structuretags.pm,v 1.226 2003/11/21 20:21:20 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -171,8 +171,10 @@ sub setup_rndseed {
if (defined($rndseed) && $rndseed ne int($rndseed)) {
$rndseed=join(',',&Math::Random::random_seed_from_phrase($rndseed));
}
- &Apache::lonxml::debug("Setting rndseed to $rndseed");
- &Apache::run::run('$external::randomseed='.$rndseed.';',$safeeval);
+ if ($safeeval) {
+ &Apache::lonxml::debug("Setting rndseed to $rndseed");
+ &Apache::run::run('$external::randomseed='.$rndseed.';',$safeeval);
+ }
}
return $rndseed;
}
@@ -400,7 +402,8 @@ sub start_problem {
if (( $status eq 'CLOSED' ) ||
( $status eq 'UNCHECKEDOUT') ||
( $status eq 'BANNED') ||
- ( $status eq 'UNAVAILABLE')) {
+ ( $status eq 'UNAVAILABLE') ||
+ ( $status eq 'INVALID_ACCESS')) {
my $bodytext=&Apache::lonxml::get_all_text("/problem",$parser);
if ( $target eq "web" ) {
$result.= $head_tag_start.'';
@@ -410,7 +413,7 @@ sub start_problem {
} else {
$result.='
'.&mt('Not open to be viewed').'
';
}
- if ($status eq 'CLOSED') {
+ if ($status eq 'CLOSED' || $status eq 'INVALID_ACCESS') {
$msg.='The problem '.$accessmsg;
} elsif ($status eq 'UNCHECKEDOUT') {
$msg.=&checkout_msg;
@@ -442,7 +445,8 @@ sub start_problem {
}
}
} elsif ($status eq 'SHOW_ANSWER' || $status eq 'CANNOT_ANSWER'
- || $status eq 'CLOSED' || $status eq 'UNAVALAILABLE') {
+ || $status eq 'CLOSED' || $status eq 'UNAVALAILABLE' ||
+ $status eq 'INVALID_ACCESS') {
$result.=$head_tag_start.
"$name\n$body_tag_start\n";
}
@@ -453,12 +457,12 @@ sub start_problem {
}
my $id = $Apache::inputtags::part;
my $weight = &Apache::lonnet::EXT("resource.$id.weight");
- my $allkeys=&Apache::lonnet::metadata($ENV{'request.uri'},'keys');
- my @allkeys = split /,/,$allkeys;
+ my $packages=&Apache::lonnet::metadata($ENV{'request.uri'},'packages');
+ my @packages = split /,/,$packages;
my $allow_print_points = 0;
- foreach my $partial_key (@allkeys) {
- if ($partial_key=~m/weight/) {
- $allow_print_points++;
+ foreach my $partial_key (@packages) {
+ if ($partial_key=~m/part_0/) {
+ $allow_print_points=1;
}
}
my $duedate = &Apache::lonnet::EXT("resource.$id.duedate");
@@ -499,6 +503,8 @@ sub start_problem {
} elsif ($target eq 'edit') {
$result.=$head_tag_start."".$body_tag_start.$form_tag_start.
&problem_edit_header();
+ $Apache::lonxml::warnings_error_header=
+ &mt("Editor Errors - these errors might not effect the running of the problem, but they will likely cause problems with further use of the Edit mode. Please use the EditXML mode to fix these errors.")."
";
my $temp=&Apache::edit::insertlist($target,$token);
$result.=$temp;
} elsif ($target eq 'modified') {
@@ -539,7 +545,7 @@ sub end_problem {
$result.="