--- loncom/interface/lonfeedback.pm 2010/08/14 18:14:29 1.290.2.2
+++ loncom/interface/lonfeedback.pm 2010/08/14 15:24:46 1.298
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Feedback
#
-# $Id: lonfeedback.pm,v 1.290.2.2 2010/08/14 18:14:29 raeburn Exp $
+# $Id: lonfeedback.pm,v 1.298 2010/08/14 15:24:46 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -58,15 +58,15 @@ sub discussion_open {
return 1;
}
# It was not explicitly open, check if the problem is available.
-# If the problem is not available, close the discussion
+# 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;
+ !($status eq 'CAN_ANSWER' || $status eq 'CANNOT_ANSWER'
+ || $status eq 'OPEN')) {
+ return 0;
}
# The problem is available, but check if the instructor explictly closed discussion
if (defined($close) && $close ne '' && $close < time) {
- return 0;
+ return 0;
}
return 1;
}
@@ -282,10 +282,6 @@ sub list_discussion {
my %anonhash=();
my $anoncnt=0;
my $target='';
- unless ($env{'browser.interface'} eq 'textual' ||
- $env{'environment.remote'} eq 'off' ) {
- $target='target="LONcom"';
- }
my $now = time;
$discinfo{$visitkey} = $visit;
@@ -425,7 +421,6 @@ imscp_v1p1.xsd http://www.imsglobal.org/
}
} else {
my $colspan=$maxdepth+1;
-#JW
$discussion.= &Apache::lonhtmlcommon::scripttag(qq|
function verifydelete (caller,symb,idx,newflag,previous,groupparm) {
var symbparm = symb+':::'+idx
@@ -727,7 +722,7 @@ END
$attachnum += @{$currnewattach};
}
}
- if (&discussion_open($status) && ($outputtarget ne 'tex')) {
+ if (&discussion_open($status)) {
if (($group ne '') && ($mode eq 'board')) {
if (&check_group_priv($group,'pgd') eq 'ok') {
$discussion .=
@@ -743,25 +738,31 @@ END
$currnewattach,$currdelold,'',$crstype);
}
}
- } elsif ($outputtarget ne 'tex') {
+ } else {
$discussion.='
';
if (&discussion_open($status) &&
&Apache::lonnet::allowed('pch',
$env{'request.course.id'}.
($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) {
- $discussion.= &send_feedback_link($ressymb,$target);
- if ($env{'request.role.adv'}) {
- my $close = &Apache::lonnet::EXT('resource.0.discussend',$ressymb);
- if (defined($close) && $close ne '' && $close < time) {
- $discussion .= ' '.&mt('(Closed for [_1] roles)',
- &Apache::lonnet::plaintext('st',$crstype));
+ if ($outputtarget ne 'tex') {
+ $discussion.= &send_feedback_link($ressymb,$target);
+ if ($env{'request.role.adv'}) {
+ my $close = &Apache::lonnet::EXT('resource.0.discussend',$ressymb);
+ if (defined($close) && $close ne '' && $close < time) {
+ $discussion .= ' '.&mt('(Closed for [_1] roles)',
+ &Apache::lonnet::plaintext('st',$crstype));
+ }
}
}
- } else {
- $discussion.= ''.&mt('This discussion is closed.').'';
+ } else {
+ if ($outputtarget ne 'tex') {
+ $discussion.= ''.&mt('This discussion is closed.').'';
+ }
}
- $discussion.= &send_message_link($ressymb).
- '
';
+ if ($outputtarget ne 'tex') {
+ $discussion.= &send_message_link($ressymb);
+ }
+ $discussion.='';
}
return $discussion;
}
@@ -841,6 +842,7 @@ sub action_links_bar {
sub postingform_display {
my ($mode,$ressymb,$now,$subject,$comment,$outputtarget,$attachnum,
$currnewattach,$currdelold,$group,$crstype) = @_;
+ if ($outputtarget eq 'tex') { return ''; }
my $newattachmsg;
my %lt = &Apache::lonlocal::texthash(
'note' => 'Note: in anonymous discussion, your name is visible only to course faculty',
@@ -865,7 +867,7 @@ sub postingform_display {
$lt{'note'} $lt{'title'}: