--- loncom/interface/lonfeedback.pm 2010/08/26 09:09:24 1.290.2.3 +++ loncom/interface/lonfeedback.pm 2010/08/26 03:59:16 1.301 @@ -1,7 +1,7 @@ # The LearningOnline Network # Feedback # -# $Id: lonfeedback.pm,v 1.290.2.3 2010/08/26 09:09:24 raeburn Exp $ +# $Id: lonfeedback.pm,v 1.301 2010/08/26 03:59:16 raeburn 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; } @@ -282,10 +282,6 @@ sub list_discussion { 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; @@ -425,7 +421,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 @@ -727,7 +722,7 @@ END $attachnum += @{$currnewattach}; } } - if (&discussion_open($status) && ($outputtarget ne 'tex')) { + if ((&discussion_open($status)) && ($outputtarget ne 'tex')) { if (($group ne '') && ($mode eq 'board')) { if (&check_group_priv($group,'pgd') eq 'ok') { $discussion .= @@ -749,7 +744,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,$target); if ($env{'request.role.adv'}) { my $close = &Apache::lonnet::EXT('resource.0.discussend',$ressymb); if (defined($close) && $close ne '' && $close < time) { @@ -757,11 +752,10 @@ END &Apache::lonnet::plaintext('st',$crstype)); } } - } else { + } else { $discussion.= ''.&mt('This discussion is closed.').''; } - $discussion.= &send_message_link($ressymb). - ''; + $discussion.= &send_message_link($ressymb).''; } return $discussion; } @@ -893,22 +887,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 = '
'.$lt{'newa'}.'
'; if (@{$currnewattach} > 1) { - $newattachmsg .= '
    '; - foreach my $item (@{$currnewattach}) { + $newattachmsg .= '
      '; + foreach my $item (@{$currnewattach}) { $item =~ m#.*/([^/]+)$#; $newattachmsg .= '
    1. '.$1.'
    2. '."\n"; - } - $newattachmsg .= '
    '."\n"; - } else { - $$currnewattach[0] =~ m#.*/([^/]+)$#; - $newattachmsg .= ''.$1.'
    '."\n"; - } + } + $newattachmsg .= '
'."\n"; + } else { + $$currnewattach[0] =~ m#.*/([^/]+)$#; + $newattachmsg .= ''.$1.'
'."\n"; + } } $postingform .= $newattachmsg; $postingform .= &generate_preview_button(); @@ -988,7 +982,7 @@ sub build_posting_display { } else { $$replies[$$depth[$idx]]=1; } - unless ((($hiddens{$idx}) && (!$seeid)) || (deletions{$idx})) { + unless ((($hiddens{$idx}) && (!$seeid)) || ($deletions{$idx})) { $$visible++; if ($contrib{$idx.':history'}) { if ($contrib{$idx.':history'} =~ /:/) { @@ -1104,11 +1098,11 @@ sub build_posting_display { } } } - if ($seeid) { + if ($seeid) { if ($hiddens{$idx}) { unless ($studenthidden) { $sender.=' '; } } - } else { + } else { if ($screenname) { $sender=''.$screenname.''; } else { @@ -1156,7 +1150,7 @@ sub build_posting_display { } } if ($outputtarget ne 'tex') { - if (&discussion_open($status)) { + if (&discussion_open($status)) { if (($group ne '') && (&check_group_priv($group,'pgd') eq 'ok')) { $sender.=' '.&mt('Reply').''; } } - if ($viewgrades) { + if ($viewgrades) { $vgrlink=&Apache::loncommon::submlink(&mt('Submissions'), $contrib{$idx.':sendername'},$contrib{$idx.':senderdomain'},$ressymb); } - if ($$dischash{$readkey}=~/\.$idx\./) { + if ($$dischash{$readkey}=~/\.$idx\./) { $ctlink = ''; } else { $ctlink = ''; @@ -1285,7 +1279,7 @@ sub build_posting_display { $$newitem{$idx} = 1; $$discussionitems[$idx] .= ' - '; + '; } else { $$newitem{$idx} = 0; $$discussionitems[$idx] .= ' @@ -1765,7 +1759,7 @@ $latexHelp

$lt{'title'}:

-

END if ( ($env{'form.editdisc'}) || ($env{'form.replydisc'}) ) { @@ -2565,10 +2559,6 @@ sub redirect_back { &Apache::lonenc::check_encrypt(\$feedurl); my $logo=&Apache::loncommon::lonhttpdurl('/adm/lonIcons/lonlogos.gif'); my %onload; - if ($env{'environment.remote'} ne 'off') { - $onload{'onload'} = - "if (window.name!='loncapaclient') { this.document.reldt.submit(); self.window.close(); }"; - } my $start_page= &Apache::loncommon::start_page('Feedback sent',undef, {'redirect' => [0,$feedurl], @@ -2602,10 +2592,6 @@ sub no_redirect_back { my $nofeed=&mt('Sorry, no feedback possible on this resource ...'); my %onload; - if ($env{'environment.remote'} ne 'off') { - $onload{'onload'} = - "if (window.name!='loncapaclient') { self.window.close(); }"; - } my %body_options = ('only_body' => 1, 'bgcolor' => '#FFFFFF', @@ -2735,8 +2721,8 @@ sub clear_out_html { #

#

'.&mt('NEW'). '
'.&mt('NEW').' 
%html=(B=>1, I=>1, P=>1, A=>1, LI=>1, OL=>1, UL=>1, EM=>1, - BR=>1, TT=>1, STRONG=>1, BLOCKQUOTE=>1, PRE=>1, DIV=>1, IMG=>1, - M=>1, CHEM=>1, ALGEBRA=>1, SUB=>1, SUP=>1, SPAN=>1, + BR=>1, TT=>1, STRONG=>1, BLOCKQUOTE=>1, PRE=>1, DIV=>1, IMG=>1, + M=>1, CHEM=>1, ALGEBRA=>1, SUB=>1, SUP=>1, SPAN=>1, H1=>1, H2=>1, H3=>1, H4=>1, H5=>1, H6=>1, TABLE=>1, TR=>1, TD=>1, TH=>1, TBODY=>1); } @@ -3612,10 +3598,6 @@ sub handler { $r->send_http_header; my $logo=&Apache::loncommon::lonhttpdurl('/adm/lonIcons/lonlogos.gif'); my %onload; - if ($env{'environment.remote'} ne 'off') { - $onload{'onload'} = - "if (window.name!='loncapaclient') { this.document.reldt.submit(); self.window.close(); }"; - } my $start_page= &Apache::loncommon::start_page('New posts marked as read',undef, @@ -3942,7 +3924,7 @@ ENDREDIR if ($env{'form.discuss'} =~ /^(?:author|question|course|policy)$/) { $override = 1; } - my $message=&clear_out_html($env{'form.comment'},1); + my $message=&clear_out_html($env{'form.comment'},$override); # Assemble email my ($email,$citations)=&assemble_email($message,$prevattempts,