--- loncom/homework/outputtags.pm 2005/10/11 10:48:23 1.39 +++ loncom/homework/outputtags.pm 2005/11/03 11:12:37 1.41 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # tags that create controlled output # -# $Id: outputtags.pm,v 1.39 2005/10/11 10:48:23 foxr Exp $ +# $Id: outputtags.pm,v 1.41 2005/11/03 11:12:37 foxr Exp $ # # Copyright Michigan State University Board of Trustees # @@ -29,13 +29,16 @@ package Apache::outputtags; use strict; +use Apache::lonlocal; use Apache::lonnet; use POSIX qw(strftime); BEGIN { &Apache::lonxml::register('Apache::outputtags',('displayduedate','displaytitle','displayweight','displaystudentphoto')); } - +# Empties the hash of tags that have already been displayed +# that should only be displayed once. +# sub initialize_outputtags { %Apache::outputtags::showonce=(); } @@ -51,9 +54,11 @@ sub start_displayduedate { if (exists($Apache::outputtags::showonce{'displayduedate'})) { if (grep(/^\Q$Apache::inputtags::part\E$/, @{$Apache::outputtags::showonce{'displayduedate'}})) { - return ''; + return ''; # Already shown the duedate for this part. } } + # since we will show the duedate for this part, remeber it. + push (@{$Apache::outputtags::showonce{'displayduedate'}}, $Apache::inputtags::part); @@ -92,6 +97,9 @@ sub start_displayduedate { $result=&Apache::edit::tag_start($target,$token); $result.=''; $result.=&Apache::edit::end_table(); + } elsif {$target eq 'tex'} { + # print target. + $result =''; # Stubbed off for now. } return $result; }