--- loncom/homework/structuretags.pm 2006/06/24 01:33:40 1.332.2.4 +++ loncom/homework/structuretags.pm 2006/04/11 18:42:58 1.341 @@ -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.341 2006/04/11 18:42:58 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -36,6 +36,7 @@ use Apache::File(); use Apache::lonmenu; use Apache::lonlocal; use Apache::lonxml; +use Apache::lonenc(); use Time::HiRes qw( gettimeofday tv_interval ); BEGIN { &Apache::lonxml::register('Apache::structuretags',('block','languageblock','instructorcomment','while','randomlist','problem','library','web','tex','part','preduedate','postanswerdate','solved','notsolved','problemtype','startouttext','endouttext','simpleeditbutton','definetag')); @@ -88,10 +89,8 @@ sub body_tag_start { } $body_tag_start.='>'.&Apache::lonmenu::menubuttons(undef,$target,1); - &Apache::lontexconvert::jsMath_reset(); - if ($env{'environment.texengine'} eq 'jsMath') { - $body_tag_start.=&Apache::lontexconvert::jsMath_header(); - } + $body_tag_start.=&Apache::lontexconvert::init_math_support(); + return $body_tag_start; } @@ -156,9 +155,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 +460,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 +503,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 +515,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 +621,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.= '