version 1.12, 2001/07/26 20:19:12
|
version 1.14, 2001/08/10 14:45:11
|
Line 14
|
Line 14
|
# 2/10 Gerd Kortemeyer |
# 2/10 Gerd Kortemeyer |
# 2/13 Guy Albertelli |
# 2/13 Guy Albertelli |
# 7/25 Gerd Kortemeyer |
# 7/25 Gerd Kortemeyer |
|
# 7/26 Guy Albertelli |
|
# 7/26,8/10 Gerd Kortemeyer |
|
|
|
|
package Apache::lonfeedback; |
package Apache::lonfeedback; |
|
|
Line 57 sub mail_screen {
|
Line 60 sub mail_screen {
|
rec=1; |
rec=1; |
} |
} |
} |
} |
|
if (typeof(document.mailform.elements.anondiscuss)!="undefined") { |
|
if (document.mailform.elements.anondiscuss.checked) { |
|
rec=1; |
|
} |
|
} |
|
|
if (rec) { |
if (rec) { |
document.mailform.submit(); |
document.mailform.submit(); |
Line 167 sub screen_header {
|
Line 175 sub screen_header {
|
$options.='<br><input type=checkbox name=discuss> '. |
$options.='<br><input type=checkbox name=discuss> '. |
'<b>Contribution to course discussion of resource</b>'; |
'<b>Contribution to course discussion of resource</b>'; |
} |
} |
|
if ($ENV{'request.course.id'}) { |
|
$options.='<br><input type=checkbox name=anondiscuss> '. |
|
'<b>Anonymous contribution to course discussion of resource</b>'. |
|
' (name only visible to course faculty)'; |
|
} |
return $options; |
return $options; |
} |
} |
|
|
Line 258 sub send_msg {
|
Line 271 sub send_msg {
|
return ($status,$sendsomething); |
return ($status,$sendsomething); |
} |
} |
|
|
|
sub adddiscuss { |
|
my ($symb,$email,$anon)=@_; |
|
my $status=''; |
|
my %contrib=('message' => $email, |
|
'sendername' => $ENV{'user.name'}, |
|
'senderdomain' => $ENV{'user.domain'}); |
|
if ($anon) { |
|
$contrib{'anonymous'}='true'; |
|
} |
|
if (($symb) && ($email)) { |
|
$status='Adding to class discussion'.($anon?' (anonymous)':'').': '. |
|
&Apache::lonnet::store(\%contrib,$symb,$ENV{'request.course.id'}, |
|
$ENV{'course.'.$ENV{'request.course.id'}.'.domain'}, |
|
$ENV{'course.'.$ENV{'request.course.id'}.'.num'}). |
|
'<br>'; |
|
} |
|
return $status; |
|
} |
|
|
sub handler { |
sub handler { |
my $r = shift; |
my $r = shift; |
if ($r->header_only) { |
if ($r->header_only) { |
Line 320 sub handler {
|
Line 352 sub handler {
|
# Actually send mail |
# Actually send mail |
my ($status,$numsent)=&send_msg($feedurl,$email,$citations,%to); |
my ($status,$numsent)=&send_msg($feedurl,$email,$citations,%to); |
|
|
|
# Discussion? Store that. |
|
|
|
if ($ENV{'form.discuss'}) { |
|
$typestyle.=&adddiscuss($symb,$message); |
|
} |
|
|
|
if ($ENV{'form.anondiscuss'}) { |
|
$typestyle.=&adddiscuss($symb,$message,1); |
|
} |
|
|
|
|
# Receipt screen and redirect back to where came from |
# Receipt screen and redirect back to where came from |
&redirect_back($r,$feedurl,$typestyle,$numsent,$status); |
&redirect_back($r,$feedurl,$typestyle,$numsent,$status); |
|
|
Line 340 __END__
|
Line 383 __END__
|
|
|
|
|
|
|
|
|