From: Sam H. v. a. <we...@ma...> - 2008-03-13 22:35:53
|
Log Message: ----------- Add $feedback_by_section option: # If this value is true, feedback will only be sent to users with the same # section as the user initiating the feedback. $feedback_by_section = 0; Modified Files: -------------- webwork2/conf: global.conf.dist webwork2/lib/WeBWorK/ContentGenerator: Feedback.pm Revision Data ------------- Index: global.conf.dist =================================================================== RCS file: /webwork/cvs/system/webwork2/conf/global.conf.dist,v retrieving revision 1.204 retrieving revision 1.205 diff -Lconf/global.conf.dist -Lconf/global.conf.dist -u -r1.204 -r1.205 --- conf/global.conf.dist +++ conf/global.conf.dist @@ -163,6 +163,10 @@ # Use this to customize the text of the feedback button. $feedback_button_name = "Email instructor"; +# If this value is true, feedback will only be sent to users with the same +# section as the user initiating the feedback. +$feedback_by_section = 0; + ################################################################################ # Theme ################################################################################ Index: Feedback.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/ContentGenerator/Feedback.pm,v retrieving revision 1.44 retrieving revision 1.45 diff -Llib/WeBWorK/ContentGenerator/Feedback.pm -Llib/WeBWorK/ContentGenerator/Feedback.pm -u -r1.44 -r1.45 --- lib/WeBWorK/ContentGenerator/Feedback.pm +++ lib/WeBWorK/ContentGenerator/Feedback.pm @@ -148,7 +148,7 @@ } # determine the recipients of the email - my @recipients = $self->getFeedbackRecipients(); + my @recipients = $self->getFeedbackRecipients($user); unless (@recipients) { $self->noRecipientsAvailable($returnURL); @@ -359,7 +359,7 @@ } sub getFeedbackRecipients { - my ($self) = @_; + my ($self, $user) = @_; my $ce = $self->r->ce; my $db = $self->r->db; my $authz = $self->r->authz; @@ -371,6 +371,9 @@ foreach my $rcptName ($db->listUsers()) { if ($authz->hasPermissions($rcptName, "receive_feedback")) { my $rcpt = $db->getUser($rcptName); # checked + next if $ce->{feedback_by_section} and defined $user + and defined $rcpt->section and defined $user->section + and $rcpt->section ne $user->section; if ($rcpt and $rcpt->email_address) { push @recipients, $rcpt->rfc822_mailbox; } |