--- loncom/homework/structuretags.pm 2001/04/05 00:10:23 1.34 +++ loncom/homework/structuretags.pm 2001/05/04 21:21:45 1.36 @@ -46,6 +46,9 @@ sub start_problem { &Apache::run::run($expression,$safeeval); my $status; my $datemsg; + + my $result=&Apache::londefdef::start_html($target,$token,$parstack,$parser,$safeeval); + if ($target eq 'web' || $target eq 'grade') { ($status,$datemsg) = &Apache::lonhomework::check_date('0'); push (@Apache::inputtags::status,$status); @@ -55,7 +58,7 @@ sub start_problem { if ( $status eq 'CLOSED' ) { my $bodytext=&Apache::lonxml::get_all_text("/problem",$$parser[$#$parser]); if ( $target eq "web" ) { - return "
Problem is not open to be viewed. The problem $datemsg
"; + return $result."
Problem is not open to be viewed. The problem $datemsg
"; } } } @@ -70,13 +73,31 @@ sub start_problem { $Apache::lonhomework::name=$name; if ($status eq 'CAN_ANSWER') { # create a page header and exit - return "$name\n\n
".''; + $result.="$name\n + \n + ". + ''; + if ($ENV{'request.state'} eq "construct") { + $result.=' +
'; + } + return $result; } elsif ($status eq 'SHOW_ANSWER' || $status eq 'CANNOT_ANSWER' || $status eq 'CLOSED') { - return "$name\n\n"; + return $result."$name\n\n"; } } if ($target eq 'edit') { - return "\n".''; + $result.=' + + + + +
+'; + my $temp=&Apache::edit::insertlist($token,$target); + &Apache::lonxml::debug("edit gave me $temp"); + $result.=$temp; + return $result; } return ''; } @@ -319,30 +340,39 @@ sub end_solved { sub start_startouttext { my ($target,$token,$parstack,$parser,$safeeval)=@_; - my $result=''; - if ($target eq "edit" ) { $result=" "; } - return $result; + my @result=(''.''); + if ($target eq 'edit' || $target eq 'modified' ) { @result=('','no'); } + return (@result); } sub end_startouttext { my ($target,$token,$parstack,$parser,$safeeval)=@_; my $result=''; + my $text=''; + if ($target eq 'edit') { - $result=&Apache::lonxml::get_all_text("endouttext",$$parser[$#$parser]); - $result=&Apache::edit::editfield($token->[1],$result); + $text=&Apache::lonxml::get_all_text("endouttext",$$parser[$#$parser]); + $result= + &Apache::edit::tag_start("outtext"). + &Apache::edit::editfield($token->[1],$text,"Text Block"); + } + if ($target eq 'modified') { + $text=&Apache::lonxml::get_all_text("endouttext",$$parser['-1']); + $result=''.&Apache::edit::modifiedfield(); } return $result; } sub start_endouttext { my ($target,$token,$parstack,$parser,$safeeval)=@_; my $result=''; - if ($target eq "edit" ) { $result=" "; } + if ($target eq "edit" ) { $result=&Apache::edit::tag_end("outtext"); } + if ($target eq "modified") { $result=''; } return $result; } sub end_endouttext { my ($target,$token,$parstack,$parser,$safeeval)=@_; - my $result=''; - if ($target eq "edit" ) { $result=" "; } - return $result; + my @result=('',''); + if ($target eq "edit" || $target eq 'modified') { @result=('','no'); } + return (@result); }