--- loncom/interface/lonfeedback.pm 2005/04/11 15:29:38 1.161
+++ loncom/interface/lonfeedback.pm 2005/11/01 15:59:18 1.171
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Feedback
#
-# $Id: lonfeedback.pm,v 1.161 2005/04/11 15:29:38 albertel Exp $
+# $Id: lonfeedback.pm,v 1.171 2005/11/01 15:59:18 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -45,6 +45,7 @@ use Cwd;
sub discussion_open {
my ($status,$symb)=@_;
+ if ($env{'request.role.adv'}) { return 1; }
if (defined($status) &&
!($status eq 'CAN_ANSWER' || $status eq 'CANNOT_ANSWER'
|| $status eq 'OPEN')) {
@@ -97,7 +98,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 +114,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 +155,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 +174,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 +247,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 +860,7 @@ sub build_posting_display {
$contrib{$idx.':sendername'}.' at '.
$contrib{$idx.':senderdomain'}.')';
if ($contrib{$idx.':anonymous'}) {
- $sender.=' ['.&mt('anonymous').'] '.
+ $sender.=' ['.&mt('anonymous').'] '.
$screenname;
}
@@ -1205,7 +1207,7 @@ sub get_post_contents {
my ($timesent,$attachmsg);
my %currattach = ();
$timesent = &Apache::lonlocal::locallocaltime($postversions[$i]);
- $$messages{$i}=~s/\n/\
/g;
+ &newline_to_br(\$messages->{$i});
$$messages{$i}=&Apache::lontexconvert::msgtexconverted($$messages{$i});
$$subjects{$i}=~s/\n/\
/g;
$$subjects{$i}=&Apache::lontexconvert::msgtexconverted($$subjects{$i});
@@ -1375,7 +1377,7 @@ END
&get_post_versions(\%msgversions,$contrib{$idx.':message'},0,$numoldver);
$message = $msgversions{$numoldver};
}
- $message=~s/\n/\
/g;
+ &newline_to_br(\$message);
$quote='
'.&Apache::lontexconvert::msgtexconverted($message).''; if ($idx > 0) { my %subversions = (); @@ -2259,7 +2261,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= ''; @@ -2375,17 +2377,48 @@ sub secapply { return ''; } +=pod + +=over 4 + +=item * + +decide_receiver($feedurl,$author,$question,$course,$policy,$defaultflag); + +Arguments + $feedurl - /res/ url of resource (only need if $author is true) + $author,$question,$course,$policy - all true/false parameters + if true will attempt to find the addresses of user that should receive + this type of feedback (author - feedback to author of resource $feedurl, + $question 'Resource Content Questions', $course 'Course Content Question', + $policy 'Course Policy') + (Additionally it also checks $env for whether the corresponding form.