--- loncom/homework/structuretags.pm 2001/07/13 14:02:35 1.47 +++ loncom/homework/structuretags.pm 2001/07/18 20:08:34 1.48 @@ -8,7 +8,7 @@ use strict; use Apache::lonnet; sub BEGIN { - &Apache::lonxml::register('Apache::structuretags',('block','while','randomlist','problem','web','tex','part','preduedate','postanswerdate','solved','notsolved','startouttext','endouttext')); + &Apache::lonxml::register('Apache::structuretags',('block','while','randomlist','problem','library','web','tex','part','preduedate','postanswerdate','solved','notsolved','startouttext','endouttext')); # &Apache::lonxml::register_insert('problem','',('part','postanswerdate','preduedate')) } @@ -38,6 +38,16 @@ sub end_tex { return ''; } +sub page_start { + my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; + my $result=&Apache::londefdef::start_html($target,$token,$tagstack,$parstack,$parser,$safeeval); + my $head_tag_start=''.&Apache::lonxml::registerurl(); + my $body_tag_start=''; + return ($result,$head_tag_start,$body_tag_start); +} + sub start_problem { my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; @@ -56,12 +66,9 @@ sub start_problem { my $datemsg; #should get back a or the neccesary stuff to start XML/MathML - my $result=&Apache::londefdef::start_html($target,$token,$tagstack,$parstack,$parser,$safeeval); + my ($result,$head_tag_start,$body_tag_start)= + &page_start($target,$token,$tagstack,$parstack,$parser,$safeeval); - my $head_tag_start=''.&Apache::lonxml::registerurl(); - my $body_tag_start=''; if ($target eq 'web' || $target eq 'grade') { ($status,$datemsg) = &Apache::lonhomework::check_date('0'); push (@Apache::inputtags::status,$status); @@ -151,6 +158,39 @@ sub end_problem { $result='
'; } return $result; +} + +sub start_library { + my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; + my ($result,$head_tag_start,$body_tag_start)= + &page_start($target,$token,$tagstack,$parstack,$parser,$safeeval); + if ($target eq 'edit') { + $result.=$head_tag_start."".$body_tag_start. + '
+ + + +
+ '; + my $temp=&Apache::edit::insertlist($target,$token); + $result.=$temp; + return $result; + } + if ($target eq 'modified') { + $result=$token->[4]; + $result.=&Apache::edit::handle_insert(); + return $result; + } + return ''; +} + +sub end_library { + my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; + my $result=''; + if ($target eq 'edit') { + $result='
'; + } + return $result; } sub start_block {