--- loncom/interface/lonfeedback.pm 2010/12/24 23:18:57 1.290.2.7
+++ loncom/interface/lonfeedback.pm 2011/12/12 03:04:30 1.312
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Feedback
#
-# $Id: lonfeedback.pm,v 1.290.2.7 2010/12/24 23:18:57 raeburn Exp $
+# $Id: lonfeedback.pm,v 1.312 2011/12/12 03:04:30 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -58,15 +58,15 @@ sub discussion_open {
return 1;
}
# It was not explicitly open, check if the problem is available.
-# If the problem is not available, close the discussion
+# If the problem is not available, close the discussion
if (defined($status) &&
- !($status eq 'CAN_ANSWER' || $status eq 'CANNOT_ANSWER'
- || $status eq 'OPEN')) {
- return 0;
+ !($status eq 'CAN_ANSWER' || $status eq 'CANNOT_ANSWER'
+ || $status eq 'OPEN')) {
+ return 0;
}
# The problem is available, but check if the instructor explictly closed discussion
if (defined($close) && $close ne '' && $close < time) {
- return 0;
+ return 0;
}
return 1;
}
@@ -135,7 +135,7 @@ sub list_discussion {
$crs=~s/\_/\//g;
my $encsymb=&Apache::lonenc::check_encrypt($ressymb);
my $viewgrades=(&Apache::lonnet::allowed('vgr',$crs)
- && ($ressymb=~/\.(problem|exam|quiz|assess|survey|form|task)$/));
+ && ($ressymb=~/$LONCAPA::assess_re/));
my %usernamesort = ();
my %namesort =();
@@ -281,17 +281,12 @@ sub list_discussion {
my $maxdepth=0;
my %anonhash=();
my $anoncnt=0;
- my $target='';
- unless ($env{'browser.interface'} eq 'textual' ||
- $env{'environment.remote'} eq 'off' ) {
- $target='target="LONcom"';
- }
my $now = time;
$discinfo{$visitkey} = $visit;
&Apache::lonnet::put('nohist_'.$cid.'_discuss',\%discinfo,$env{'user.domain'},$env{'user.name'});
- &build_posting_display(\%usernamesort,\%subjectsort,\%namesort,\%notshown,\%newitem,\%dischash,\%shown,\%alldiscussion,\%imsitems,\%imsfiles,\%roleinfo,\@discussionitems,\@replies,\@depth,\@posters,\$maxdepth,\$visible,\$newpostsflag,\$current,$status,$viewgrades,$seeid,$prevread,$sortposts,$encsymb,$target,$readkey,$showunmark,$showonlyunread,$totposters,\@rolefilter,\@sectionpick,\@grouppick,$classgroups,$statusfilter,$toggkey,$outputtarget,\%anonhash,$anoncnt,$group);
+ &build_posting_display(\%usernamesort,\%subjectsort,\%namesort,\%notshown,\%newitem,\%dischash,\%shown,\%alldiscussion,\%imsitems,\%imsfiles,\%roleinfo,\@discussionitems,\@replies,\@depth,\@posters,\$maxdepth,\$visible,\$newpostsflag,\$current,$status,$viewgrades,$seeid,$prevread,$sortposts,$encsymb,$readkey,$showunmark,$showonlyunread,$totposters,\@rolefilter,\@sectionpick,\@grouppick,$classgroups,$statusfilter,$toggkey,$outputtarget,\%anonhash,$anoncnt,$group);
my $discussion='';
my $manifestfile;
@@ -425,7 +420,6 @@ imscp_v1p1.xsd http://www.imsglobal.org/
}
} else {
my $colspan=$maxdepth+1;
-#JW
$discussion.= &Apache::lonhtmlcommon::scripttag(qq|
function verifydelete (caller,symb,idx,newflag,previous,groupparm) {
var symbparm = symb+':::'+idx
@@ -728,8 +722,8 @@ END
}
}
if ((&discussion_open($status)) && ($outputtarget ne 'tex')) {
- if (($group ne '') && ($mode eq 'board')) {
- if ((&check_group_priv($group,'pgd') eq 'ok') &&
+ if (($group ne '') && ($mode eq 'board')) {
+ if ((&check_group_priv($group,'pgd') eq 'ok') &&
($ressymb =~ m{^bulletin___\d+___adm/wrapper/adm/\Q$cdom\E/\Q$cnum\E/\d+/bulletinboard$})) {
$discussion .=
&postingform_display($mode,$ressymb,$now,$subject,
@@ -741,10 +735,10 @@ END
if (&Apache::lonnet::allowed('pch',$env{'request.course.id'}.
($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) {
- $discussion.=
- &postingform_display($mode,$ressymb,$now,$subject,
- $comment,$outputtarget,$attachnum,
- $currnewattach,$currdelold,'',$crstype);
+ $discussion.=
+ &postingform_display($mode,$ressymb,$now,$subject,
+ $comment,$outputtarget,$attachnum,
+ $currnewattach,$currdelold,'',$crstype);
} else {
$discussion.= ''.
&mt('This discussion is closed.').'';
@@ -761,7 +755,7 @@ END
&Apache::lonnet::allowed('pch',
$env{'request.course.id'}.
($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) {
- $discussion.= &send_feedback_link($ressymb,$target);
+ $discussion.= &send_feedback_link($ressymb);
if ($env{'request.role.adv'}) {
my $close = &Apache::lonnet::EXT('resource.0.discussend',$ressymb);
if (defined($close) && $close ne '' && $close < time) {
@@ -769,7 +763,7 @@ END
&Apache::lonnet::plaintext('st',$crstype));
}
}
- } else {
+ } else {
$discussion.= ''.&mt('This discussion is closed.').'';
}
$discussion.= &send_message_link($ressymb).'';
@@ -777,15 +771,25 @@ END
return $discussion;
}
+
+sub discussion_link {
+ my ($ressymb,$linktext,$cmd,$item,$flag,$prev,$adds)=@_;
+ my $link='/adm/feedback?inhibitmenu=yes&modal=yes&'.$cmd.'='.&escape($ressymb).':::'.$item;
+ if ($flag) { $link .= '&previous='.$prev; }
+ if ($adds) { $link .= $adds; }
+ return &Apache::loncommon::modal_link($link,$linktext,600,600);
+}
+
+
sub send_feedback_link {
- my ($ressymb,$target) = @_;
- my $output = ''.
- ' '.
- '';
- return $output;
+ my ($ressymb) = @_;
+ return ''.
+ &discussion_link($ressymb,
+ '';
}
sub send_message_link {
@@ -904,22 +908,22 @@ ENDDISCUSS
}
$postingform .= "\n";
$postingform .= &generate_attachments_button('',$attachnum,$ressymb,
- $now,$currnewattach,
- $currdelold,'',$mode,
- $blockblog);
+ $now,$currnewattach,
+ $currdelold,'',$mode,
+ $blockblog);
if ((ref($currnewattach) eq 'ARRAY') && (@{$currnewattach} > 0)) {
$newattachmsg = ' ',
+ 'replydisc').
+ '
'.$lt{'newa'}.'
';
if (@{$currnewattach} > 1) {
- $newattachmsg .= '
'.&Apache::lontexconvert::msgtexconverted($quote).''; } - + my $header=''; + unless ($env{'form.modal'}) { + $header="