--- loncom/homework/outputtags.pm 2005/11/02 20:31:55 1.40 +++ 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.40 2005/11/02 20:31:55 albertel Exp $ +# $Id: outputtags.pm,v 1.41 2005/11/03 11:12:37 foxr Exp $ # # Copyright Michigan State University Board of Trustees # @@ -36,7 +36,9 @@ 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=(); } @@ -52,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); @@ -93,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; }