--- loncom/homework/bridgetask.pm 2005/10/24 18:40:21 1.73 +++ loncom/homework/bridgetask.pm 2005/11/03 21:29:57 1.74 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: bridgetask.pm,v 1.73 2005/10/24 18:40:21 albertel Exp $ +# $Id: bridgetask.pm,v 1.74 2005/11/03 21:29:57 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -382,6 +382,9 @@ sub start_Task { &Apache::structuretags::init_problem_globals('Task'); &Apache::structuretags::initialize_storage(); &Apache::lonhomework::showhash(%Apache::lonhomework::history); + if ($env{'request.state'} eq 'construct') { + &Apache::structuretags::setup_rndseed($safeeval); + } } $Apache::lonhomework::parsing_a_task=1; @@ -389,7 +392,7 @@ sub start_Task { my ($result,$head_tag_start,$body_tag_start,$form_tag_start)= &Apache::structuretags::page_start($target,$token,$tagstack,$parstack,$parser,$safeeval); - if ($target eq 'web') { + if ($target eq 'web' && $env{'request.state'} ne 'construct') { if ($Apache::lonhomework::modifygrades) { $body_tag_start.='
'.$body_tag_start; + if ($env{'request.state'} eq 'construct') { + $result.=$form_tag_start; + } my $msg; if ($status eq 'UNAVAILABLE') { $msg.='

'.&mt('Unable to determine if this resource is open due to network problems. Please try again later.').'

'; @@ -553,6 +562,13 @@ DONESCREEN } if ($webgrade eq 'yes') { $result.=&webgrade_standard_info(); } } + } elsif ($target eq 'edit') { + $result.=$head_tag_start."".$body_tag_start.$form_tag_start. + &Apache::structuretags::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; } else { # page_start returned a starting result, delete it if we don't need it $result = '';