--- loncom/interface/lonfeedback.pm 2004/06/04 18:58:32 1.91
+++ loncom/interface/lonfeedback.pm 2004/06/12 01:07:10 1.94
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Feedback
#
-# $Id: lonfeedback.pm,v 1.91 2004/06/04 18:58:32 matthew Exp $
+# $Id: lonfeedback.pm,v 1.94 2004/06/12 01:07:10 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -37,25 +37,35 @@ use Apache::lontexconvert();
use Apache::lonlocal; # must not have ()
use Apache::lonhtmlcommon();
-sub discussion_closed {
+sub discussion_open {
my ($status)=@_;
- if (!($status eq 'CAN_ANSWER' || $status eq 'CANNOT_ANSWER'
+ if (defined($status) &&
+ !($status eq 'CAN_ANSWER' || $status eq 'CANNOT_ANSWER'
|| $status eq 'OPEN')) {
- return '1';
+ return 0;
}
my $close=&Apache::lonnet::EXT('resource.0.discussend');
if (defined($close) && $close ne '' && $close < time) {
- return '1'
+ return 0;
}
- return 0;
+ return 1;
+}
+
+sub discussion_visible {
+ my ($status)=@_;
+ if (not &discussion_open($status)) {
+ my $hidden=&Apache::lonnet::EXT('resource.0.discusshide');
+ if (lc($hidden) eq 'yes' or $hidden eq '' or !defined($hidden)) {
+ return 0;
+ }
+ }
+ return 1;
}
sub list_discussion {
my ($mode,$status,$symb)=@_;
- if (&discussion_closed($status)) {
- return '';
- }
+ if (not &discussion_visible($status)) { return ''; }
my @bgcols = ("#cccccc","#eeeeee");
my $discussiononly=0;
if ($mode eq 'board') { $discussiononly=1; }
@@ -259,7 +269,7 @@ sub list_discussion {
$sender=''.$screenname.'';
}
}
- if (!&discussion_closed($status) &&
+ if (&discussion_open($status) &&
&Apache::lonnet::allowed('pch',
$ENV{'request.course.id'}.
($ENV{'request.course.sec'}?'/'.$ENV{'request.course.sec'}:''))) {
@@ -424,7 +434,7 @@ sub list_discussion {
Note: in anonymous discussion, your name is visible only to
course faculty
Title:
-
+
Attachment (128 KB max size):
@@ -432,7 +442,7 @@ Attachment (128 KB max size): print(<-
Attachment (128 KB max size): @@ -552,7 +567,7 @@ Attachment (128 KB max size): ENDDOCUMENT $r->print(&generate_preview_button(). -&Apache::lonhtmlcommon::htmlareaactive(). +&Apache::lonhtmlcommon::htmlareaselectactive('comment'). '