--- loncom/interface/lonfeedback.pm 2004/07/21 23:57:24 1.101
+++ loncom/interface/lonfeedback.pm 2004/07/28 18:50:26 1.108
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Feedback
#
-# $Id: lonfeedback.pm,v 1.101 2004/07/21 23:57:24 raeburn Exp $
+# $Id: lonfeedback.pm,v 1.108 2004/07/28 18:50:26 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -36,6 +36,7 @@ use Apache::loncommon();
use Apache::lontexconvert();
use Apache::lonlocal; # must not have ()
use Apache::lonhtmlcommon();
+use Apache::lonspeller();
sub discussion_open {
my ($status)=@_;
@@ -124,7 +125,7 @@ sub list_discussion {
}
}
-# Get information about students and non-stundents in course for filtering display of posts
+# Get information about students and non-students in course for filtering display of posts
my %roleshash = ();
my %roleinfo = ();
if ($rolefilter) {
@@ -222,8 +223,10 @@ sub list_discussion {
$newpostsflag = 1;
}
my $hidden=($contrib{'hidden'}=~/\.$idx\./);
+ my $studenthidden=($contrib{'studenthidden'}=~/\.$idx\./);
my $deleted=($contrib{'deleted'}=~/\.$idx\./);
my $origindex='0.';
+ my $numoldver=0;
if ($contrib{$idx.':replyto'}) {
if ( (($ENV{'environment.threadeddiscussion'}) && (($sortposts eq '') || ($sortposts eq 'ascdate'))) || ($sortposts eq 'thread')) {
# this is a follow-up message
@@ -247,26 +250,51 @@ sub list_discussion {
}
unless ((($hidden) && (!$seeid)) || ($deleted)) {
$visible++;
- my $message=$contrib{$idx.':message'};
+ if ($contrib{$idx.':history'}) {
+ if ($contrib{$idx.':history'} =~ /:/) {
+ my @oldversions = split/:/,$contrib{$idx.':history'};
+ $numoldver = @oldversions;
+ } else {
+ $numoldver = 1;
+ }
+ }
+ my ($message,$subject);
+ if ($idx > 0) {
+ if ($contrib{$idx.':message'} =~ /.*::::\Q$numoldver\E::::(.+?)$/si) {
+ $message = $1;
+ } else {
+ $message = $contrib{$idx.':message'};
+ }
+ } else {
+ $message=$contrib{$idx.':message'};
+ }
+ my $attachmenturls = $contrib{$idx.':attachmenturl'};
$message=~s/\n/\
/g;
$message=&Apache::lontexconvert::msgtexconverted($message);
- my $subject=$contrib{$idx.':subject'};
+ if ($idx > 0) {
+ if ($contrib{$idx.':subject'} =~ /.*::::\Q$numoldver\E::::(.+?)$/si) {
+ $subject = $1;
+ } else {
+ $subject = $contrib{$idx.':subject'};
+ }
+ } else {
+ $subject=$contrib{$idx.':subject'};
+ }
if (defined($subject)) {
$subject=~s/\n/\
/g;
$subject=&Apache::lontexconvert::msgtexconverted($subject);
}
- if ($contrib{$idx.':attachmenturl'}) {
- my ($fname)
- =($contrib{$idx.':attachmenturl'}=~m|/([^/]+)$|);
- &Apache::lonnet::allowuploaded('/adm/feedback',
- $contrib{$idx.':attachmenturl'});
- $message.='
'.&mt('Attachment'). - ': '. - $fname.'
'; + if ($attachmenturls) { + my @attachments = (); + my %currattach = (); + &extract_attachments($attachmenturls,$idx,$numoldver,\$message,\@attachments,\%currattach); } if ($message) { if ($hidden) { $message=''.$message.''; + if ($studenthidden) { + $message .='