--- loncom/interface/lonfeedback.pm 2003/09/19 16:12:50 1.61
+++ loncom/interface/lonfeedback.pm 2003/11/03 20:34:54 1.65
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Feedback
#
-# $Id: lonfeedback.pm,v 1.61 2003/09/19 16:12:50 www Exp $
+# $Id: lonfeedback.pm,v 1.65 2003/11/03 20:34:54 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -51,6 +51,7 @@ use Apache::Constants qw(:common);
use Apache::lonmsg();
use Apache::loncommon();
use Apache::lontexconvert();
+use Apache::lonlocal;
sub list_discussion {
my ($mode,$status,$symb)=@_;
@@ -68,17 +69,13 @@ sub list_discussion {
unless ($symb) { return ''; }
my $seeid=&Apache::lonnet::allowed('rin',$crs);
my $viewgrades=&Apache::lonnet::allowed('vgr',$crs);
- my $discussion='';
+ my %discussionitems=();
my %contrib=&Apache::lonnet::restore($symb,$ENV{'request.course.id'},
$ENV{'course.'.$ENV{'request.course.id'}.'.domain'},
$ENV{'course.'.$ENV{'request.course.id'}.'.num'});
if ($contrib{'version'}) {
- unless ($discussiononly) {
- $discussion.=
- '
';
- }
- my $idx;
- for ($idx=1;$idx<=$contrib{'version'};$idx++) {
+ for (my $id=1;$id<=$contrib{'version'};$id++) {
+ my $idx=$id;
my $hidden=($contrib{'hidden'}=~/\.$idx\./);
my $deleted=($contrib{'deleted'}=~/\.$idx\./);
unless ((($hidden) && (!$seeid)) || ($deleted)) {
@@ -88,10 +85,10 @@ sub list_discussion {
if ($contrib{$idx.':attachmenturl'}) {
my ($fname,$ft)
=($contrib{$idx.':attachmenturl'}=~/\/(\w+)\.(\w+)$/);
- $message.='
';
}
}
}
- unless ($discussiononly) {
- $discussion.='';
- }
+ }
+ my $discussion='';
+ foreach (sort { $a <=> $b } keys %discussionitems) {
+ $discussion.=$discussionitems{$_};
}
if ($discussiononly) {
$discussion.=(<
Note: in anonymous discussion, your name is visible only to
course faculty
-
+
Attachment (128 KB max size):
@@ -181,7 +185,8 @@ sub mail_screen {
The LearningOnline Network with CAPA
-
$bodytag
$title
ENDDOCUMENT
@@ -249,12 +257,12 @@ sub fail_redirect {
my ($r,$feedurl) = @_;
$r->print (<Feedback not sent
-
-
+
+
-
+Sorry, no recipients ...
@@ -266,15 +274,15 @@ sub redirect_back {
$r->print (<Feedback sent
-
+
-
+
$typestyle
Sent $sendsomething message(s), and $sendposts post(s).
-$status
+$status
@@ -286,7 +294,7 @@ sub no_redirect_back {
my ($r,$feedurl) = @_;
$r->print (<Feedback not sent
-
+
ENDNOREDIR
if ($feedurl!~/^\/adm\/feedback/) {
@@ -297,7 +305,7 @@ ENDNOREDIR
-
+Sorry, no feedback possible on this resource ...
@@ -305,43 +313,46 @@ ENDNOREDIRTWO
}
sub screen_header {
- my ($feedurl) = @_;
- my $msgoptions='';
- my $discussoptions='';
- if (($feedurl=~/^\/res\//) && ($feedurl!~/^\/res\/adm/)) {
- $msgoptions=
- '
Feedback to resource author';
- }
- if (&feedback_available(1)) {
- $msgoptions.=
- ' Question about resource content';
- }
- if (&feedback_available(0,1)) {
- $msgoptions.=
- ' '.
- 'Question/Comment/Feedback about course content';
- }
- if (&feedback_available(0,0,1)) {
- $msgoptions.=
- ' '.
- 'Question/Comment/Feedback about course policy';
- }
-
- if ($ENV{'request.course.id'}) {
- if (&Apache::lonnet::allowed('pch',
- $ENV{'request.course.id'}.
- ($ENV{'request.course.sec'}?'/'.$ENV{'request.course.sec'}:''))) {
- $discussoptions=' '.
- 'Contribution to course discussion of resource';
- $discussoptions.=' '.
- 'Anonymous contribution to course discussion of resource'.
- ' (name only visible to course faculty)';
+ my ($feedurl) = @_;
+ my $msgoptions='';
+ my $discussoptions='';
+ unless ($ENV{'form.replydisc'}) {
+ if (($feedurl=~/^\/res\//) && ($feedurl!~/^\/res\/adm/)) {
+ $msgoptions=
+ '
'.
+ &mt('Feedback to resource author').'
';
+ }
+ if (&feedback_available(1)) {
+ $msgoptions.=
+ ' '.
+ &mt('Question about resource content');
+ }
+ if (&feedback_available(0,1)) {
+ $msgoptions.=
+ ' '.
+ &mt('Question/Comment/Feedback about course content');
+ }
+ if (&feedback_available(0,0,1)) {
+ $msgoptions.=
+ ' '.
+ &mt('Question/Comment/Feedback about course policy');
+ }
+ }
+ if ($ENV{'request.course.id'}) {
+ if (&Apache::lonnet::allowed('pch',
+ $ENV{'request.course.id'}.
+ ($ENV{'request.course.sec'}?'/'.$ENV{'request.course.sec'}:''))) {
+ $discussoptions=' '.
+ &mt('Contribution to course discussion of resource');
+ $discussoptions.=' '.
+ &mt('Anonymous contribution to course discussion of resource').
+ ' ('.&mt('name only visible to course faculty').')';
}
- }
- if ($msgoptions) { $msgoptions='
Sending Messages
'.$msgoptions; }
- if ($discussoptions) {
- $discussoptions='