['.$$anonhash{$key}.'] '.
$screenname;
}
-
+ if ($see_anonymous) {
+ $sender.=&Apache::loncommon::student_image_tag($contrib{$idx.':senderdomain'},$contrib{$idx.':sendername'});
+ }
# Set up for sorting by domain, then username
unless (defined($$usernamesort{$contrib{$idx.':senderdomain'}})) {
%{$$usernamesort{$contrib{$idx.':senderdomain'}}} = ();
@@ -1967,7 +1971,7 @@ END
-
+
END
if (exists($env{'form.group'})) {
$r->print('');
@@ -2055,7 +2059,7 @@ sub print_sortfilter_options {
'spgr' => 'Specific groups',
'psub' => 'Pick specific users (by name)',
'shal' => 'Show a list of current posters',
- 'stor' => 'Store changes',
+ 'stor' => 'Save changes',
);
my %sort_types = ();
@@ -2559,21 +2563,25 @@ sub screen_header {
'';
}
+ my %optionhash=();
+ foreach my $type ('question','comment','policy') {
+ $optionhash{$type}=$env{'course.'.$env{'request.course.id'}.'.'.$type.'.email.text'};
+ }
if (&feedback_available(1)) {
$msgoptions.=
'';
+ ($optionhash{'question'}?$optionhash{'question'}:&mt('Question about resource content')).'';
}
if (&feedback_available(0,1)) {
$msgoptions.=
'';
}
if (&feedback_available(0,0,1)) {
$msgoptions.=
'';
}
}
@@ -2671,36 +2679,44 @@ sub feedback_available {
}
sub send_msg {
- my ($title,$feedurl,$email,$citations,$attachmenturl,$symb,%to)=@_;
- my $status='';
- my $sendsomething=0;
- my $restitle = &get_resource_title($symb,$feedurl);
- if ($title=~/^Error/) { $title=&mt('Feedback').': '.$title; }
- unless ($title=~/\w/) { $title=&mt('Feedback'); }
- foreach my $key (keys(%to)) {
- if ($key) {
- unless (&Apache::lonmsg::user_normal_msg(split(/\:/,$key),
- $title.' ['.$restitle.']',$email,$citations,$feedurl,
- $attachmenturl,undef,undef,$symb,$restitle)=~/ok/) {
- $status.='
'.&mt('Error sending message to').' '.$key.'
';
- } else {
- $sendsomething++;
- }
+ my ($title,$feedurl,$email,$citations,$attachmenturl,$symb,%to)=@_;
+ my $status='';
+ my $sendsomething=0;
+ my $restitle = &get_resource_title($symb,$feedurl);
+ if ($title=~/^Error/) { $title=&mt('Feedback').': '.$title; }
+ unless ($title=~/\w/) { $title=&mt('Feedback'); }
+ foreach my $key (keys(%to)) {
+ if ($key) {
+ my ($user,$domain) = split(/\:/,$key,2);
+ if (!defined($user)) {
+ $status.='
'.&mt('Error sending message to [_1], no user specified.',$key);
+ } elsif (!defined($domain)) {
+ $status.='
'.&mt('Error sending message to [_1], no domain specified.',$key);
+ } else {
+ unless (&Apache::lonmsg::user_normal_msg($user,$domain,
+ $title.' ['.$restitle.']',$email,$citations,$feedurl,
+ $attachmenturl,undef,undef,$symb,$restitle)=~/ok/) {
+ $status.='
'.&mt('Error sending message to').' '.$key.'
';
+ } else {
+ $sendsomething++;
+ }
+ }
+ }
}
- }
+
my %record=&Apache::lonnet::restore('_feedback');
my ($temp)=keys(%record);
unless ($temp=~/^error\:/) {
- my %newrecord=();
- $newrecord{'resource'}=$feedurl;
- $newrecord{'subnumber'}=$record{'subnumber'}+1;
- unless (&Apache::lonnet::cstore(\%newrecord,'_feedback') eq 'ok') {
- $status.='
'.&mt('Not registered').'
';
- }
+ my %newrecord=();
+ $newrecord{'resource'}=$feedurl;
+ $newrecord{'subnumber'}=$record{'subnumber'}+1;
+ unless (&Apache::lonnet::cstore(\%newrecord,'_feedback') eq 'ok') {
+ $status.='
'.&mt('Not registered').'
';
+ }
}
-
- return ($status,$sendsomething);
+
+ return ($status,$sendsomething);
}
sub adddiscuss {
@@ -2923,7 +2939,7 @@ sub modify_attachments {
'chth' => 'Check the checkboxes for any you wish to remove.',
'thef' => 'The following attachments have been uploaded for inclusion with this posting.',
'adda' => 'Add a new attachment to this post.',
- 'stch' => 'Store Changes',
+ 'stch' => 'Save Changes',
);
my $js = <
@@ -3541,7 +3557,7 @@ ENDREDIR
my ($symb,$feedurl)=&get_feedurl_and_clean_symb($env{'form.symb'});
if ($env{'form.cmd'} eq 'threadedon') {
&Apache::lonnet::put('environment',{'threadeddiscussion' => 'on'});
- &Apache::lonnet::appenv('environment.threadeddiscussion' => 'on');
+ &Apache::lonnet::appenv({'environment.threadeddiscussion' => 'on'});
} else {
&Apache::lonnet::del('environment',['threadeddiscussion']);
&Apache::lonnet::delenv('environment\.threadeddiscussion');
@@ -3704,7 +3720,7 @@ ENDREDIR
my $usersaw=&resource_output($feedurl);
# Get resource answer (need to allow student to view grades for this to work)
- &Apache::lonnet::appenv(('allowed.vgr'=>'F'));
+ &Apache::lonnet::appenv({'allowed.vgr'=>'F'});
my $usersymb = &Apache::lonenc::check_encrypt($symb);
my $useranswer=
&Apache::loncommon::get_student_answers(