--- loncom/interface/lonfeedback.pm 2003/11/03 20:34:54 1.65 +++ loncom/interface/lonfeedback.pm 2003/11/04 03:32:55 1.67 @@ -1,7 +1,7 @@ # The LearningOnline Network # Feedback # -# $Id: lonfeedback.pm,v 1.65 2003/11/03 20:34:54 www Exp $ +# $Id: lonfeedback.pm,v 1.67 2003/11/04 03:32:55 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -73,12 +73,14 @@ sub list_discussion { my %contrib=&Apache::lonnet::restore($symb,$ENV{'request.course.id'}, $ENV{'course.'.$ENV{'request.course.id'}.'.domain'}, $ENV{'course.'.$ENV{'request.course.id'}.'.num'}); + my $visible=0; if ($contrib{'version'}) { for (my $id=1;$id<=$contrib{'version'};$id++) { my $idx=$id; my $hidden=($contrib{'hidden'}=~/\.$idx\./); my $deleted=($contrib{'deleted'}=~/\.$idx\./); unless ((($hidden) && (!$seeid)) || ($deleted)) { + $visible++; my $message=$contrib{$idx.':message'}; $message=~s/\n/\
/g; $message=&Apache::lontexconvert::msgtexconverted($message); @@ -148,9 +150,14 @@ sub list_discussion { } } } - my $discussion='
'; - foreach (sort { $a <=> $b } keys %discussionitems) { - $discussion.=$discussionitems{$_}; + my $discussion=''; + if ($visible) { + $discussion.=''; + foreach (sort { $a <=> $b } keys %discussionitems) { + $discussion.="\n"; + } + $discussion.='
".$discussionitems{$_}. + "
'; } if ($discussiononly) { $discussion.=(< $attachmenturl); if ($ENV{'form.replydisc'}) { - $contrib{'replyto'}=$ENV{'form.replydisc'}; + $contrib{'replyto'}=(split(/\:\:\:/,$ENV{'form.replydisc'}))[1]; } if ($anon) { $contrib{'anonymous'}='true'; @@ -657,7 +664,14 @@ sub handler { $feedurl=~s/^$ENV{'HTTP_HOST'}//; $feedurl=~s/\?.+$//; - my $symb=&Apache::lonnet::symbread($feedurl); + my $symb; + if ($ENV{'form.replydisc'}) { + $symb=(split(/\:\:\:/,$ENV{'form.replydisc'}))[0]; + my ($map,$id,$url)=&Apache::lonnet::decode_symb($symb); + $feedurl=&Apache::lonnet::clutter($url); + } else { + $symb=&Apache::lonnet::symbread($feedurl); + } unless ($symb) { $symb=$ENV{'form.symb'}; if ($symb) {