--- loncom/interface/lonfeedback.pm 2022/01/19 18:08:38 1.370.2.5.2.2
+++ loncom/interface/lonfeedback.pm 2023/09/15 23:00:16 1.393
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Feedback
#
-# $Id: lonfeedback.pm,v 1.370.2.5.2.2 2022/01/19 18:08:38 raeburn Exp $
+# $Id: lonfeedback.pm,v 1.393 2023/09/15 23:00:16 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1003,9 +1003,14 @@ sub postingform_display {
}
}
}
+ my $postanon;
+ if (&Apache::lonnet::allowed('pac',$env{'request.course.id'}.
+ ($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) {
+ $postanon = '';
+ }
$postingform .= (<
-
+$postanon
@@ -1307,9 +1312,8 @@ sub build_posting_display {
@{$$usernamesort{$contrib{$idx.':senderdomain'}}{$contrib{$idx.':sendername'}}} = ("$idx");
}
# Set up for sorting by last name, then first name
- my %names = &Apache::lonnet::get('environment',
- ['firstname','lastname'],$contrib{$idx.':senderdomain'},
- ,$contrib{$idx.':sendername'});
+ my %names = &Apache::loncommon::getnames($contrib{$idx.':sendername'},
+ $contrib{$idx.':senderdomain'});
my $lastname = $names{'lastname'};
my $firstname = $names{'firstname'};
if ($lastname eq '') {
@@ -1689,9 +1693,8 @@ sub get_post_contents {
$$contrib{$idx.':sendername'},
$$contrib{$idx.':senderdomain'});
$$screenname=$$contrib{$idx.':screenname'};
- $$showaboutme = &Apache::lonnet::usertools_access($$contrib{$idx.':sendername'},
- $$contrib{$idx.':senderdomain'},
- 'aboutme');
+ $$showaboutme = &Apache::loncommon::aboutme_on($$contrib{$idx.':sendername'},
+ $$contrib{$idx.':senderdomain'});
my $sender = $$plainname;
if ($$showaboutme) {
$sender = &Apache::loncommon::aboutmewrapper(
@@ -2110,7 +2113,7 @@ END
$r->print('');
}
$r->print(<
+
END
@@ -2774,6 +2777,9 @@ sub fail_redirect {
}
$r->print(&Apache::loncommon::start_page('Feedback not sent',undef,\%parms));
my $windowname = 'loncapaclient';
+ if ($env{'request.lti.login'}) {
+ $windowname .= 'lti';
+ }
$r->print(<
$lt{'sorr'}
@@ -2902,6 +2908,10 @@ sub redirect_back {
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(<
@@ -2910,7 +2920,7 @@ $typestyle
$blog
$toolarge
$status
-
@@ -2954,6 +2967,7 @@ ENDFORM
$parms{'redirect'}=[$delay,$feedurl];
}
}
+
my $start_page=
&Apache::loncommon::start_page('Feedback not sent',undef,
\%parms);
@@ -2977,7 +2991,7 @@ sub screen_header {
question => 'Question about resource content',
comment => 'Question/Comment/Feedback about course content',
policy => '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');
@@ -2986,7 +3000,7 @@ sub screen_header {
$crstype = &Apache::loncommon::course_type();
if ($crstype eq 'Community') {
$default{'comment'} = &mt('Question/Comment/Feedback about community content');
- $default{'policy'} = &mt('Question/Comment/Feedback about community policy');
+ $default{'policy'} = &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');
@@ -3019,10 +3033,13 @@ sub screen_header {
if (!$blocked && &discussion_open(undef,$realsymb) &&
(&Apache::lonnet::allowed('pch',
$env{'request.course.id'}.
- ($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:'')) ||
+ ($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:'')) ||
(($group ne '') && ($symb =~ m{^bulletin___\d+___adm/wrapper/adm/\Q$cdom\E/\Q$cnum\E/\d+/bulletinboard$}) && (&check_group_priv($group,'pgd') eq 'ok')))) {
$discoptions{'nonanon'} = 1;
- $discoptions{'anon'} = 1;
+ if (&Apache::lonnet::allowed('pac',$env{'request.course.id'}.
+ ($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) {
+ $discoptions{'anon'} = 1;
+ }
$blockblog = &Apache::loncommon::blocking_status('blogs');
}
}
@@ -3033,10 +3050,10 @@ sub screen_header {
}
if (keys(%fdbkoptions)) {
if ($fdbkoptions{'author'}) {
- $msgoptions =
- '
';
- }
+ $msgoptions =
+ '
';
+ }
foreach my $item ('question','comment','policy') {
my $type = $item;
if ($item eq 'comment') {
@@ -3046,8 +3063,8 @@ sub screen_header {
if ($fdbkoptions{$type}) {
$msgoptions .=
'
';
- }
+ ($optionhash?$optionhash:$default{$item}).'
';
+ }
}
}
if (keys(%discoptions)) {
@@ -3154,7 +3171,7 @@ sub send_msg {
my ($title,$feedurl,$email,$citations,$attachmenturl,$symb,$clientip,%to)=@_;
my $status='';
my $sendsomething=0;
- my $delay;
+ my $delay;
my $senthide;
my %setters;
my ($startblock,$endblock,$triggerblock,$by_ip,$blockdom) =
@@ -3643,7 +3660,7 @@ sub modify_attachments {
document.modattachments.action = document.modattachments.origpage.value;
document.modattachments.submit();
}
-
+
END
@@ -4175,11 +4192,15 @@ sub handler {
'only_body' => 1,
'add_entries' => \%onload});
my $end_page = &Apache::loncommon::end_page();
+ my $windowname = 'loncapaclient';
+ if ($env{'request.lti.login'}) {
+ $windowname .= 'lti';
+ }
$r->print (<
$textline
-
$end_page
@@ -4732,7 +4753,7 @@ ENDREDIR
my $usersymb = &Apache::lonenc::check_encrypt($symb);
my $useranswer=
&Apache::loncommon::get_student_answers(
- $usersymb,$env{'user.name'},$env{'user.domain'},
+ $symb,$env{'user.name'},$env{'user.domain'},
$env{'request.course.id'});
&Apache::lonnet::delenv('allowed.vgr');
# Get attachments, if any, and not too large
@@ -4790,7 +4811,11 @@ ENDREDIR
&& $env{'form.discuss'} !~ /^(?:author|question|course|policy)/)
|| $env{'form.anondiscuss'} ne '') {
my $subject = &clear_out_html($env{'form.subject'});
- my $anonmode=($env{'form.discuss'} eq 'anon' || $env{'form.anondiscuss'} );
+ my $anonmode;
+ if (&Apache::lonnet::allowed('pac',$env{'request.course.id'}.
+ ($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) {
+ $anonmode=($env{'form.discuss'} eq 'anon' || $env{'form.anondiscuss'} );
+ }
$typestyle.=&adddiscuss($symb,$message,$anonmode,$attachmenturl,
$subject,$group);
$numpost++;