[LON-CAPA-cvs] cvs: loncom /interface lonfeedback.pm

www lon-capa-cvs@mail.lon-capa.org
Fri, 13 Feb 2004 15:03:39 -0000


www		Fri Feb 13 10:03:39 2004 EDT

  Modified files:              
    /loncom/interface	lonfeedback.pm 
  Log:
  Bug #2712: reply works on bulletin boards
  Bug #2696: reply to anonymous postings possible
  
  
Index: loncom/interface/lonfeedback.pm
diff -u loncom/interface/lonfeedback.pm:1.76 loncom/interface/lonfeedback.pm:1.77
--- loncom/interface/lonfeedback.pm:1.76	Wed Feb 11 17:14:10 2004
+++ loncom/interface/lonfeedback.pm	Fri Feb 13 10:03:39 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Feedback
 #
-# $Id: lonfeedback.pm,v 1.76 2004/02/11 22:14:10 albertel Exp $
+# $Id: lonfeedback.pm,v 1.77 2004/02/13 15:03:39 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -25,24 +25,7 @@
 #
 # http://www.lon-capa.org/
 #
-# (Internal Server Error Handler
-#
-# (Login Screen
-# 5/21/99,5/22,5/25,5/26,5/31,6/2,6/10,7/12,7/14,
-# 1/14/00,5/29,5/30,6/1,6/29,7/1,11/9 Gerd Kortemeyer)
-#
-# 3/1/1 Gerd Kortemeyer)
-#
-# 3/1,2/3,2/5,2/6,2/8 Gerd Kortemeyer
-# 2/9 Guy Albertelli
-# 2/10 Gerd Kortemeyer
-# 2/13 Guy Albertelli
-# 7/25 Gerd Kortemeyer
-# 7/26 Guy Albertelli
-# 7/26,8/10,10/1,11/5,11/6,12/27,12/29 Gerd Kortemeyer
-# YEAR=2002
-# 1/1,1/16 Gerd Kortemeyer
-#
+###
 
 package Apache::lonfeedback;
 
@@ -55,8 +38,9 @@
 
 sub list_discussion {
     my ($mode,$status,$symb)=@_;
-    &Apache::lonnet::logthis("status is $status");
-    if (!($status eq 'CAN_ANSWER' || $status eq 'CANNOT_ANSWER')) {
+#    &Apache::lonnet::logthis("status is $status");
+    if (!($status eq 'CAN_ANSWER' || $status eq 'CANNOT_ANSWER'
+	  || $status eq 'OPEN')) {
 	return '';
     }
     my $discussiononly=0;
@@ -72,7 +56,8 @@
     }
     unless ($symb) { return ''; }
     my $seeid=&Apache::lonnet::allowed('rin',$crs);
-    my $viewgrades=&Apache::lonnet::allowed('vgr',$crs);
+    my $viewgrades=(&Apache::lonnet::allowed('vgr',$crs)
+	&& ($symb=~/\.(problem|exam|quiz|assess|survey|form)$/));
     my @discussionitems=();
     # backward compatibility (bulletin boards used to be 'wrapped')
     my $ressymb=$symb;
@@ -156,24 +141,24 @@
 			if ($seeid) {
 			    if ($hidden) {
 				$sender.=' <a href="/adm/feedback?unhide='.
-				    $symb.':::'.$idx.'">'.&mt('Make Visible').'</a>';
+				    $ressymb.':::'.$idx.'">'.&mt('Make Visible').'</a>';
 			    } else {
 				$sender.=' <a href="/adm/feedback?hide='.
-				    $symb.':::'.$idx.'">'.&mt('Hide').'</a>';
+				    $ressymb.':::'.$idx.'">'.&mt('Hide').'</a>';
 			    }                     
 			    $sender.=' <a href="/adm/feedback?deldisc='.
-				$symb.':::'.$idx.'">'.&mt('Delete').'</a>';
-			}
-			if (&Apache::lonnet::allowed('pch',
-				   $ENV{'request.course.id'}.
-	($ENV{'request.course.sec'}?'/'.$ENV{'request.course.sec'}:''))) {
-			    $sender.=' <a href="/adm/feedback?replydisc='.
-				$symb.':::'.$idx.'" '.$target.'>'.&mt('Reply').'</a>';
+				$ressymb.':::'.$idx.'">'.&mt('Delete').'</a>';
 			}
 		    } else {
 			if ($screenname) {
 			    $sender='<i>'.$screenname.'</i>';
 			}
+		    }
+		    if (&Apache::lonnet::allowed('pch',
+						 $ENV{'request.course.id'}.
+						 ($ENV{'request.course.sec'}?'/'.$ENV{'request.course.sec'}:''))) {
+			$sender.=' <a href="/adm/feedback?replydisc='.
+			    $ressymb.':::'.$idx.'" '.$target.'>'.&mt('Reply').'</a>';
 		    }
 		    my $vgrlink;
 		    if ($viewgrades) {