--- loncom/xml/lonxml.pm 2002/06/14 19:56:57 1.177
+++ loncom/xml/lonxml.pm 2002/09/13 20:46:09 1.196
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# XML Parser Module
#
-# $Id: lonxml.pm,v 1.177 2002/06/14 19:56:57 www Exp $
+# $Id: lonxml.pm,v 1.196 2002/09/13 20:46:09 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -154,6 +154,7 @@ sub xmlbegin {
}
sub xmlend {
+ my ($discussiononly,$symb)=@_;
my $discussion='';
if ($ENV{'request.course.id'}) {
my $crs='/'.$ENV{'request.course.id'};
@@ -162,32 +163,47 @@ sub xmlend {
}
$crs=~s/\_/\//g;
my $seeid=&Apache::lonnet::allowed('rin',$crs);
- my $symb=&Apache::lonnet::symbread();
+ unless ($symb) {
+ $symb=&Apache::lonnet::symbread();
+ }
if ($symb) {
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'}) {
- $discussion.=
- '
Course Discussion of Resource
';
+ unless ($discussiononly) {
+ $discussion.=
+ '
';
+ }
my $idx;
for ($idx=1;$idx<=$contrib{'version'};$idx++) {
my $hidden=($contrib{'hidden'}=~/\.$idx\./);
unless (($hidden) && (!$seeid)) {
my $message=$contrib{$idx.':message'};
$message=~s/\n/\
/g;
+ $message=&Apache::lontexconvert::msgtexconverted($message);
if ($message) {
if ($hidden) {
$message=''.$message.'';
}
+ my $screenname=&Apache::loncommon::screenname(
+ $contrib{$idx.':sendername'},
+ $contrib{$idx.':senderdomain'});
+ my $plainname=&Apache::loncommon::nickname(
+ $contrib{$idx.':sendername'},
+ $contrib{$idx.':senderdomain'});
+
my $sender='Anonymous';
if ((!$contrib{$idx.':anonymous'}) || ($seeid)) {
- $sender=$contrib{$idx.':plainname'}.' ('.
+ $sender=&Apache::loncommon::aboutmewrapper(
+ $plainname,
+ $contrib{$idx.':sendername'},
+ $contrib{$idx.':senderdomain'}).' ('.
$contrib{$idx.':sendername'}.' at '.
$contrib{$idx.':senderdomain'}.')';
if ($contrib{$idx.':anonymous'}) {
$sender.=' [anonymous] '.
- $contrib{$idx.':screenname'};
+ $screenname;
}
if ($seeid) {
if ($hidden) {
@@ -199,8 +215,8 @@ sub xmlend {
}
}
} else {
- if ($contrib{$idx.':screenname'}) {
- $sender=''.$contrib{$idx.':screenname'}.'';
+ if ($screenname) {
+ $sender=''.$screenname.'';
}
}
$discussion.=''.$sender.' ('.
@@ -210,11 +226,27 @@ sub xmlend {
}
}
}
- $discussion.='
';
+ unless ($discussiononly) {
+ $discussion.='';
+ }
+ }
+ if ($discussiononly) {
+ $discussion.=(<
+
+
+
+
+
+Note: in anonymous discussion, your name is visible only to
+course faculty
+
+
+ENDDISCUSS
}
}
}
- return $discussion.'