--- loncom/homework/structuretags.pm 2002/11/12 05:05:27 1.136 +++ loncom/homework/structuretags.pm 2002/11/13 23:37:56 1.137 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: structuretags.pm,v 1.136 2002/11/12 05:05:27 albertel Exp $ +# $Id: structuretags.pm,v 1.137 2002/11/13 23:37:56 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -502,6 +502,9 @@ sub start_block { if ($code) { $code =~ s/\"//g; $code .=';return $condition;'; + if (!$Apache::lonxml::default_homework_loaded) { + &Apache::lonxml::default_homework_load($safeeval); + } $result = &Apache::run::run($code,$safeeval); &Apache::lonxml::debug("block :$code: returned :$result:"); } else { @@ -537,6 +540,9 @@ sub start_while { $code .=';return $condition;'; push( @Apache::structuretags::whileconds, $code); + if (!$Apache::lonxml::default_homework_loaded) { + &Apache::lonxml::default_homework_load($safeeval); + } my $result = &Apache::run::run($code,$safeeval); my $bodytext=$$parser[$#$parser]->get_text("/while"); push( @Apache::structuretags::whilebody, $bodytext);