--- loncom/homework/structuretags.pm 2005/04/18 22:39:35 1.288 +++ loncom/homework/structuretags.pm 2005/12/22 22:06:54 1.328 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: structuretags.pm,v 1.288 2005/04/18 22:39:35 albertel Exp $ +# $Id: structuretags.pm,v 1.328 2005/12/22 22:06:54 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -42,8 +42,8 @@ BEGIN { } sub start_web { - my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; - my $bodytext=&Apache::lonxml::get_all_text("/web",$parser); + my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; + my $bodytext=&Apache::lonxml::get_all_text("/web",$parser,$style); if ($target eq 'web') { return $bodytext; } @@ -55,9 +55,9 @@ sub end_web { } sub start_tex { - my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; + my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; my $result=''; - my $bodytext=&Apache::lonxml::get_all_text("/tex",$parser); + my $bodytext=&Apache::lonxml::get_all_text("/tex",$parser,$style); if ($target eq 'tex') { return $bodytext.' '; } @@ -68,6 +68,33 @@ sub end_tex { return ''; } +sub body_tag_start { + my ($target,$background,$bgcolor)=@_; + my $body_tag_start=''."\n"; - } - if ($target eq 'web' && $env{'request.state'} ne 'construct') { + } elsif (!defined($found{'body'})) { + my $background=&Apache::lonxml::get_param('background',$parstack, + $safeeval); + my $bgcolor=&Apache::lonxml::get_param('bgcolor',$parstack, + $safeeval); + $body_tag_start=&body_tag_start($target,$background,$bgcolor); + if ( ($target eq 'web' || $target eq 'webgrade') + && $env{'request.state'} ne 'construct') { my ($symb,undef,undef,undef,$publicuser)= &Apache::lonxml::whichuser(); if ($symb eq '' && !$publicuser) { @@ -137,7 +153,11 @@ sub page_start { $form_tag_start='
'; + $form_tag_start.=$uri.'" '; + if ($target eq 'edit') { + $form_tag_start.=&Apache::edit::form_change_detection(); + } + $form_tag_start.='>'; } return ($result,$head_tag_start,$body_tag_start,$form_tag_start); } @@ -168,6 +188,8 @@ sub setup_rndseed { my ($symb)=&Apache::lonxml::whichuser(); if ($env{'request.state'} eq "construct" || $symb eq '' || $Apache::lonhomework::history{'resource.CODE'}) { + &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, + ['rndseed']); $rndseed=$env{'form.rndseed'}; if (!$rndseed) { $rndseed=$Apache::lonhomework::history{'rndseed'}; @@ -185,7 +207,7 @@ sub setup_rndseed { delete($env{'form.newrandomization'}); } if (defined($rndseed) && $rndseed ne int($rndseed)) { - $rndseed=join(',',&Math::Random::random_seed_from_phrase($rndseed)); + $rndseed=join(':',&Apache::lonnet::digest($rndseed)); } if ($Apache::lonhomework::history{'resource.CODE'}) { $rndseed=&Apache::lonnet::rndseed(); @@ -210,7 +232,7 @@ sub problem_edit_header { &Apache::structuretags::remember_problem_state().' - +
'. @@ -238,9 +260,11 @@ sub option { sub problem_web_to_edit_header { my ($rndseed)=@_; - my $result.=' - - + my $result.=''; + if (!$Apache::lonhomework::parsing_a_task) { + $result .= ''; + } + $result .= ' @@ -248,11 +272,17 @@ sub problem_web_to_edit_header { $rndseed.'" onchange="javascript:document.lonhomework.changerandseed.click()" />