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

raeburn raeburn at source.lon-capa.org
Fri Jan 30 20:55:01 EST 2026


raeburn		Sat Jan 31 01:55:01 2026 EDT

  Modified files:              
    /loncom/interface	lonfeedback.pm 
  Log:
  - Behavior of feedback icon/link in links/icons on right side of header 
    consistent with behavior of "Post Discussion" and Feedback links in footer:
    when "This discussion is closed" shown in footer
  - Warning shown when no message can be sent reflects context, i.e., launch
    from Footer (just discussion or just feedback), or from header (either)
  
  
Index: loncom/interface/lonfeedback.pm
diff -u loncom/interface/lonfeedback.pm:1.396 loncom/interface/lonfeedback.pm:1.397
--- loncom/interface/lonfeedback.pm:1.396	Sat Jan 31 01:38:41 2026
+++ loncom/interface/lonfeedback.pm	Sat Jan 31 01:55:01 2026
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Feedback
 #
-# $Id: lonfeedback.pm,v 1.396 2026/01/31 01:38:41 raeburn Exp $
+# $Id: lonfeedback.pm,v 1.397 2026/01/31 01:55:01 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2755,9 +2755,19 @@
 sub fail_redirect {
   my ($r,$feedurl,$delay) = @_;
   if ($feedurl=~/^\/adm\//) { $feedurl.='?register=1' };
+  my $msg;
   my %lt = &Apache::lonlocal::texthash(
                  'sorr' => 'Sorry, no recipients ...',
+                 'this' => 'This discussion is closed.',
+                 'none' => 'No recipients for feedback and discussion is closed',
   );
+  if ($env{'form.sendmessageonly'}) {
+      $msg = $lt{'sorr'};
+  } elsif ($env{'form.editdisc'} || $env{'form.replydisc'}) {
+      $msg = $lt{'this'};
+  } else {
+      $msg = $lt{'none'};
+  }
   my $logo=&Apache::loncommon::lonhttpdurl('/adm/lonIcons/lonlogos.gif');
   my %parms=('only_body'   => 1);
   if ($delay !~ /^\d+(|\.\d+)$/) {
@@ -2782,7 +2792,7 @@
   }
   $r->print(<<ENDFAILREDIR);
 <img align="right" src="$logo" />
-<p class="LC_warning">$lt{'sorr'}</p>
+<p class="LC_warning">$msg</p>
 <form name="reldt" action="$feedurl" target="$windowname">
 </form>
 ENDFAILREDIR
@@ -3030,7 +3040,27 @@
         my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
         my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
         my $realsymb = &get_realsymb($symb);
-        if (!$blocked && &discussion_open(undef,$realsymb) &&
+        my $status = undef;
+        if (($feedurl=~/$LONCAPA::assess_re/) ||
+            (($symb =~ /ext\.tool$/) &&
+             (&Apache::lonnet::EXT('resource.0.gradable',$symb) =~ /^yes$/i))) {
+            my $type;
+            if ($feedurl =~ /\.task$/) {
+                $type = 'Task';
+            } elsif ($symb =~ /ext\.tool$/) {
+                $type = 'tool';
+            } else {
+                $type = 'problem';
+            }
+            if ($type eq 'tool') {
+                ($status) =
+                    &Apache::lonhomework::check_slot_access('0',$type,$symb,['0']);
+            } else {
+                ($status) =
+                    &Apache::lonhomework::check_slot_access('0',$type,$symb);
+            }
+        }
+        if (!$blocked && &discussion_open($status,$realsymb) &&
             (&Apache::lonnet::allowed('pch',
                                       $env{'request.course.id'}.
                                       ($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:'')) ||




More information about the LON-CAPA-cvs mailing list