--- loncom/interface/lonfeedback.pm	2005/06/06 02:16:09	1.165
+++ loncom/interface/lonfeedback.pm	2005/10/04 18:27:32	1.169
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Feedback
 #
-# $Id: lonfeedback.pm,v 1.165 2005/06/06 02:16:09 albertel Exp $
+# $Id: lonfeedback.pm,v 1.169 2005/10/04 18:27:32 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -97,7 +97,7 @@ sub list_discussion {
     $ressymb=&wrap_symb($ressymb);
     my $encsymb=&Apache::lonenc::check_encrypt($ressymb);
     my $viewgrades=(&Apache::lonnet::allowed('vgr',$crs)
-		  && ($ressymb=~/\.(problem|exam|quiz|assess|survey|form)$/));
+		  && ($ressymb=~/\.(problem|exam|quiz|assess|survey|form|task)$/));
     
     my %usernamesort = ();
     my %namesort =();
@@ -113,7 +113,7 @@ sub list_discussion {
     my $toggkey = $ressymb.'_readtoggle';
     my $readkey = $ressymb.'_read';
     $ressymb=$encsymb;
-    my %dischash = &Apache::lonnet::get('nohist_'.$env{'request.course.id'}.'_discuss',[$lastkey,$showkey,$markkey,$visitkey,$ondispkey,$userpickkey,$toggkey,$readkey],$env{'user.domain'},$env{'user.name'});
+    my %dischash = &Apache::lonnet::get('nohist_'.$cid.'_discuss',[$lastkey,$showkey,$markkey,$visitkey,$ondispkey,$userpickkey,$toggkey,$readkey],$env{'user.domain'},$env{'user.name'});
     my %discinfo = ();
     my $showonlyunread = 0;
     my $showunmark = 0; 
@@ -154,7 +154,9 @@ sub list_discussion {
     my %roleshash = ();
     my %roleinfo = ();
     if ($env{'form.rolefilter'}) {
-        %roleshash = &Apache::lonnet::dump('nohist_userroles',$env{'course.'.$env{'request.course.id'}.'.domain'},$env{'course.'.$env{'request.course.id'}.'.num'});
+        %roleshash = &Apache::lonnet::dump('nohist_userroles',
+					   $env{'course.'.$cid.'.domain'},
+					   $env{'course.'.$cid.'.num'});
         foreach (keys %roleshash) {
             my ($role,$uname,$udom,$sec) = split/:/,$_;
             if ($role =~ /^cr/) {
@@ -171,9 +173,8 @@ sub list_discussion {
             }
         }
         my ($classlist) = &Apache::loncoursedata::get_classlist(
-                              $env{'request.course.id'},
-                              $env{'course.'.$env{'request.course.id'}.'.domain'},
-                              $env{'course.'.$env{'request.course.id'}.'.num'});
+                              $env{'course.'.$cid.'.domain'},
+                              $env{'course.'.$cid.'.num'});
         my $sec_index = &Apache::loncoursedata::CL_SECTION();
         my $status_index = &Apache::loncoursedata::CL_STATUS();
         while (my ($student,$data) = each %$classlist) {
@@ -245,7 +246,7 @@ sub list_discussion {
     my $now = time;
     $discinfo{$visitkey} = $visit;
 
-    &Apache::lonnet::put('nohist_'.$env{'request.course.id'}.'_discuss',\%discinfo,$env{'user.domain'},$env{'user.name'});
+    &Apache::lonnet::put('nohist_'.$cid.'_discuss',\%discinfo,$env{'user.domain'},$env{'user.name'});
     &build_posting_display(\%usernamesort,\%subjectsort,\%namesort,\%notshown,\%newitem,\%dischash,\%shown,\%alldiscussion,\%imsitems,\%imsfiles,\%roleinfo,\@discussionitems,\@replies,\@depth,\@posters,\$maxdepth,\$visible,\$newpostsflag,\$current,$status,$viewgrades,$seeid,$prevread,$sortposts,$encsymb,$target,$readkey,$showunmark,$showonlyunread,$totposters,\@rolefilter,\@sectionpick,$statusfilter,$toggkey,$outputtarget);
 
     my $discussion='';
@@ -858,7 +859,7 @@ sub build_posting_display {
 					 $contrib{$idx.':sendername'}.' at '.
 					 $contrib{$idx.':senderdomain'}.')';
 			    if ($contrib{$idx.':anonymous'}) {
-			        $sender.=' ['.&mt('anonymous').'] '.
+			        $sender.=' <font color="red"><b>['.&mt('anonymous').']</b></font> '.
 				    $screenname;
 			    }
 
@@ -2259,7 +2260,7 @@ sub screen_header {
     my $msgoptions='';
     my $discussoptions='';
     unless (($env{'form.replydisc'}) || ($env{'form.editdisc'})) {
-	if (($feedurl=~/^\/res\//) && ($feedurl!~/^\/res\/adm/)) {
+	if (($feedurl=~/^\/res\//) && ($feedurl!~/^\/res\/adm/) && ($env{'user.adv'})) {
 	    $msgoptions= 
 		'<p><label><input type="checkbox" name="author" /> '.
 		&mt('Feedback to resource author').'</label></p>';
@@ -3257,7 +3258,7 @@ ENDREDIR
       my $mode='board';
       my $status='OPEN';
       my $previous=$env{'form.previous'};
-      if ($feedurl =~ /\.(problem|exam|quiz|assess|survey|form|library)$/) {
+      if ($feedurl =~ /\.(problem|exam|quiz|assess|survey|form|library|task)$/) {
           $mode='problem';
           $status=$Apache::inputtags::status[-1];
       }
@@ -3296,7 +3297,7 @@ ENDREDIR
       }
       &Apache::lonenc::check_decrypt(\$symb);
       my $goahead=1;
-      if ($feedurl=~/\.(problem|exam|quiz|assess|survey|form)$/) {
+      if ($feedurl=~/\.(problem|exam|quiz|assess|survey|form|task)$/) {
 	  unless ($symb) { $goahead=0; }
       }
       # backward compatibility (bulletin boards used to be 'wrapped')