--- loncom/homework/structuretags.pm 2006/06/24 01:33:40 1.332.2.4 +++ loncom/homework/structuretags.pm 2006/03/02 21:20:30 1.337 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: structuretags.pm,v 1.332.2.4 2006/06/24 01:33:40 albertel Exp $ +# $Id: structuretags.pm,v 1.337 2006/03/02 21:20:30 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -44,7 +44,7 @@ BEGIN { sub start_web { my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; my $bodytext=&Apache::lonxml::get_all_text("/web",$parser,$style); - if ($target eq 'web' || $target eq 'webgrade') { + if ($target eq 'web') { return $bodytext; } return ''; @@ -156,9 +156,8 @@ sub page_start { } my $form_tag_start; if (!defined($found{'form'})) { - $form_tag_start='
'Checking out resources is subject to course policies, and may exclude future credit even if done erroneously.', 'checkout'=>'Check out Exam for Viewing', 'checkout?'=>'Check out Exam?'); - my $uri = &Apache::lonenc::check_encrypt($env{'request.uri'}); return (<$lt{'resource'}

$lt{'id_expln'}

$lt{'warning'}

- + @@ -448,10 +461,9 @@ sub firstaccess_msg { my ($map)=&Apache::lonnet::decode_symb($symb); my $foldertitle=&Apache::lonnet::gettitle($map); &Apache::lonxml::debug("map is $map title is $foldertitle"); - my $uri = &Apache::lonenc::check_encrypt($env{'request.uri'}); return (<The resources in "$foldertitle" are open for a limited time. Once you click the 'Show Resource' button below you have $time to complete all resources "$foldertitle". -
+
@@ -492,9 +504,7 @@ sub init_problem_globals { @Apache::structuretags::whileline=(); $Apache::lonhomework::scantronmode=0; undef($Apache::lonhomework::name); - undef($Apache::lonhomework::default_type); - undef($Apache::lonhomework::type); - undef($Apache::lonhomework::problemstatus); + } sub reset_problem_globals { @@ -506,11 +516,6 @@ sub reset_problem_globals { #detect if we try to do 2 problems in one file # undef($Apache::lonhomework::parsing_a_problem); undef($Apache::lonhomework::name); - undef($Apache::lonhomework::default_type); - undef($Apache::lonhomework::type); - undef($Apache::lonhomework::scantronmode); - undef($Apache::lonhomework::problemstatus); - undef($Apache::lonhomework::ignore_response_errors); } sub set_problem_state { @@ -617,14 +622,18 @@ 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 '' || $Apache::lonhomework::type eq 'practice')) { $form_tag_start.=''. ''. + value="'.&mt('New Problem Variation').'" />'; + if (exists($env{'form.username'})) { + $form_tag_start.= ''; - if ($env{'user.adv'}) { + } + if ($env{'request.role.adv'}) { $form_tag_start.= '