--- loncom/interface/lonfeedback.pm 2004/06/03 14:28:39 1.88
+++ loncom/interface/lonfeedback.pm 2004/06/04 18:58:32 1.91
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Feedback
#
-# $Id: lonfeedback.pm,v 1.88 2004/06/03 14:28:39 www Exp $
+# $Id: lonfeedback.pm,v 1.91 2004/06/04 18:58:32 matthew Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -37,14 +37,25 @@ use Apache::lontexconvert();
use Apache::lonlocal; # must not have ()
use Apache::lonhtmlcommon();
-sub list_discussion {
- my ($mode,$status,$symb)=@_;
-# &Apache::lonnet::logthis("status is $status");
+sub discussion_closed {
+ my ($status)=@_;
if (!($status eq 'CAN_ANSWER' || $status eq 'CANNOT_ANSWER'
|| $status eq 'OPEN')) {
- return '';
+ return '1';
}
+ my $close=&Apache::lonnet::EXT('resource.0.discussend');
+ if (defined($close) && $close ne '' && $close < time) {
+ return '1'
+ }
+ return 0;
+}
+sub list_discussion {
+ my ($mode,$status,$symb)=@_;
+
+ if (&discussion_closed($status)) {
+ return '';
+ }
my @bgcols = ("#cccccc","#eeeeee");
my $discussiononly=0;
if ($mode eq 'board') { $discussiononly=1; }
@@ -248,7 +259,8 @@ sub list_discussion {
$sender=''.$screenname.'';
}
}
- if (&Apache::lonnet::allowed('pch',
+ if (!&discussion_closed($status) &&
+ &Apache::lonnet::allowed('pch',
$ENV{'request.course.id'}.
($ENV{'request.course.sec'}?'/'.$ENV{'request.course.sec'}:''))) {
$sender.=' $email,
|