--- loncom/interface/lonfeedback.pm 2010/09/21 04:56:15 1.273.4.10
+++ loncom/interface/lonfeedback.pm 2009/08/12 16:03:58 1.276
@@ -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.276 2009/08/12 16:03:58 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;
}
@@ -178,8 +172,6 @@ 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 = ();
@@ -363,10 +355,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 +401,8 @@ sub list_discussion {
my $manifestfilename = $tempexport.$manifest;
if ($manifestfile = Apache::File->new('>'.$manifestfilename)) {
$manifestok=1;
- print $manifestfile qq|
-
+ print $manifestfile qq|
+
';
+ $discussion .= '">'.&mt('Mark NEW posts no longer new').'';
} else {
$discussion .= '
';
}
@@ -843,7 +829,7 @@ sub action_links_bar {
sub postingform_display {
my ($mode,$ressymb,$now,$subject,$comment,$outputtarget,$attachnum,
- $currnewattach,$currdelold,$group,$crstype) = @_;
+ $currnewattach,$currdelold,$group) = @_;
my $newattachmsg;
my %lt = &Apache::lonlocal::texthash(
'note' => 'Note: in anonymous discussion, your name is visible only to course faculty',
@@ -852,9 +838,6 @@ sub postingform_display {
'poan' => 'Post Anonymous Discussion',
'newa' => 'New attachments',
);
- if ($crstype eq 'Community') {
- $lt{'note'} = &mt('Note: in anonymous discussion, your name is visible only to community facilitators');
- }
my $postingform = (<
@@ -863,7 +846,7 @@ sub postingform_display {
$lt{'note'} $lt{'title'}:
-
+
ENDDISCUSS
if ($env{'form.origpage'}) {
$postingform .= '\n";
if ($outputtarget ne 'tex') {
@@ -1031,7 +1014,6 @@ sub build_posting_display {
$contrib{$idx.':senderdomain'}).' ('.
$contrib{$idx.':sendername'}.':'.
$contrib{$idx.':senderdomain'}.')';
- $sender = ''.$sender.'';
if ($contrib{$idx.':anonymous'}) {
$sender.=' ['.$$anonhash{$key}.'] '.
$screenname;
@@ -1039,7 +1021,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 +1055,7 @@ sub build_posting_display {
$sender.=' '.&mt('Edit').'';
@@ -1100,7 +1081,7 @@ sub build_posting_display {
$sender.=' '.&mt('Hide').'';
@@ -1141,7 +1122,7 @@ sub build_posting_display {
$sender.=' '.&mt('Reply').'';
@@ -1262,24 +1243,24 @@ sub build_posting_display {
if ($prevread > 0 && $prevread <= $posttime) {
$$newitem{$idx} = 1;
$$discussionitems[$idx] .= '
-
';
}
@@ -1716,6 +1698,7 @@ END
END
}
$r->print(<
$quote
$lt{'myqu'}
@@ -1725,8 +1708,9 @@ $latexHelp
$lt{'title'}:
-
+
END
if ( ($env{'form.editdisc'}) || ($env{'form.replydisc'}) ) {
if ($env{'form.origpage'}) {
@@ -1748,7 +1732,6 @@ END
}
} else {
$r->print(<
$lt{'atta'} $attachmaxtext:
END
@@ -1762,7 +1745,7 @@ END
$r->print(<
-
+
END
@@ -1969,9 +1952,9 @@ END
$r->print(<$lt{'disa'}
$lt{$discdisp}
-
+
-
+
END
$r->print(&Apache::loncommon::end_data_table_row());
@@ -1986,7 +1969,7 @@ END
$r->print(<$lt{'dotm'}
$lt{$disctogg}
-
+
END
my $save = &mt('Save');
$r->print(&Apache::loncommon::end_data_table_row());
@@ -2000,7 +1983,7 @@ END
-
+
END
if (exists($env{'form.group'})) {
$r->print('');
@@ -2031,13 +2014,6 @@ sub print_sortfilter_options {
my $group_sel = '';
my $numgroupvis = 5;
my %sectioncount = &Apache::loncommon::get_sections();
- my @courseroles = qw(st ad ep ta in);
- my $crstype = &Apache::loncommon::course_type();
- my $ccrole = 'cc';
- if ($crstype eq 'Community') {
- $ccrole = 'co';
- }
- push(@courseroles,$ccrole);
if ($env{'request.course.sec'} !~ /^\s*$/) { #Restrict section choice to current section
@sections = ('all',$env{'request.course.sec'});
@@ -2101,7 +2077,7 @@ sub print_sortfilter_options {
my %sort_types = ();
my %role_types = ();
my %status_types = ();
- &sort_filter_names(\%sort_types,\%role_types,\%status_types,$crstype);
+ &sort_filter_names(\%sort_types,\%role_types,\%status_types);
my $js = <
@@ -2153,17 +2129,17 @@ $start_page
-
$lt{'soor'}
-
-
$lt{'sprs'}
-
-
$lt{'spur'}
-
-
$lt{'spse'}
-
-
$lt{'spgr'}
-
-
$lt{'psub'}
+
$lt{'soor'}
+
+
$lt{'sprs'}
+
+
$lt{'spur'}
+
+
$lt{'spse'}
+
+
$lt{'spgr'}
+
+
$lt{'psub'}
@@ -2190,11 +2166,10 @@ $start_page
@@ -2218,7 +2193,7 @@ $start_page
-
+
END
if (exists($env{'form.group'})) {
$r->print('');
@@ -2341,7 +2316,7 @@ END
-
+
$end_page
END
@@ -2444,7 +2419,7 @@ sub redirect_back {
if ($previous > 0) {
$qrystr = 'previous='.$previous;
if ($feedurl =~ /\?register=1/) {
- $feedurl .= '&'.$qrystr;
+ $feedurl .= '&'.$qrystr;
} else {
$feedurl .= '?'.$qrystr;
}
@@ -2453,14 +2428,14 @@ sub redirect_back {
if (defined($sort)) {
my $sortqry = 'sortposts='.$sort;
if (($feedurl =~ /\?register=1/) || ($feedurl =~ /\?previous=/)) {
- $feedurl .= '&'.$sortqry;
+ $feedurl .= '&'.$sortqry;
} else {
$feedurl .= '?'.$sortqry;
}
$sorttag = '';
if (defined($numpicks)) {
my $userpickqry = 'totposters='.$numpicks;
- $feedurl .= '&'.$userpickqry;
+ $feedurl .= '&'.$userpickqry;
$userpicktag = '';
} else {
if (ref($sectionpick) eq 'ARRAY') {
@@ -2474,7 +2449,7 @@ sub redirect_back {
$sectag =~ s/,$//;
$sectag .= '" />';
} else {
- $feedurl .= '§ionpick='.$sectionpick;
+ $feedurl .= '§ionpick='.$sectionpick;
$sectag = '';
}
if (ref($grouppick) eq 'ARRAY') {
@@ -2488,7 +2463,7 @@ sub redirect_back {
$grptag =~ s/,$//;
$grptag .= '" />';
} else {
- $feedurl .= '&grouppick='.$grouppick;
+ $feedurl .= '&grouppick='.$grouppick;
$grptag = '';
}
if (ref($rolefilter) eq 'ARRAY') {
@@ -2505,7 +2480,7 @@ sub redirect_back {
$feedurl .= '&rolefilter='.$rolefilter;
$roletag = '';
}
- $feedurl .= '&statusfilter='.$statusfilter;
+ $feedurl .= '&statusfilter='.$statusfilter;
$statustag ='';
}
}
@@ -2594,22 +2569,6 @@ ENDNOREDIRTWO
sub screen_header {
my ($feedurl,$symb) = @_;
- my $crscontent = &mt('Question/Comment/Feedback about course content');
- my $crspolicy = &mt('Question/Comment/Feedback about course policy');
- my $contribdisc = &mt('Contribution to course discussion of resource');
- my $anoncontrib = &mt('Anonymous contribution to course discussion of resource');
- my $namevis = &mt('name only visible to course faculty');
- my $crstype;
- if ($env{'request.course.id'}) {
- $crstype = &Apache::loncommon::course_type();
- if ($crstype eq 'Community') {
- $crscontent = &mt('Question/Comment/Feedback about community content');
- $crspolicy = &mt('Question/Comment/Feedback about community policy');
- $contribdisc = &mt('Contribution to community discussion of resource');
- $anoncontrib = &mt('Anonymous contribution to community discussion of resource');
- $namevis = &mt('name only visible to community facilitators');
- }
- }
my $msgoptions='';
my $discussoptions='';
unless (($env{'form.replydisc'}) || ($env{'form.editdisc'})) {
@@ -2630,13 +2589,13 @@ sub screen_header {
if (&feedback_available(0,1)) {
$msgoptions.=
'';
}
if (&feedback_available(0,0,1)) {
$msgoptions.=
'';
}
}
@@ -2647,26 +2606,25 @@ sub screen_header {
$env{'request.course.id'}.
($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) {
$discussoptions=' '.
-
+ &mt('Contribution to course discussion of resource');
+ $discussoptions.=' '.
''.&mt('Change Screenname').'';
my $blockblog = &Apache::loncommon::blocking_status('blogs');
if (!$blockblog) {
- $discussoptions.= &add_blog_checkbox($crstype);
+ $discussoptions.= &add_blog_checkbox();
}
}
}
if ($msgoptions) {
$msgoptions='