--- loncom/interface/lonfeedback.pm 2001/02/06 18:17:34 1.4 +++ loncom/interface/lonfeedback.pm 2001/02/08 21:35:24 1.5 @@ -9,7 +9,7 @@ # # 3/1/1 Gerd Kortemeyer) # -# 3/1,2/3,2/5,2/6 Gerd Kortemeyer +# 3/1,2/3,2/5,2/6,2/8 Gerd Kortemeyer # package Apache::lonfeedback; @@ -28,11 +28,12 @@ sub handler { $feedurl=~s/^$ENV{'SERVER_NAME'}//; $feedurl=~s/^$ENV{'HTTP_HOST'}//; - if (($feedurl=~/^\/res/) || ($ENV{'request.course.id'})) { + if ((($feedurl=~/^\/res/) && ($feedurl!~/^\/res\/adm/)) + || ($ENV{'request.course.id'})) { # --------------------------------------------------- Print login screen header unless ($ENV{'form.sendit'}) { my $options=''; - if ($feedurl=~/^\/res/) { + if (($feedurl=~/^\/res/) && ($feedurl!~/^\/res\/adm/)) { $options= '

Feedback to resource author'; } @@ -42,7 +43,7 @@ sub handler { } if ($ENV{'course.'.$ENV{'request.course.id'}.'.comment.email'}) { $options.= - '
'. + '
'. 'Question/Comment/Feedback about course content'; } if ($ENV{'course.'.$ENV{'request.course.id'}.'.policy.email'}) { @@ -50,28 +51,74 @@ sub handler { '
'. 'Question/Comment/Feedback about course policy'; } + if ($options) { $r->print(< The LearningOnline Network with CAPA + - +

Feedback

$feedurl

-
+ -Please check at least one of the following: +Please check at least one of the following feedback types: $options
My question/comment/feedback:

- + +

ENDDOCUMENT } else { + print (<Feedback not sent + + + + +Sorry, no recipients ... + + +ENDFAILREDIR + +} +} else { # # Get previous user input # @@ -148,24 +195,29 @@ ENDCITE # # Who gets this? # + my $typestyle=''; my %to=(); if ($ENV{'form.author'}) { + $typestyle.='Author Feedback
'; $feedurl=~/^\/res\/(\w+)\/(\w+)\//; $to{$2.':'.$1}=1; } if ($ENV{'form.question'}) { + $typestyle.='Question
'; map { $to{$_}=1; } split(/\,/, $ENV{'course.'.$ENV{'request.course.id'}.'.question.email'}); } - if ($ENV{'form.comment'}) { + if ($ENV{'form.course'}) { + $typestyle.='Comment
'; map { $to{$_}=1; } split(/\,/, $ENV{'course.'.$ENV{'request.course.id'}.'.comment.email'}); } if ($ENV{'form.policy'}) { + $typestyle.='Policy
'; map { $to{$_}=1; } split(/\,/, @@ -175,26 +227,30 @@ ENDCITE # Actually send mail # my $status=''; + my $sendsomething=0; map { if ($_) { unless ( &Apache::lonmsg::user_normal_msg(split(/\:/,$_),'Feedback '.$feedurl, $email,$citations) eq 'ok') { $status.='
Error sending message to '.$_.'
'; - } + } else { + $sendsomething++; + } } - } keys %to; + } keys %to; # # Receipt screen and redirect back to where came from # print (< Feedback sent - + -Feedback sent ... +$typestyle +Sent $sendsomething message(s). $status @@ -203,7 +259,7 @@ ENDREDIR } else { print (<Feedback not sent - +