--- loncom/homework/structuretags.pm 2003/04/03 20:05:21 1.162
+++ loncom/homework/structuretags.pm 2003/05/14 16:49:13 1.173
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# definition of tags that give a structure to a document
#
-# $Id: structuretags.pm,v 1.162 2003/04/03 20:05:21 albertel Exp $
+# $Id: structuretags.pm,v 1.173 2003/05/14 16:49:13 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;
@@ -270,6 +271,13 @@ sub start_problem {
@Apache::structuretags::whileconds=();
@Apache::structuretags::whilebody=();
@Apache::structuretags::whileline=();
+ $Apache::lonhomework::scantronmode=0;
+ $Apache::lonhomework::problemstatus=
+ &Apache::lonnet::EXT('resource.0.problemstatus');
+
+ if (defined($ENV{'scantron.maxquest'})) {
+ $Apache::lonhomework::scantronmode=1;
+ }
if ($target ne 'analyze') {
&initialize_storage();
@@ -279,7 +287,7 @@ sub start_problem {
$Apache::lonhomework::type=&Apache::lonnet::EXT('resource.0.type');
&Apache::lonxml::debug("Found this to be of type :$Apache::lonhomework::type:");
}
- if ($Apache::lonhomework::type eq '') {
+ if ($Apache::lonhomework::type eq '' ) {
my $uri=$ENV{'request.uri'};
if ($uri=~/\.(\w+)$/) {
$Apache::lonhomework::type=$1;
@@ -319,11 +327,13 @@ sub start_problem {
#handle rand seed in construction space
my $rndseed=&setup_rndseed($safeeval);
my ($symb)=&Apache::lonxml::whichuser();
- if ($ENV{'request.state'} ne "construct" || $symb eq '') {
+ if ($ENV{'request.state'} ne "construct" && $symb eq '') {
$form_tag_start.=''.
'';
+ value="New Problem Variation" />'.
+ '';
}
($status,$accessmsg) = &Apache::lonhomework::check_access('0');
push (@Apache::inputtags::status,$status);
@@ -470,7 +480,8 @@ sub end_problem {
($target eq 'answer') || ($target eq 'tex')
) {
if ($status eq 'CAN_ANSWER') {
- if ($target ne 'tex') {
+ if ($target ne 'tex' &&
+ $ENV{'form.answer_output_mode'} ne 'tex') {
$result.="