--- loncom/interface/lonfeedback.pm 2013/07/15 16:13:21 1.366
+++ loncom/interface/lonfeedback.pm 2022/01/18 17:33:13 1.389
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Feedback
#
-# $Id: lonfeedback.pm,v 1.366 2013/07/15 16:13:21 bisitz Exp $
+# $Id: lonfeedback.pm,v 1.389 2022/01/18 17:33:13 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -44,8 +44,8 @@ use HTML::LCParser();
#use HTML::Tidy::libXML;
use Apache::lonspeller();
use Apache::longroup;
-use Cwd;
-use LONCAPA;
+use Archive::Zip qw( :ERROR_CODES );
+use LONCAPA qw(:DEFAULT :match);
sub discussion_open {
my ($status,$symb)=@_;
@@ -118,10 +118,16 @@ sub list_discussion {
$outputtarget = 'export';
}
}
+ my ($nofooter,$nodisclink,$nofdbklink);
if (not &discussion_visible($status)) {
if ($mode ne 'board') {
- &Apache::lonenc::check_encrypt(\$ressymb);
- return '
'. + &mt('Unfortunately you will not be able to retrieve an archive of the discussion posts at this time, because there was a problem creating the zip file.').'
'; } } } else { - $discussion .= ''. + &mt('Unfortunately you will not be able to retrieve an archive of the discussion posts at this time, because there was a problem creating a manifest file.').'
'; } return $discussion; } @@ -759,33 +790,60 @@ END &mt('This discussion is closed.').''; } } elsif ($outputtarget ne 'tex') { - $discussion.='$lt{'sorr'}
+ ENDFAILREDIR $r->print(&Apache::loncommon::end_page()); } sub redirect_back { - my ($r,$feedurl,$typestyle,$sendsomething,$sendposts,$blog,$status,$previous,$sort,$rolefilter,$statusfilter,$sectionpick,$grouppick,$numpicks,$group,$toolarge) = @_; + my ($r,$feedurl,$typestyle,$sendsomething,$sendposts,$blog,$status,$previous,$sort, + $rolefilter,$statusfilter,$sectionpick,$grouppick,$numpicks,$group,$toolarge,$delay) = @_; my $sorttag = ''; my $roletag = ''; my $statustag = ''; @@ -2803,14 +2892,28 @@ sub redirect_back { &Apache::lonenc::check_encrypt(\$feedurl); my $logo=&Apache::loncommon::lonhttpdurl('/adm/lonIcons/lonlogos.gif'); my %parms=('only_body' => 1); + if ($delay !~ /^\d+(|\.\d+)$/) { + $delay = 0; + } if ($env{'form.modal'}) { - $parms{'add_entries'}={'onLoad' => 'document.forms.reldt.submit()'}; + my $onload = 'document.forms.reldt.submit()'; + if ($delay) { + my $js_delay = int(1000 * $delay); + $onload = "setTimeout(function(){ + document.forms.reldt.submit(); + },$js_delay);"; + } + $parms{'add_entries'}={'onload' => $onload}; } else { - $parms{'redirect'}=[0,$feedurl]; + $parms{'redirect'}=[$delay,$feedurl]; } my $start_page= &Apache::loncommon::start_page('Feedback sent',undef,\%parms); my $end_page = &Apache::loncommon::end_page(); + my $windowname = 'loncapaclient'; + if ($env{'request.lti.login'}) { + $windowname .= 'lti'; + } $r->print(<