--- loncom/xml/lonxml.pm 2003/09/11 22:37:54 1.275 +++ loncom/xml/lonxml.pm 2003/09/14 23:57:18 1.276 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # XML Parser Module # -# $Id: lonxml.pm,v 1.275 2003/09/11 22:37:54 albertel Exp $ +# $Id: lonxml.pm,v 1.276 2003/09/14 23:57:18 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -183,108 +183,8 @@ sub xmlend { $crs.='_'.$ENV{'request.course.sec'}; } $crs=~s/\_/\//g; - my $seeid=&Apache::lonnet::allowed('rin',$crs); - my $viewgrades=&Apache::lonnet::allowed('vgr',$crs); - 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'}) { - unless ($discussiononly) { - $discussion.= - '

'; - } - my $idx; - for ($idx=1;$idx<=$contrib{'version'};$idx++) { - my $hidden=($contrib{'hidden'}=~/\.$idx\./); - my $deleted=($contrib{'deleted'}=~/\.$idx\./); - unless ((($hidden) && (!$seeid)) || ($deleted)) { - my $message=$contrib{$idx.':message'}; - $message=~s/\n/\
/g; - $message=&Apache::lontexconvert::msgtexconverted($message); - if ($contrib{$idx.':attachmenturl'}) { - my ($fname,$ft) - =($contrib{$idx.':attachmenturl'}=~/\/(\w+)\.(\w+)$/); - $message.='

Attachment: '.$fname.'.'.$ft.''; - } - 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=&Apache::loncommon::aboutmewrapper( - $plainname, - $contrib{$idx.':sendername'}, - $contrib{$idx.':senderdomain'}).' ('. - $contrib{$idx.':sendername'}.' at '. - $contrib{$idx.':senderdomain'}.')'; - if ($contrib{$idx.':anonymous'}) { - $sender.=' [anonymous] '. - $screenname; - } - if ($seeid) { - if ($hidden) { - $sender.=' Make Visible'; - } else { - $sender.=' Hide'; - } - $sender.=' Delete'; - } - } else { - if ($screenname) { - $sender=''.$screenname.''; - } - } - my $vgrlink; - if ($viewgrades) { - $vgrlink=&Apache::loncommon::submlink('Submissions',$contrib{$idx.':sendername'},$contrib{$idx.':senderdomain'},$symb); - } - $discussion.='

'.$sender.' '.$vgrlink.' ('. - localtime($contrib{$idx.':timestamp'}). - '):

'.$message. - '

'; - } - } - } - unless ($discussiononly) { - $discussion.='
'; - } - } - if ($discussiononly) { - $discussion.=(< - - - - -
-Note: in anonymous discussion, your name is visible only to -course faculty
- -

-Attachment (128 KB max size): -

- -ENDDISCUSS - $discussion.=&Apache::lonfeedback::generate_preview_button(); - } - } + $discussion=&Apache::lonfeedback::list_discussion + ($crs,$symb,$discussiononly); } return $discussion.($discussiononly?'':''); }