--- loncom/interface/lonfeedback.pm 2007/02/23 00:39:31 1.242
+++ loncom/interface/lonfeedback.pm 2010/08/20 04:49:11 1.273.4.9
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Feedback
#
-# $Id: lonfeedback.pm,v 1.242 2007/02/23 00:39:31 albertel Exp $
+# $Id: lonfeedback.pm,v 1.273.4.9 2010/08/20 04:49:11 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -48,13 +48,22 @@ use LONCAPA;
sub discussion_open {
my ($status,$symb)=@_;
+# Advanced roles can always discuss
if ($env{'request.role.adv'}) { return 1; }
+# Get discussion closing date
+ my $close=&Apache::lonnet::EXT('resource.0.discussend',$symb);
+# If it is defined and in the future, the instructor wants this discussion to be open
+ if (defined($close) && $close ne '' && $close > time) {
+ return 1;
+ }
+# It was not explicitly open, check if the problem is available.
+# If the problem is not available, close the discussion
if (defined($status) &&
!($status eq 'CAN_ANSWER' || $status eq 'CANNOT_ANSWER'
|| $status eq 'OPEN')) {
return 0;
}
- my $close=&Apache::lonnet::EXT('resource.0.discussend',$symb);
+# The problem is available, but check if the instructor explictly closed discussion
if (defined($close) && $close ne '' && $close < time) {
return 0;
}
@@ -91,7 +100,7 @@ sub list_discussion {
if (not &discussion_visible($status)) {
if ($mode ne 'board') {
&Apache::lonenc::check_encrypt(\$ressymb);
- return &send_message_link($ressymb);
+ return ' '.&send_message_link($ressymb);
}
}
if ($group ne '' && $mode eq 'board') {
@@ -110,7 +119,7 @@ sub list_discussion {
return $blocktext;
}
- my @bgcols = ("#cccccc","#eeeeee");
+ my @bgcols = ("LC_disc_old_item","LC_disc_new_item");
my $discussiononly=0;
if ($mode eq 'board') { $discussiononly=1; }
unless ($env{'request.course.id'}) { return ''; }
@@ -169,6 +178,8 @@ sub list_discussion {
my $cdom = $env{'course.'.$cid.'.domain'};
my $cnum = $env{'course.'.$cid.'.num'};
+ my $crstype = &Apache::loncommon::course_type();
+
# Get information about students and non-students in course for filtering display of posts
my %roleshash = ();
@@ -352,10 +363,10 @@ sub list_discussion {
$togglink = 'toggoff';
}
- $chglink .= '&changes='.$displinkA.'_'.$displinkB.'_'.$marklink.'_'.$togglink;
+ $chglink .= '&changes='.$displinkA.'_'.$displinkB.'_'.$marklink.'_'.$togglink;
if ($newpostsflag) {
- $chglink .= '&previous='.$prevread;
+ $chglink .= '&previous='.$prevread;
}
$chglink.=&group_args($group);
@@ -398,8 +409,8 @@ sub list_discussion {
my $manifestfilename = $tempexport.$manifest;
if ($manifestfile = Apache::File->new('>'.$manifestfilename)) {
$manifestok=1;
- print $manifestfile qq|
-
+ print $manifestfile qq|
+
|;
- $discussion.='