--- loncom/interface/lonfeedback.pm 2010/09/21 04:56:15 1.273.4.10
+++ loncom/interface/lonfeedback.pm 2009/12/07 15:46:16 1.281
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Feedback
#
-# $Id: lonfeedback.pm,v 1.273.4.10 2010/09/21 04:56:15 raeburn Exp $
+# $Id: lonfeedback.pm,v 1.281 2009/12/07 15:46:16 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -48,22 +48,13 @@ 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;
}
-# The problem is available, but check if the instructor explictly closed discussion
+ my $close=&Apache::lonnet::EXT('resource.0.discussend',$symb);
if (defined($close) && $close ne '' && $close < time) {
return 0;
}
@@ -100,7 +91,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') {
@@ -112,9 +103,12 @@ sub list_discussion {
my ($blocked,$blocktext) =
&Apache::loncommon::blocking_status('boards');
if ($blocked) {
+ $blocktext = '
'.$blocktext."";
&Apache::lonenc::check_encrypt(\$ressymb);
if ($mode ne 'board') {
- $blocktext.=' '.&send_message_link($ressymb);
+ $blocktext.=&send_message_link($ressymb).'
';
+ }else{
+ $blocktext.="";
}
return $blocktext;
}
@@ -180,7 +174,6 @@ sub list_discussion {
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 = ();
my %roleinfo = ();
@@ -363,10 +356,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);
@@ -409,8 +402,8 @@ sub list_discussion {
my $manifestfilename = $tempexport.$manifest;
if ($manifestfile = Apache::File->new('>'.$manifestfilename)) {
$manifestok=1;
- print $manifestfile qq|
-
+ print $manifestfile qq|
+
'.
''.&mt('Show all posts').' '.&mt('to display').' '.
@@ -537,11 +530,11 @@ imscp_v1p1.xsd http://www.imsglobal.org/
print $manifestfile "\n".
''.
- ''.$imsitems{$alldiscussion{$post}}{'title'}.'';
+ ''.$imsitems{$alldiscussion{$post}}{'title'}.'';
$imsresources .= "\n".
''."\n".
''."\n".
- $imsfiles{$alldiscussion{$post}}{$imsitems{$alldiscussion{$post}}{'currversion'}}.''."\n".
+ $imsfiles{$alldiscussion{$post}}{$imsitems{$alldiscussion{$post}}{'currversion'}}."\n".
'';
}
my $postingfile;
@@ -750,21 +743,13 @@ END
$env{'request.course.id'}.
($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) {
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 {
- if ($outputtarget ne 'tex') {
- $discussion.= ''.&mt('This discussion is closed.').'';
+ $discussion.= &send_feedback_link($ressymb,$target);
}
+ }
+ if ($outputtarget ne 'tex') {
+ $discussion.= &send_message_link($ressymb);
}
- $discussion.=&send_message_link($ressymb).'';
+ $discussion.='';
}
return $discussion;
}
@@ -774,9 +759,9 @@ sub send_feedback_link {
my $output = ''.
' '.
- ''.&mt('Post Discussion').'';
+ '" border="0" />'.&mt('Post Discussion').'';
return $output;
}
@@ -784,9 +769,9 @@ sub send_message_link {
my ($ressymb) = @_;
my $output = ''.
' '.&mt('Send Feedback').'';
+ '" border="0" />'.&mt('Send Feedback').'';
return $output;
}
@@ -799,7 +784,7 @@ sub action_links_bar {
if ($visible>2) {
$discussion .= ''.&mt('Threaded View').' '.
@@ -863,7 +848,7 @@ sub postingform_display {
$lt{'note'} $lt{'title'}:
-
+
ENDDISCUSS
if ($env{'form.origpage'}) {
$postingform .= '['.$$anonhash{$key}.'] '.
$screenname;
@@ -1039,7 +1023,6 @@ sub build_posting_display {
if ($see_anonymous) {
$sender.=&Apache::loncommon::student_image_tag($contrib{$idx.':senderdomain'},$contrib{$idx.':sendername'});
}
- $sender = ''.$sender.'';
# Set up for sorting by domain, then username
unless (defined($$usernamesort{$contrib{$idx.':senderdomain'}})) {
%{$$usernamesort{$contrib{$idx.':senderdomain'}}} = ();
@@ -1074,7 +1057,7 @@ sub build_posting_display {
$sender.=' '.&mt('Edit').'';
@@ -1100,7 +1083,7 @@ sub build_posting_display {
$sender.=' '.&mt('Hide').'';
@@ -1141,7 +1124,7 @@ sub build_posting_display {
$sender.=' '.&mt('Reply').'';
@@ -1262,24 +1245,24 @@ sub build_posting_display {
if ($prevread > 0 && $prevread <= $posttime) {
$$newitem{$idx} = 1;
$$discussionitems[$idx] .= '
-