Annotation of loncom/interface/lonfeedback.pm, revision 1.99.2.7
1.1 www 1: # The LearningOnline Network
2: # Feedback
3: #
1.99.2.7! albertel 4: # $Id: lonfeedback.pm,v 1.99.2.6 2004/09/13 18:20:38 albertel Exp $
1.19 albertel 5: #
6: # Copyright Michigan State University Board of Trustees
7: #
8: # This file is part of the LearningOnline Network with CAPA (LON-CAPA).
9: #
10: # LON-CAPA is free software; you can redistribute it and/or modify
11: # it under the terms of the GNU General Public License as published by
12: # the Free Software Foundation; either version 2 of the License, or
13: # (at your option) any later version.
14: #
15: # LON-CAPA is distributed in the hope that it will be useful,
16: # but WITHOUT ANY WARRANTY; without even the implied warranty of
17: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18: # GNU General Public License for more details.
19: #
20: # You should have received a copy of the GNU General Public License
21: # along with LON-CAPA; if not, write to the Free Software
22: # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23: #
24: # /home/httpd/html/adm/gpl.txt
25: #
26: # http://www.lon-capa.org/
27: #
1.77 www 28: ###
1.7 albertel 29:
1.1 www 30: package Apache::lonfeedback;
31:
32: use strict;
33: use Apache::Constants qw(:common);
1.3 www 34: use Apache::lonmsg();
1.9 albertel 35: use Apache::loncommon();
1.33 www 36: use Apache::lontexconvert();
1.86 www 37: use Apache::lonlocal; # must not have ()
38: use Apache::lonhtmlcommon();
1.54 www 39:
1.92 albertel 40: sub discussion_open {
1.90 albertel 41: my ($status)=@_;
1.92 albertel 42: if (defined($status) &&
43: !($status eq 'CAN_ANSWER' || $status eq 'CANNOT_ANSWER'
1.77 www 44: || $status eq 'OPEN')) {
1.92 albertel 45: return 0;
1.75 albertel 46: }
1.89 albertel 47: my $close=&Apache::lonnet::EXT('resource.0.discussend');
48: if (defined($close) && $close ne '' && $close < time) {
1.92 albertel 49: return 0;
1.89 albertel 50: }
1.92 albertel 51: return 1;
52: }
53:
54: sub discussion_visible {
55: my ($status)=@_;
56: if (not &discussion_open($status)) {
57: my $hidden=&Apache::lonnet::EXT('resource.0.discusshide');
58: if (lc($hidden) eq 'yes' or $hidden eq '' or !defined($hidden)) {
59: return 0;
60: }
61: }
62: return 1;
1.90 albertel 63: }
1.84 raeburn 64:
1.90 albertel 65: sub list_discussion {
66: my ($mode,$status,$symb)=@_;
67:
1.95 sakharuk 68: my $outputtarget=$ENV{'form.grade_target'};
1.92 albertel 69: if (not &discussion_visible($status)) { return ''; }
1.84 raeburn 70: my @bgcols = ("#cccccc","#eeeeee");
1.57 www 71: my $discussiononly=0;
72: if ($mode eq 'board') { $discussiononly=1; }
1.55 www 73: unless ($ENV{'request.course.id'}) { return ''; }
74: my $crs='/'.$ENV{'request.course.id'};
75: if ($ENV{'request.course.sec'}) {
76: $crs.='_'.$ENV{'request.course.sec'};
77: }
78: $crs=~s/\_/\//g;
1.54 www 79: unless ($symb) {
80: $symb=&Apache::lonnet::symbread();
81: }
82: unless ($symb) { return ''; }
1.78 raeburn 83:
1.80 raeburn 84: # backward compatibility (bulletin boards used to be 'wrapped')
85: my $ressymb=$symb;
86: if ($mode eq 'board') {
87: unless ($ressymb =~ m|bulletin___\d+___adm/wrapper|) {
88: $ressymb=~s|(bulletin___\d+___)|$1adm/wrapper|;
89: }
90: }
91:
92: # Get discussion display settings for this discussion
93: my $lastkey = $ressymb.'_lastread';
94: my $showkey = $ressymb.'_showonlyunread';
95: my $visitkey = $ressymb.'_visit';
1.84 raeburn 96: my $ondispkey = $ressymb.'_markondisp';
97: my %dischash = &Apache::lonnet::get('nohist_'.$ENV{'request.course.id'}.'_discuss',[$lastkey,$showkey,$visitkey,$ondispkey],$ENV{'user.domain'},$ENV{'user.name'});
98: my %discinfo = ();
1.80 raeburn 99: my $showonlyunread = 0;
1.84 raeburn 100: my $markondisp = 0;
1.79 raeburn 101: my $prevread = 0;
1.81 raeburn 102: my $previous = 0;
1.80 raeburn 103: my $visit = 0;
104: my $newpostsflag = 0;
105:
1.81 raeburn 106: # Retain identification of "NEW" posts identified in last display, if continuing 'previous' browsing of posts.
107: &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['previous']);
108: $previous = $ENV{'form.previous'};
1.80 raeburn 109: if ($previous > 0) {
110: $prevread = $previous;
111: } elsif (defined($dischash{$lastkey})) {
1.84 raeburn 112: unless ($dischash{$lastkey} eq '') {
113: $prevread = $dischash{$lastkey};
114: }
1.80 raeburn 115: }
1.79 raeburn 116:
1.84 raeburn 117: # Get discussion display default settings for user
1.99.2.7! albertel 118: if ($ENV{'environment.discdisplay'} eq 'unread') {
1.83 raeburn 119: $showonlyunread = 1;
120: }
1.99.2.7! albertel 121: if ($ENV{'environment.discmarkread'} eq 'ondisp') {
1.84 raeburn 122: $markondisp = 1;
123: }
124:
125: # Override user's default if user specified display setting for this discussion
126: if (defined($dischash{$ondispkey})) {
1.99.2.6 albertel 127: unless ($dischash{$showkey} eq '') {
128: $markondisp = $dischash{$ondispkey};
129: }
1.84 raeburn 130: }
131: if ($markondisp) {
132: $discinfo{$lastkey} = time;
133: }
1.83 raeburn 134:
1.80 raeburn 135: if (defined($dischash{$showkey})) {
1.99.2.6 albertel 136: unless ($dischash{$showkey} eq '') {
137: $showonlyunread = $dischash{$showkey};
138: }
1.80 raeburn 139: }
140:
141: if (defined($dischash{$visitkey})) {
1.99.2.6 albertel 142: unless ($dischash{$showkey} eq '') {
143: $visit = $dischash{$visitkey};
144: }
1.78 raeburn 145: }
1.80 raeburn 146: $visit ++;
1.78 raeburn 147:
1.54 www 148: my $seeid=&Apache::lonnet::allowed('rin',$crs);
1.77 www 149: my $viewgrades=(&Apache::lonnet::allowed('vgr',$crs)
150: && ($symb=~/\.(problem|exam|quiz|assess|survey|form)$/));
1.68 www 151: my @discussionitems=();
1.73 albertel 152: my %contrib=&Apache::lonnet::restore($ressymb,$ENV{'request.course.id'},
1.54 www 153: $ENV{'course.'.$ENV{'request.course.id'}.'.domain'},
154: $ENV{'course.'.$ENV{'request.course.id'}.'.num'});
1.67 www 155: my $visible=0;
1.68 www 156: my @depth=();
157: my @original=();
158: my @index=();
159: my @replies=();
160: my %alldiscussion=();
1.80 raeburn 161: my %notshown = ();
1.84 raeburn 162: my %newitem = ();
1.68 www 163: my $maxdepth=0;
164:
1.69 www 165: my $target='';
166: unless ($ENV{'browser.interface'} eq 'textual' ||
167: $ENV{'environment.remote'} eq 'off' ) {
168: $target='target="LONcom"';
169: }
1.79 raeburn 170:
171: my $now = time;
1.80 raeburn 172: $discinfo{$visitkey} = $visit;
173:
174: &Apache::lonnet::put('nohist_'.$ENV{'request.course.id'}.'_discuss',\%discinfo,$ENV{'user.domain'},$ENV{'user.name'});
1.79 raeburn 175:
1.54 www 176: if ($contrib{'version'}) {
1.84 raeburn 177: my $oldest = $contrib{'1:timestamp'};
178: if ($prevread eq '0') {
179: $prevread = $oldest-1;
180: }
1.64 www 181: for (my $id=1;$id<=$contrib{'version'};$id++) {
182: my $idx=$id;
1.80 raeburn 183: my $posttime = $contrib{$idx.':timestamp'};
1.84 raeburn 184: if ($prevread <= $posttime) {
1.80 raeburn 185: $newpostsflag = 1;
186: }
1.54 www 187: my $hidden=($contrib{'hidden'}=~/\.$idx\./);
188: my $deleted=($contrib{'deleted'}=~/\.$idx\./);
1.68 www 189: my $origindex='0.';
1.69 www 190: if (($contrib{$idx.':replyto'}) && ($ENV{'environment.threadeddiscussion'})) {
1.68 www 191: # this is a follow-up message
192: $original[$idx]=$original[$contrib{$idx.':replyto'}];
193: $depth[$idx]=$depth[$contrib{$idx.':replyto'}]+1;
194: $origindex=$index[$contrib{$idx.':replyto'}];
195: if ($depth[$idx]>$maxdepth) { $maxdepth=$depth[$idx]; }
196: } else {
197: # this is an original message
198: $original[$idx]=0;
199: $depth[$idx]=0;
200: }
201: if ($replies[$depth[$idx]]) {
202: $replies[$depth[$idx]]++;
203: } else {
204: $replies[$depth[$idx]]=1;
205: }
1.54 www 206: unless ((($hidden) && (!$seeid)) || ($deleted)) {
1.67 www 207: $visible++;
1.54 www 208: my $message=$contrib{$idx.':message'};
209: $message=~s/\n/\<br \/\>/g;
210: $message=&Apache::lontexconvert::msgtexconverted($message);
1.78 raeburn 211: my $subject=$contrib{$idx.':subject'};
212: if (defined($subject)) {
213: $subject=~s/\n/\<br \/\>/g;
214: $subject=&Apache::lontexconvert::msgtexconverted($subject);
215: }
1.54 www 216: if ($contrib{$idx.':attachmenturl'}) {
1.82 albertel 217: my ($fname)
218: =($contrib{$idx.':attachmenturl'}=~m|/([^/]+)$|);
219: &Apache::lonnet::allowuploaded('/adm/feedback',
220: $contrib{$idx.':attachmenturl'});
221: $message.='<p>'.&mt('Attachment').
222: ': <a href="'.$contrib{$idx.':attachmenturl'}.'"><tt>'.
223: $fname.'</tt></a></p>';
1.54 www 224: }
225: if ($message) {
226: if ($hidden) {
227: $message='<font color="#888888">'.$message.'</font>';
228: }
1.99.2.7! albertel 229: # my $screenname=&Apache::loncommon::screenname(
! 230: # $contrib{$idx.':sendername'},
! 231: # $contrib{$idx.':senderdomain'});
! 232: # my $plainname=&Apache::loncommon::nickname(
! 233: # $contrib{$idx.':sendername'},
! 234: # $contrib{$idx.':senderdomain'});
! 235: ($$screenname,$$plainname)=($$contrib{$idx.':screenname'},
! 236: $$contrib{$idx.':plainname'});
1.62 www 237: my $sender=&mt('Anonymous');
1.54 www 238: if ((!$contrib{$idx.':anonymous'}) || ($seeid)) {
239: $sender=&Apache::loncommon::aboutmewrapper(
240: $plainname,
241: $contrib{$idx.':sendername'},
242: $contrib{$idx.':senderdomain'}).' ('.
243: $contrib{$idx.':sendername'}.' at '.
244: $contrib{$idx.':senderdomain'}.')';
245: if ($contrib{$idx.':anonymous'}) {
1.62 www 246: $sender.=' ['.&mt('anonymous').'] '.
1.54 www 247: $screenname;
248: }
249: if ($seeid) {
250: if ($hidden) {
251: $sender.=' <a href="/adm/feedback?unhide='.
1.80 raeburn 252: $ressymb.':::'.$idx;
253: if ($newpostsflag) {
254: $sender .= '&previous='.$prevread;
255: }
256: $sender .= '">'.&mt('Make Visible').'</a>';
1.54 www 257: } else {
258: $sender.=' <a href="/adm/feedback?hide='.
1.80 raeburn 259: $ressymb.':::'.$idx;
260: if ($newpostsflag) {
261: $sender .= '&previous='.$prevread;
262: }
263: $sender .= '">'.&mt('Hide').'</a>';
1.54 www 264: }
265: $sender.=' <a href="/adm/feedback?deldisc='.
1.80 raeburn 266: $ressymb.':::'.$idx;
267: if ($newpostsflag) {
268: $sender .= '&previous='.$prevread;
269: }
270: $sender .= '">'.&mt('Delete').'</a>';
1.64 www 271: }
1.54 www 272: } else {
273: if ($screenname) {
274: $sender='<i>'.$screenname.'</i>';
275: }
1.77 www 276: }
1.92 albertel 277: if (&discussion_open($status) &&
1.90 albertel 278: &Apache::lonnet::allowed('pch',
1.77 www 279: $ENV{'request.course.id'}.
280: ($ENV{'request.course.sec'}?'/'.$ENV{'request.course.sec'}:''))) {
281: $sender.=' <a href="/adm/feedback?replydisc='.
1.80 raeburn 282: $ressymb.':::'.$idx;
283: if ($newpostsflag) {
284: $sender .= '&previous='.$prevread;
285: }
286: $sender .= '" '.$target.'>'.&mt('Reply').'</a>';
1.54 www 287: }
288: my $vgrlink;
289: if ($viewgrades) {
290: $vgrlink=&Apache::loncommon::submlink('Submissions',
291: $contrib{$idx.':sendername'},$contrib{$idx.':senderdomain'},$symb);
292: }
1.68 www 293: #figure out at what position this needs to print
294: my $thisindex=$idx;
1.69 www 295: if ($ENV{'environment.threadeddiscussion'}) {
1.68 www 296: $thisindex=$origindex.substr('00'.$replies[$depth[$idx]],-2,2);
297: }
298: $alldiscussion{$thisindex}=$idx;
299: $index[$idx]=$thisindex;
1.79 raeburn 300: my $spansize = 2;
1.80 raeburn 301: if ($showonlyunread && $prevread > $posttime) {
302: $notshown{$idx} = 1;
1.78 raeburn 303: } else {
1.80 raeburn 304: if ($prevread > 0 && $prevread <= $posttime) {
1.84 raeburn 305: $newitem{$idx} = 1;
306: $discussionitems[$idx] .= '
307: <p><table border="0" width="100%">
308: <tr><td align="left"><font color="#FF0000"><b>NEW</b></font></td>';
309: } else {
310: $newitem{$idx} = 0;
311: $discussionitems[$idx] .= '
312: <p><table border="0" width="100%">
313: <tr><td align="left"> </td>';
1.80 raeburn 314: }
315: $discussionitems[$idx] .= '<td align ="left"> '.
316: '<b>'.$subject.'</b> '.
317: $sender.'</b> '.$vgrlink.' ('.
318: localtime($posttime).')</td></tr>'.
319: '</table><blockquote>'.$message.'</blockquote></p>';
1.78 raeburn 320: }
321: }
322: }
1.54 www 323: }
1.64 www 324: }
1.80 raeburn 325:
1.67 www 326: my $discussion='';
1.84 raeburn 327:
328: my $function = &Apache::loncommon::get_users_function();
329: my $color = &Apache::loncommon::designparm($function.'.tabbg',
330: $ENV{'user.domain'});
331: my %lt = &Apache::lonlocal::texthash(
1.97 raeburn 332: 'cuse' => 'Current discussion settings',
1.84 raeburn 333: 'allposts' => 'All posts',
334: 'unread' => 'New posts only',
335: 'ondisp' => 'Once displayed',
336: 'onmark' => 'Once marked read',
337: 'disa' => 'Posts to be displayed',
338: 'npce' => 'Posts cease to be marked "NEW"',
1.97 raeburn 339: 'chgt' => 'Change',
340: 'disp' => 'Display',
341: 'nolo' => 'Not new',
1.84 raeburn 342: );
343:
344: my $currdisp = $lt{'allposts'};
345: my $currmark = $lt{'onmark'};
346: my $dispchange = $lt{'unread'};
347: my $markchange = $lt{'ondisp'};
1.97 raeburn 348: my $chglink = '/adm/feedback?modifydisp='.$ressymb;
349: my $displink = 'onlyunread';
350: my $marklink = 'markondisp';
1.84 raeburn 351:
352: if ($markondisp) {
353: $currmark = $lt{'ondisp'};
354: $markchange = $lt{'onmark'};
1.97 raeburn 355: $marklink = 'markonread';
1.84 raeburn 356: }
357:
358: if ($showonlyunread) {
359: $currdisp = $lt{'unread'};
360: $dispchange = $lt{'allposts'};
1.97 raeburn 361: $displink = 'allposts';
1.84 raeburn 362: }
1.97 raeburn 363:
364: $chglink .= '&changes='.$displink.'_'.$marklink;
1.84 raeburn 365:
366: if ($newpostsflag) {
1.97 raeburn 367: $chglink .= '&previous='.$prevread;
1.84 raeburn 368: }
369:
1.67 www 370: if ($visible) {
1.80 raeburn 371: # Print the discusssion
1.95 sakharuk 372: if ($outputtarget ne 'tex') {
1.97 raeburn 373: my $colspan=$maxdepth+1;
1.95 sakharuk 374: $discussion.='<table bgcolor="#AAAAAA" cellpadding="2" cellspacing="2" border="0">';
1.97 raeburn 375: $discussion .='<tr><td bgcolor="#DDDDBB" colspan="'.$colspan.'">'.
1.95 sakharuk 376: '<table border="0" width="100%" bgcolor="#DDDDBB"><tr>';
377: if ($visible>2) {
378: $discussion.='<td align="left">'.
379: '<a href="/adm/feedback?threadedon='.$ressymb;
380: if ($newpostsflag) {
381: $discussion .= '&previous='.$prevread;
382: }
383: $discussion .='">'.&mt('Threaded View').'</a> '.
384: '<a href="/adm/feedback?threadedoff='.$ressymb;
385: if ($newpostsflag) {
386: $discussion .= '&previous='.$prevread;
387: }
388: $discussion .='">'.&mt('Chronological View').'</a> </td>';
1.99 raeburn 389: }
1.95 sakharuk 390: if ($newpostsflag) {
391: if (!$markondisp) {
392: $discussion .='<td align="right"><a href="/adm/feedback?markread='.$ressymb.'">'.&mt('Mark new posts as read').'</a> ';
393: } else {
394: $discussion .= '<td> </td>';
395: }
396: } else {
397: $discussion .= '<td> </td>';
398: }
399: $discussion .= '</tr></table></td></tr>';
400: } else {
401: $discussion.='\vskip 0 mm\noindent\makebox[2 cm][b]{\hrulefill}'.
402: '\textbf{DISCUSSIONS}\makebox[2 cm][b]{\hrulefill}'.
403: '\vskip 0 mm\noindent\textbf{'.$lt{'cuse'}.'}:\vskip 0 mm'.
404: '\noindent\textbf{'.$lt{'disa'}.'}: \textit{'.$currdisp.'}\vskip 0 mm'.
405: '\noindent\textbf{'.$lt{'npce'}.'}: \textit{'.$currmark.'}';
406: }
1.80 raeburn 407: my $numhidden = keys %notshown;
408: if ($numhidden > 0) {
409: my $colspan = $maxdepth+1;
410: $discussion.="\n".'<tr><td bgcolor="#CCCCCC" colspan="'.$colspan.'">'.
411: '<a href="/adm/feedback?allposts='.$ressymb;
412: if ($newpostsflag) {
413: $discussion .= '&previous='.$prevread;
414: }
415: $discussion .= '">'.&mt('Show all posts').'</a> '.&mt('to display').' '.
416: $numhidden.' '.&mt('previously viewed posts').
417: '<br/></td></tr>';
418: }
1.68 www 419: foreach (sort { $a <=> $b } keys %alldiscussion) {
1.80 raeburn 420: unless ($notshown{$alldiscussion{$_}} eq '1') {
1.95 sakharuk 421: if ($outputtarget ne 'tex') {
422: $discussion.="\n<tr>";
423: } else {
424: $discussion.='\vskip 0 mm\noindent\makebox[2 cm][b]{\hrulefill}';
425: }
1.80 raeburn 426: my $thisdepth=$depth[$alldiscussion{$_}];
1.95 sakharuk 427: if ($outputtarget ne 'tex') {
428: for (1..$thisdepth) {
429: $discussion.='<td> </td>';
430: }
431: }
1.80 raeburn 432: my $colspan=$maxdepth-$thisdepth+1;
1.95 sakharuk 433: if ($outputtarget ne 'tex') {
434: $discussion.='<td bgcolor="'.$bgcols[$newitem{$alldiscussion{$_}}].'" colspan="'.$colspan.'">'.
1.80 raeburn 435: $discussionitems[$alldiscussion{$_}].
436: '</td></tr>';
1.95 sakharuk 437: } else {
438: #cleanup block
439: $discussionitems[$alldiscussion{$_}]=~s/<table([^>]*)>/<table TeXwidth="90 mm">/;
440: $discussionitems[$alldiscussion{$_}]=~s/<tr([^>]*)><td([^>]*)>/<tr><td TeXwidth="20 mm" align="left">/;
441: my $threadinsert='';
442: if ($thisdepth > 0) {
443: $threadinsert='<br /><strong>Reply: '.$thisdepth.'</strong>';
444: }
445: $discussionitems[$alldiscussion{$_}]=~s/<\/td><td([^>]*)>/$threadinsert<\/td><td TeXwidth="65 mm" align="left">/;
446: $discussionitems[$alldiscussion{$_}]=~s/<a([^>]+)>(Hide|Delete|Reply|Submissions)<\/a>//g;
447: $discussionitems[$alldiscussion{$_}]=~s/(<b>|<\/b>|<\/a>|<a([^>]+)>)//g;
1.96 albertel 448:
449: #FIXME xmlparse can't be safely called from inside xmlparse
450: # due to the global variables that are use, the safe
451: # space etc. I expect this has unforseen issues that
452: # need resolving.
453:
454: $discussion.=&Apache::lonxml::xmlparse('','tex',$discussionitems[$alldiscussion{$_}]);
1.95 sakharuk 455: }
1.69 www 456: }
1.80 raeburn 457: }
1.95 sakharuk 458: if ($outputtarget ne 'tex') {
1.97 raeburn 459: my $colspan=$maxdepth+1;
460: $discussion .= <<END;
461: <tr bgcolor="#FFFFFF">
1.98 raeburn 462: <td colspan="$colspan" valign="top">
1.97 raeburn 463: <table border="0" bgcolor="#FFFFFF" width="100%" cellspacing="2" cellpadding="2">
464: <tr>
465: <td align="left">
466: <table border="0" cellpadding="0" cellspacing="4">
467: <tr>
468: <td>
469: <font size="-1"><b>$lt{'cuse'}</b>:</td>
470: <td> </td>
471: END
472: if ($newpostsflag) {
473: $discussion .=
474: '<td><font size="-1">1. '.$lt{'disp'}.' - <i>'.$currdisp.'</i> 2. '.$lt{'nolo'}.' - <i>'.$currmark.'</i></font></td>';
475: } else {
476: $discussion .=
477: '<td><font size="-1">'.$lt{'disp'}.' - <i>'.$currdisp.'</i></font></td>';
478: }
479: $discussion .= <<END;
480: <td> </td>
481: <td>
482: <font size="-1"><b><a href="$chglink">$lt{'chgt'}</a>?</font></b></td>
483: </tr>
484: </table>
485: </td>
486: </tr>
487: </table>
488: </td>
489: </tr>
490: </table>
491: <br /><br />
492: END
1.95 sakharuk 493: }
1.54 www 494: }
495: if ($discussiononly) {
496: $discussion.=(<<ENDDISCUSS);
497: <form action="/adm/feedback" method="post" name="mailform" enctype="multipart/form-data">
498: <input type="submit" name="discuss" value="Post Discussion" />
499: <input type="submit" name="anondiscuss" value="Post Anonymous Discussion" />
1.73 albertel 500: <input type="hidden" name="symb" value="$ressymb" />
1.54 www 501: <input type="hidden" name="sendit" value="true" />
502: <br />
503: <font size="1">Note: in anonymous discussion, your name is visible only to
504: course faculty</font><br />
1.78 raeburn 505: <b>Title:</b> <input type="text" name="subject" value="" size="30" /><br /><br />
1.94 www 506: <textarea name="comment" cols="80" rows="14" wrap="hard"></textarea>
1.54 www 507: <p>
508: Attachment (128 KB max size): <input type="file" name="attachment" />
509: </p>
510: </form>
511: ENDDISCUSS
1.95 sakharuk 512: if ($outputtarget ne 'tex') {
513: $discussion.=&generate_preview_button();
514: }
1.74 www 515: } else {
1.92 albertel 516: if (&discussion_open($status) &&
1.90 albertel 517: &Apache::lonnet::allowed('pch',
1.74 www 518: $ENV{'request.course.id'}.
519: ($ENV{'request.course.sec'}?'/'.$ENV{'request.course.sec'}:''))) {
1.95 sakharuk 520: if ($outputtarget ne 'tex') {
521: $discussion.='<table bgcolor="#BBBBBB"><tr><td><a href="/adm/feedback?replydisc='.
522: $symb.':::" '.$target.'>'.
523: '<img src="/adm/lonMisc/chat.gif" border="0" />'.
524: &mt('Post Discussion').'</a></td></tr></table>';
525: }
1.74 www 526: }
527: }
1.54 www 528: return $discussion;
529: }
1.1 www 530:
1.6 albertel 531: sub mail_screen {
532: my ($r,$feedurl,$options) = @_;
1.45 www 533: my $bodytag=&Apache::loncommon::bodytag('Resource Feedback and Discussion',
534: '','onLoad="window.focus();"');
1.51 albertel 535: my $title=&Apache::lonnet::gettitle($feedurl);
536: if (!$title) { $title = $feedurl; }
1.69 www 537: my $quote='';
1.78 raeburn 538: my $subject = '';
1.80 raeburn 539: my $prevtag = '';
1.69 www 540: if ($ENV{'form.replydisc'}) {
541: my ($symb,$idx)=split(/\:\:\:/,$ENV{'form.replydisc'});
542: my %contrib=&Apache::lonnet::restore($symb,$ENV{'request.course.id'},
543: $ENV{'course.'.$ENV{'request.course.id'}.'.domain'},
544: $ENV{'course.'.$ENV{'request.course.id'}.'.num'});
1.80 raeburn 545: unless (($contrib{'hidden'}=~/\.$idx\./) || ($contrib{'deleted'}=~/\.$idx\./)) {
1.69 www 546: my $message=$contrib{$idx.':message'};
547: $message=~s/\n/\<br \/\>/g;
548: $quote='<blockquote>'.&Apache::lontexconvert::msgtexconverted($message).'</blockquote>';
1.79 raeburn 549: if ($idx > 0) {
550: $subject = 'Re: '.$contrib{$idx.':subject'};
551: }
1.69 www 552: }
1.80 raeburn 553: if ($ENV{'form.previous'}) {
554: $prevtag = '<input type="hidden" name="previous" value="'.$ENV{'form.previous'}.'" />';
555: }
1.69 www 556: }
1.85 www 557: my $latexHelp=&Apache::loncommon::helpLatexCheatsheet();
1.86 www 558: my $htmlheader=&Apache::lonhtmlcommon::htmlareaheaders();
1.74 www 559: my $send=&mt('Send');
1.6 albertel 560: $r->print(<<ENDDOCUMENT);
1.1 www 561: <html>
562: <head>
563: <title>The LearningOnline Network with CAPA</title>
1.7 albertel 564: <meta http-equiv="pragma" content="no-cache"></meta>
1.85 www 565: $htmlheader
1.63 albertel 566: <script type="text/javascript">
567: //<!--
1.5 www 568: function gosubmit() {
569: var rec=0;
1.12 albertel 570: if (typeof(document.mailform.elements.author)!="undefined") {
1.5 www 571: if (document.mailform.elements.author.checked) {
572: rec=1;
573: }
574: }
1.12 albertel 575: if (typeof(document.mailform.elements.question)!="undefined") {
1.5 www 576: if (document.mailform.elements.question.checked) {
577: rec=1;
578: }
579: }
1.12 albertel 580: if (typeof(document.mailform.elements.course)!="undefined") {
1.5 www 581: if (document.mailform.elements.course.checked) {
582: rec=1;
583: }
584: }
1.12 albertel 585: if (typeof(document.mailform.elements.policy)!="undefined") {
1.5 www 586: if (document.mailform.elements.policy.checked) {
587: rec=1;
588: }
589: }
1.12 albertel 590: if (typeof(document.mailform.elements.discuss)!="undefined") {
1.10 www 591: if (document.mailform.elements.discuss.checked) {
592: rec=1;
593: }
594: }
1.14 www 595: if (typeof(document.mailform.elements.anondiscuss)!="undefined") {
596: if (document.mailform.elements.anondiscuss.checked) {
597: rec=1;
598: }
599: }
1.5 www 600:
601: if (rec) {
1.99.2.3 albertel 602: if (typeof(document.mailform.onsubmit)=='function') {
1.99.2.2 albertel 603: document.mailform.onsubmit();
604: }
1.5 www 605: document.mailform.submit();
606: } else {
607: alert('Please check a feedback type.');
608: }
609: }
1.63 albertel 610: //-->
1.5 www 611: </script>
1.1 www 612: </head>
1.29 www 613: $bodytag
1.51 albertel 614: <h2><tt>$title</tt></h2>
1.43 www 615: <form action="/adm/feedback" method="post" name="mailform"
616: enctype="multipart/form-data">
1.80 raeburn 617: $prevtag
1.63 albertel 618: <input type="hidden" name="postdata" value="$feedurl" />
1.68 www 619: <input type="hidden" name="replydisc" value="$ENV{'form.replydisc'}" />
1.5 www 620: Please check at least one of the following feedback types:
1.63 albertel 621: $options<hr />
1.69 www 622: $quote
1.63 albertel 623: <p>My question/comment/feedback:</p>
624: <p>
1.47 bowersj2 625: $latexHelp
1.78 raeburn 626: Title: <input type="text" name="subject" size="30" value="$subject" /></p>
627: <p>
1.94 www 628: <textarea name="comment" id="comment" cols="60" rows="10" wrap="hard">
1.63 albertel 629: </textarea></p>
630: <p>
1.42 www 631: Attachment (128 KB max size): <input type="file" name="attachment" />
632: </p>
633: <p>
634: <input type="hidden" name="sendit" value="1" />
1.74 www 635: <input type="button" value="$send" onClick='gosubmit();' />
1.42 www 636: </p>
1.2 www 637: </form>
1.1 www 638: ENDDOCUMENT
1.99.2.2 albertel 639: $r->print(&generate_preview_button().
1.94 www 640: &Apache::lonhtmlcommon::htmlareaselectactive('comment').
1.85 www 641: '</body></html>');
1.6 albertel 642: }
643:
1.97 raeburn 644: sub print_display_options {
645: my ($r,$symb,$previous,$dispchg,$markchg,$feedurl) = @_;
1.98 raeburn 646: # backward compatibility (bulletin boards used to be 'wrapped')
647: if ($feedurl=~m|^/adm/wrapper/adm/.*/bulletinboard$|) {
648: $feedurl=~s|^/adm/wrapper||;
649: }
650:
1.97 raeburn 651: my $function = &Apache::loncommon::get_users_function();
652: my $tabcolor = &Apache::loncommon::designparm($function.'.tabbg',
653: $ENV{'user.domain'});
654: my $bodytag=&Apache::loncommon::bodytag('Discussion options',
655: '','');
656:
657: my %lt = &Apache::lonlocal::texthash(
658: 'dido' => 'Discussion display options',
659: 'pref' => 'Display Preference',
660: 'curr' => 'Current setting ',
661: 'actn' => 'Action',
662: 'deff' => 'Default for all discussions',
663: 'prca' => 'Preferences can be set for this discussion that determine ....',
664: 'whpo' => 'Which posts are displayed when you display this bulletin board or resource, and',
665: 'unwh' => 'Under what circumstances posts are identfied as "New."',
666: 'allposts' => 'All posts',
667: 'unread' => 'New posts only',
668: 'ondisp' => 'Once displayed',
669: 'onmark' => 'Once marked as read',
670: 'disa' => 'Posts displayed?',
671: 'npmr' => 'New posts cease to be identified as "New"?',
672: 'chgt' => 'Change to ',
673: 'mkdf' => 'Set to ',
674: 'yhni' => 'You have not indicated that you wish to change either of the discussion settings',
675: 'ywbr' => 'You will be returned to the previous page if you click OK.'
676: );
677:
678: my $dispchange = $lt{'unread'};
679: my $markchange = $lt{'ondisp'};
680: my $currdisp = $lt{'allposts'};
681: my $currmark = $lt{'onmark'};
682: my $discdisp = 'allposts';
683: my $discmark = 'onmark';
684:
685: if ($dispchg eq 'allposts') {
686: $dispchange = $lt{'allposts'};
687: $currdisp = $lt{'unread'};
688: $discdisp = 'unread';
689: }
690:
691: if ($markchg eq 'markonread') {
692: $markchange = $lt{'onmark'};
693: $currmark = $lt{'ondisp'};
694: $discmark = 'ondisp';
695: }
696: $r->print(<<END);
697: <html>
698: <head>
699: <title>$lt{'dido'}</title>
700: <meta http-equiv="pragma" content="no-cache" />
701: <script>
702: function setDisp() {
703: var prev = "$previous"
704: var chktotal = 0
705: if (document.modifydisp.discdisp.checked == true) {
706: document.modifydisp.$dispchg.value = "$symb"
707: chktotal ++
708: }
709: if (document.modifydisp.discmark.checked == true) {
710: document.modifydisp.$markchg.value = "$symb"
711: chktotal ++
712: }
713: if (chktotal > 0) {
714: document.modifydisp.submit()
715: } else {
716: if(confirm("$lt{'yhni'}. \\n$lt{'ywbr'}")) {
717: if (prev > 0) {
718: location.href = "$feedurl?previous=$previous"
719: } else {
720: location.href = "$feedurl"
721: }
722: }
723: }
724: }
725: </script>
726: </head>
727: $bodytag
728: <form name="modifydisp" method="post" action="/adm/feedback">
729: $lt{'sdpf'}<br/> $lt{'prca'} <ol><li>$lt{'whpo'}</li><li>$lt{'unwh'}</li></ol>
730: <br />
731: <table border="0" cellpadding="0" cellspacing="0">
732: <tr>
733: <td width="100%" bgcolor="#000000">
734: <table width="100%" border="0" cellpadding="1" cellspacing="0">
735: <tr>
736: <td width="100%" bgcolor="#000000">
737: <table border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
738: <tr bgcolor="$tabcolor">
739: <td><b>$lt{'pref'}</b></td>
740: <td><b>$lt{'curr'}</b></td>
741: <td><b>$lt{'actn'}?</b></td>
742: </tr>
743: <tr bgcolor="#dddddd">
744: <td>$lt{'disa'}</td>
745: <td>$lt{$discdisp}</td>
746: <td><input type="checkbox" name="discdisp" /> $lt{'chgt'} "$dispchange"</td>
747: </tr><tr bgcolor="#eeeeee">
748: <td>$lt{'npmr'}</td>
749: <td>$lt{$discmark}</td>
750: <td><input type="checkbox" name="discmark" />$lt{'chgt'} "$markchange"</td>
751: </tr>
752: </table>
753: </td>
754: </tr>
755: </table>
756: </td>
757: </tr>
758: </table>
759: <br />
760: <br />
761: <input type="hidden" name="previous" value="$previous" />
762: <input type="hidden" name="$dispchg" value=""/>
763: <input type="hidden" name="$markchg" value=""/>
764: <input type="button" name="sub" value="Store Changes" onClick="javascript:setDisp()" />
765: <br />
766: <br />
767: </form>
768: </body>
769: </html>
770: END
771: return;
772: }
773:
1.6 albertel 774: sub fail_redirect {
775: my ($r,$feedurl) = @_;
1.70 www 776: if ($feedurl=~/^\/adm\//) { $feedurl.='?register=1' };
1.6 albertel 777: $r->print (<<ENDFAILREDIR);
1.72 albertel 778: <html>
1.5 www 779: <head><title>Feedback not sent</title>
1.63 albertel 780: <meta http-equiv="pragma" content="no-cache" />
781: <meta HTTP-EQUIV="Refresh" CONTENT="2; url=$feedurl" />
1.5 www 782: </head>
783: <body bgcolor="#FFFFFF">
1.63 albertel 784: <img align="right" src="/adm/lonIcons/lonlogos.gif" />
1.8 www 785: <b>Sorry, no recipients ...</b>
1.99.2.5 albertel 786: <br /><a href="$feedurl">Continue</a>
1.5 www 787: </body>
788: </html>
789: ENDFAILREDIR
790: }
1.4 www 791:
1.6 albertel 792: sub redirect_back {
1.80 raeburn 793: my ($r,$feedurl,$typestyle,$sendsomething,$sendposts,$status,$previous) = @_;
794: my $prevtag = '';
795: my $qrystr = '';
1.98 raeburn 796: # backward compatibility (bulletin boards used to be 'wrapped')
797: if ($feedurl=~m|^/adm/wrapper/adm/.*/bulletinboard$|) {
798: $feedurl=~s|^/adm/wrapper||;
799: }
800:
1.70 www 801: if ($feedurl=~/^\/adm\//) { $feedurl.='?register=1' };
1.80 raeburn 802: if ($previous > 0) {
803: $qrystr = 'previous='.$previous;
804: if ($feedurl =~ /\?register=1/) {
805: $feedurl .= '&'.$qrystr;
806: } else {
807: $feedurl .= '?'.$qrystr;
808: }
809: $prevtag = '<input type="hidden" name="previous" value="'.$previous.'" />';
810: }
1.6 albertel 811: $r->print (<<ENDREDIR);
1.72 albertel 812: <html>
1.3 www 813: <head>
814: <title>Feedback sent</title>
1.63 albertel 815: <meta http-equiv="pragma" content="no-cache" />
1.80 raeburn 816: <meta HTTP-EQUIV="Refresh" CONTENT="2; url=$feedurl" />
1.2 www 817: </head>
1.49 www 818: <body bgcolor="#FFFFFF" onLoad='if (window.name!="loncapaclient") { this.document.reldt.submit(); self.close(); }'>
1.63 albertel 819: <img align="right" src="/adm/lonIcons/lonlogos.gif" />
1.5 www 820: $typestyle
1.32 albertel 821: <b>Sent $sendsomething message(s), and $sendposts post(s).</b>
1.63 albertel 822: <font color="red">$status</font>
1.49 www 823: <form name="reldt" action="$feedurl" target="loncapaclient">
1.80 raeburn 824: $prevtag
1.49 www 825: </form>
1.99.2.5 albertel 826: <br /><a href="$feedurl">Continue</a>
1.2 www 827: </body>
828: </html>
829: ENDREDIR
830: }
1.6 albertel 831:
832: sub no_redirect_back {
833: my ($r,$feedurl) = @_;
834: $r->print (<<ENDNOREDIR);
1.72 albertel 835: <html>
1.2 www 836: <head><title>Feedback not sent</title>
1.63 albertel 837: <meta http-equiv="pragma" content="no-cache" />
1.7 albertel 838: ENDNOREDIR
839:
1.8 www 840: if ($feedurl!~/^\/adm\/feedback/) {
1.7 albertel 841: $r->print('<meta HTTP-EQUIV="Refresh" CONTENT="2; url='.$feedurl.'">');
842: }
843:
1.8 www 844: $r->print (<<ENDNOREDIRTWO);
1.2 www 845: </head>
1.49 www 846: <body bgcolor="#FFFFFF" onLoad='if (window.name!="loncapaclient") { self.close(); }'>
1.63 albertel 847: <img align="right" src="/adm/lonIcons/lonlogos.gif" />
1.8 www 848: <b>Sorry, no feedback possible on this resource ...</b>
1.99.2.5 albertel 849: <br /><a href="$feedurl">Continue</a>
1.2 www 850: </body>
851: </html>
1.8 www 852: ENDNOREDIRTWO
1.2 www 853: }
1.6 albertel 854:
855: sub screen_header {
1.65 www 856: my ($feedurl) = @_;
857: my $msgoptions='';
858: my $discussoptions='';
859: unless ($ENV{'form.replydisc'}) {
860: if (($feedurl=~/^\/res\//) && ($feedurl!~/^\/res\/adm/)) {
861: $msgoptions=
862: '<p><input type="checkbox" name="author" /> '.
863: &mt('Feedback to resource author').'</p>';
864: }
865: if (&feedback_available(1)) {
866: $msgoptions.=
867: '<br /><input type="checkbox" name="question" /> '.
868: &mt('Question about resource content');
869: }
870: if (&feedback_available(0,1)) {
871: $msgoptions.=
872: '<br /><input type="checkbox" name="course" /> '.
873: &mt('Question/Comment/Feedback about course content');
874: }
875: if (&feedback_available(0,0,1)) {
876: $msgoptions.=
877: '<br /><input type="checkbox" name="policy" /> '.
878: &mt('Question/Comment/Feedback about course policy');
879: }
880: }
881: if ($ENV{'request.course.id'}) {
1.92 albertel 882: if (&discussion_open() &&
1.90 albertel 883: &Apache::lonnet::allowed('pch',
1.65 www 884: $ENV{'request.course.id'}.
885: ($ENV{'request.course.sec'}?'/'.$ENV{'request.course.sec'}:''))) {
1.74 www 886: $discussoptions='<input type="checkbox" name="discuss" onClick="this.form.anondiscuss.checked=false;" '.
887: ($ENV{'form.replydisc'}?' checked="1"':'').' /> '.
1.65 www 888: &mt('Contribution to course discussion of resource');
889: $discussoptions.='<br /><input type="checkbox" name="anondiscuss" onClick="this.form.discuss.checked=false;" /> '.
890: &mt('Anonymous contribution to course discussion of resource').
891: ' <i>('.&mt('name only visible to course faculty').')</i>';
1.20 www 892: }
1.65 www 893: }
1.74 www 894: if ($msgoptions) { $msgoptions='<h2><img src="/adm/lonMisc/feedback.gif" />'.&mt('Sending Messages').'</h2>'.$msgoptions; }
1.65 www 895: if ($discussoptions) {
1.74 www 896: $discussoptions='<h2><img src="/adm/lonMisc/chat.gif" />'.&mt('Discussion Contributions').'</h2>'.$discussoptions; }
1.65 www 897: return $msgoptions.$discussoptions;
1.6 albertel 898: }
899:
900: sub resource_output {
901: my ($feedurl) = @_;
1.46 albertel 902: my $usersaw=&Apache::lonnet::ssi_body($feedurl);
1.6 albertel 903: $usersaw=~s/\<body[^\>]*\>//gi;
904: $usersaw=~s/\<\/body\>//gi;
905: $usersaw=~s/\<html\>//gi;
906: $usersaw=~s/\<\/html\>//gi;
907: $usersaw=~s/\<head\>//gi;
908: $usersaw=~s/\<\/head\>//gi;
909: $usersaw=~s/action\s*\=/would_be_action\=/gi;
910: return $usersaw;
911: }
912:
913: sub clear_out_html {
1.39 www 914: my ($message,$override)=@_;
1.88 www 915: unless (&Apache::lonhtmlcommon::htmlareablocked()) { return $message; }
1.37 albertel 916: my $cid=$ENV{'request.course.id'};
1.39 www 917: if (($ENV{"course.$cid.allow_limited_html_in_feedback"} =~ m/yes/i) ||
918: ($override)) {
1.37 albertel 919: # allows <B> <I> <P> <A> <LI> <OL> <UL> <EM> <BR> <TT> <STRONG>
1.88 www 920: # <BLOCKQUOTE> <DIV .*> <DIV> <IMG> <M> <SPAN> <H1> <H2> <H3> <H4> <SUB>
921: # <SUP>
1.37 albertel 922: my %html=(B=>1, I=>1, P=>1, A=>1, LI=>1, OL=>1, UL=>1, EM=>1,
1.61 www 923: BR=>1, TT=>1, STRONG=>1, BLOCKQUOTE=>1, DIV=>1, IMG=>1,
1.88 www 924: M=>1, SUB=>1, SUP=>1, SPAN=>1,
925: H1=>1, H2=>1, H3=>1, H4=>1, H5=>1);
1.37 albertel 926:
927: $message =~ s/\<(\/?\s*(\w+)[^\>\<]*)/
1.48 albertel 928: {($html{uc($2)}&&(length($1)<1000))?"\<$1":"\<$1"}/ge;
1.37 albertel 929: $message =~ s/(\<?\s*(\w+)[^\<\>]*)\>/
1.48 albertel 930: {($html{uc($2)}&&(length($1)<1000))?"$1\>":"$1\>"}/ge;
1.37 albertel 931: } else {
932: $message=~s/\</\<\;/g;
933: $message=~s/\>/\>\;/g;
934: }
1.6 albertel 935: return $message;
936: }
937:
938: sub assemble_email {
1.40 albertel 939: my ($feedurl,$message,$prevattempts,$usersaw,$useranswer)=@_;
1.6 albertel 940: my $email=<<"ENDEMAIL";
941: Refers to <a href="$feedurl">$feedurl</a>
942:
943: $message
944: ENDEMAIL
945: my $citations=<<"ENDCITE";
946: <h2>Previous attempts of student (if applicable)</h2>
947: $prevattempts
1.63 albertel 948: <br /><hr />
1.6 albertel 949: <h2>Original screen output (if applicable)</h2>
950: $usersaw
1.40 albertel 951: <h2>Correct Answer(s) (if applicable)</h2>
952: $useranswer
1.6 albertel 953: ENDCITE
954: return ($email,$citations);
955: }
956:
1.35 www 957: sub secapply {
958: my $rec=shift;
1.36 www 959: my $defaultflag=shift;
960: $rec=~s/\s+//g;
961: $rec=~s/\@/\:/g;
962: my ($adr,$sections)=($rec=~/^([^\(]+)\(([^\)]+)\)/);
963: if ($sections) {
964: foreach (split(/\;/,$sections)) {
965: if (($_ eq $ENV{'request.course.sec'}) ||
966: ($defaultflag && ($_ eq '*'))) {
967: return $adr;
968: }
969: }
970: } else {
971: return $rec;
972: }
973: return '';
1.35 www 974: }
975:
1.6 albertel 976: sub decide_receiver {
1.36 www 977: my ($feedurl,$author,$question,$course,$policy,$defaultflag) = @_;
1.6 albertel 978: my $typestyle='';
979: my %to=();
1.36 www 980: if ($ENV{'form.author'}||$author) {
1.8 www 981: $typestyle.='Submitting as Author Feedback<br>';
1.6 albertel 982: $feedurl=~/^\/res\/(\w+)\/(\w+)\//;
983: $to{$2.':'.$1}=1;
984: }
1.36 www 985: if ($ENV{'form.question'}||$question) {
1.8 www 986: $typestyle.='Submitting as Question<br>';
1.24 harris41 987: foreach (split(/\,/,
988: $ENV{'course.'.$ENV{'request.course.id'}.'.question.email'})
989: ) {
1.36 www 990: my $rec=&secapply($_,$defaultflag);
991: if ($rec) { $to{$rec}=1; }
1.24 harris41 992: }
1.6 albertel 993: }
1.36 www 994: if ($ENV{'form.course'}||$course) {
1.63 albertel 995: $typestyle.='Submitting as Comment<br />';
1.24 harris41 996: foreach (split(/\,/,
997: $ENV{'course.'.$ENV{'request.course.id'}.'.comment.email'})
998: ) {
1.36 www 999: my $rec=&secapply($_,$defaultflag);
1000: if ($rec) { $to{$rec}=1; }
1.24 harris41 1001: }
1.6 albertel 1002: }
1.36 www 1003: if ($ENV{'form.policy'}||$policy) {
1.63 albertel 1004: $typestyle.='Submitting as Policy Feedback<br />';
1.24 harris41 1005: foreach (split(/\,/,
1006: $ENV{'course.'.$ENV{'request.course.id'}.'.policy.email'})
1007: ) {
1.36 www 1008: my $rec=&secapply($_,$defaultflag);
1009: if ($rec) { $to{$rec}=1; }
1.24 harris41 1010: }
1.6 albertel 1011: }
1.36 www 1012: if ((scalar(%to) eq '0') && (!$defaultflag)) {
1013: ($typestyle,%to)=
1014: &decide_receiver($feedurl,$author,$question,$course,$policy,1);
1015: }
1.6 albertel 1016: return ($typestyle,%to);
1.36 www 1017: }
1018:
1019: sub feedback_available {
1020: my ($question,$course,$policy)=@_;
1021: my ($typestyle,%to)=&decide_receiver('',0,$question,$course,$policy);
1022: return scalar(%to);
1.6 albertel 1023: }
1024:
1025: sub send_msg {
1.43 www 1026: my ($feedurl,$email,$citations,$attachmenturl,%to)=@_;
1.6 albertel 1027: my $status='';
1028: my $sendsomething=0;
1.24 harris41 1029: foreach (keys %to) {
1.6 albertel 1030: if ($_) {
1.22 www 1031: my $declutter=&Apache::lonnet::declutter($feedurl);
1.8 www 1032: unless (&Apache::lonmsg::user_normal_msg(split(/\:/,$_),
1.43 www 1033: 'Feedback ['.$declutter.']',$email,$citations,$feedurl,
1034: $attachmenturl)=~/ok/) {
1.63 albertel 1035: $status.='<br />'.&mt('Error sending message to').' '.$_.'<br />';
1.6 albertel 1036: } else {
1037: $sendsomething++;
1038: }
1039: }
1.24 harris41 1040: }
1.18 www 1041:
1042: my %record=&Apache::lonnet::restore('_feedback');
1043: my ($temp)=keys %record;
1044: unless ($temp=~/^error\:/) {
1045: my %newrecord=();
1046: $newrecord{'resource'}=$feedurl;
1047: $newrecord{'subnumber'}=$record{'subnumber'}+1;
1048: unless (&Apache::lonnet::cstore(\%newrecord,'_feedback') eq 'ok') {
1.63 albertel 1049: $status.='<br />'.&mt('Not registered').'<br />';
1.18 www 1050: }
1051: }
1052:
1.6 albertel 1053: return ($status,$sendsomething);
1054: }
1055:
1.13 www 1056: sub adddiscuss {
1.78 raeburn 1057: my ($symb,$email,$anon,$attachmenturl,$subject)=@_;
1.13 www 1058: my $status='';
1.92 albertel 1059: if (&discussion_open() &&
1.90 albertel 1060: &Apache::lonnet::allowed('pch',$ENV{'request.course.id'}.
1.23 www 1061: ($ENV{'request.course.sec'}?'/'.$ENV{'request.course.sec'}:''))) {
1.20 www 1062:
1.13 www 1063: my %contrib=('message' => $email,
1064: 'sendername' => $ENV{'user.name'},
1.26 www 1065: 'senderdomain' => $ENV{'user.domain'},
1066: 'screenname' => $ENV{'environment.screenname'},
1067: 'plainname' => $ENV{'environment.firstname'}.' '.
1068: $ENV{'environment.middlename'}.' '.
1069: $ENV{'environment.lastname'}.' '.
1.42 www 1070: $ENV{'enrironment.generation'},
1.78 raeburn 1071: 'attachmenturl'=> $attachmenturl,
1072: 'subject' => $subject);
1.65 www 1073: if ($ENV{'form.replydisc'}) {
1.66 www 1074: $contrib{'replyto'}=(split(/\:\:\:/,$ENV{'form.replydisc'}))[1];
1.65 www 1075: }
1.14 www 1076: if ($anon) {
1077: $contrib{'anonymous'}='true';
1078: }
1.13 www 1079: if (($symb) && ($email)) {
1.14 www 1080: $status='Adding to class discussion'.($anon?' (anonymous)':'').': '.
1.13 www 1081: &Apache::lonnet::store(\%contrib,$symb,$ENV{'request.course.id'},
1082: $ENV{'course.'.$ENV{'request.course.id'}.'.domain'},
1.17 www 1083: $ENV{'course.'.$ENV{'request.course.id'}.'.num'});
1.21 www 1084: my %storenewentry=($symb => time);
1.63 albertel 1085: $status.='<br />'.&mt('Updating discussion time').': '.
1.21 www 1086: &Apache::lonnet::put('discussiontimes',\%storenewentry,
1087: $ENV{'course.'.$ENV{'request.course.id'}.'.domain'},
1088: $ENV{'course.'.$ENV{'request.course.id'}.'.num'});
1.13 www 1089: }
1.17 www 1090: my %record=&Apache::lonnet::restore('_discussion');
1091: my ($temp)=keys %record;
1092: unless ($temp=~/^error\:/) {
1093: my %newrecord=();
1094: $newrecord{'resource'}=$symb;
1095: $newrecord{'subnumber'}=$record{'subnumber'}+1;
1.63 albertel 1096: $status.='<br />'.&mt('Registering').': '.
1.21 www 1097: &Apache::lonnet::cstore(\%newrecord,'_discussion');
1.20 www 1098: }
1099: } else {
1100: $status.='Failed.';
1.17 www 1101: }
1.63 albertel 1102: return $status.'<br />';
1.13 www 1103: }
1104:
1.33 www 1105: # ----------------------------------------------------------- Preview function
1106:
1107: sub show_preview {
1108: my $r=shift;
1109: my $message=&clear_out_html($ENV{'form.comment'});
1110: $message=~s/\n/\<br \/\>/g;
1111: $message=&Apache::lontexconvert::msgtexconverted($message);
1.78 raeburn 1112: my $subject=&clear_out_html($ENV{'form.subject'});
1113: $subject=~s/\n/\<br \/\>/g;
1114: $subject=&Apache::lontexconvert::msgtexconverted($subject);
1.33 www 1115: $r->print('<table border="2"><tr><td>'.
1.78 raeburn 1116: '<b>Subject:</b> '.$subject.'<br /><br />'.
1.33 www 1117: $message.'</td></tr></table>');
1118: }
1119:
1120: sub generate_preview_button {
1.65 www 1121: my $pre=&mt("Show Preview");
1.33 www 1122: return(<<ENDPREVIEW);
1123: <form name="preview" action="/adm/feedback?preview=1" method="post" target="preview">
1.78 raeburn 1124: <input type="hidden" name="subject">
1.33 www 1125: <input type="hidden" name="comment" />
1.65 www 1126: <input type="button" value="$pre"
1.99.2.4 albertel 1127: onClick="if (typeof(document.mailform.onsubmit)=='function') {document.mailform.onsubmit();};this.form.comment.value=document.mailform.comment.value;this.form.subject.value=document.mailform.subject.value;this.form.submit();" />
1.33 www 1128: </form>
1129: ENDPREVIEW
1130: }
1.71 www 1131:
1.6 albertel 1132: sub handler {
1133: my $r = shift;
1.8 www 1134: if ($r->header_only) {
1.71 www 1135: &Apache::loncommon::content_type($r,'text/html');
1.8 www 1136: $r->send_http_header;
1137: return OK;
1138: }
1.15 www 1139:
1140: # --------------------------- Get query string for limited number of parameters
1141:
1.97 raeburn 1142: &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
1.99 raeburn 1143: ['hide','unhide','deldisc','postdata','preview','replydisc','threadedon','threadedoff','onlyunread','allposts','previous','markread','markonread','markondisp','modifydisp','changes','navmaps','navurl']);
1144: if ($ENV{'form.navmaps'}) {
1145: my %discinfo = ();
1146: my @resources = ();
1147: if ($ENV{'form.navmaps'} =~ /:/) {
1148: @resources = split/:/,$ENV{'form.navmaps'};
1149: } else {
1150: @resources = ("$ENV{'form.navmaps'}");
1151: }
1152: my $numitems = @resources;
1153: my $feedurl = '/adm/navmaps';
1154: if ($ENV{'form.navurl'}) {
1155: $feedurl .= '?'.$ENV{'form.navurl'};
1156: }
1157: my %lt = &Apache::lonlocal::texthash(
1158: 'mnpa' => 'Marked "New" posts as read in a total of',
1159: 'robb' => 'resources/bulletin boards.'
1160: );
1161: foreach (@resources) {
1162: # backward compatibility (bulletin boards used to be 'wrapped')
1163: my $ressymb=$_;
1164: if ($ressymb =~ m/bulletin___\d+___/) {
1165: unless ($ressymb =~ m|bulletin___\d+___adm/wrapper|) {
1166: $ressymb=~s|(bulletin___\d+___)|$1adm/wrapper/|;
1167: }
1168: }
1169: my $lastkey = $ressymb.'_lastread';
1170: $discinfo{$lastkey} = time;
1171: }
1172: &Apache::lonnet::put('nohist_'.$ENV{'request.course.id'}.'_discuss',\%discinfo,$ENV{'user.domain'},$ENV{'user.name'});
1173: &Apache::loncommon::content_type($r,'text/html');
1174: $r->send_http_header;
1175: $r->print (<<ENDREDIR);
1176: <html>
1177: <head>
1178: <title>New posts marked as read</title>
1179: <meta http-equiv="pragma" content="no-cache" />
1180: <meta HTTP-EQUIV="Refresh" CONTENT="2; url=$feedurl" />
1181: </head>
1182: <body bgcolor="#FFFFFF" onLoad='if (window.name!="loncapaclient") { this.document.reldt.submit(); self.close(); }'>
1183: <img align="right" src="/adm/lonIcons/lonlogos.gif" />
1184: <b>$lt{'mnpa'} $numitems $lt{'robb'}</b>
1185: <form name="reldt" action="$feedurl" target="loncapaclient">
1186: </form>
1.99.2.5 albertel 1187: <br /><a href="$feedurl">Continue</a>
1.99 raeburn 1188: </body>
1189: </html>
1190: ENDREDIR
1191: return OK;
1192: } elsif ($ENV{'form.modifydisp'}) {
1.84 raeburn 1193: &Apache::loncommon::content_type($r,'text/html');
1194: $r->send_http_header;
1.97 raeburn 1195: my $symb=$ENV{'form.modifydisp'};
1.84 raeburn 1196: my ($map,$ind,$url)=&Apache::lonnet::decode_symb($symb);
1.97 raeburn 1197: my $previous=$ENV{'form.previous'};
1198: my ($dispchg,$markchg) = split/_/,$ENV{'form.changes'};
1199: my $feedurl = &Apache::lonnet::clutter($url);
1.98 raeburn 1200: # backward compatibility (bulletin boards used to be 'wrapped')
1201: if ($feedurl=~m|^/adm/wrapper/adm/.*/bulletinboard$|) {
1202: $feedurl=~s|^/adm/wrapper||;
1203: }
1.97 raeburn 1204: &print_display_options($r,$symb,$previous,$dispchg,$markchg,$feedurl);
1205: return OK;
1206: } elsif (($ENV{'form.markondisp'}) || ($ENV{'form.markonread'}) || ($ENV{'form.allposts'}) || ($ENV{'form.onlyunread'}) ) {
1207: &Apache::loncommon::content_type($r,'text/html');
1208: $r->send_http_header;
1209: my $previous=$ENV{'form.previous'};
1210: my ($map,$ind,$url);
1211: if (($ENV{'form.markondisp'}) || ($ENV{'form.markonread'})) {
1212: # ---------------------- Modify setting for identification of 'NEW' posts in this discussion
1213: my $symb=$ENV{'form.markondisp'}?$ENV{'form.markondisp'}:$ENV{'form.markonread'};
1214: my $ressymb = $symb;
1215: ($map,$ind,$url)=&Apache::lonnet::decode_symb($symb);
1216: unless ($ressymb =~ m|bulletin___\d+___adm/wrapper|) {
1217: $ressymb=~s|(bulletin___\d+___)|$1adm/wrapper|;
1218: }
1219: my %discinfo = ();
1220: my $lastkey = $ressymb.'_lastread';
1221: my $ondispkey = $ressymb.'_markondisp';
1222: if ($ENV{'form.markondisp'}) {
1223: $discinfo{$lastkey} = time;
1224: $discinfo{$ondispkey} = 1;
1225: } elsif ($ENV{'form.markonread'}) {
1226: if ( $previous > 0 ) {
1227: $discinfo{$lastkey} = $previous;
1228: }
1229: $discinfo{$ondispkey} = 0;
1230: }
1231: &Apache::lonnet::put('nohist_'.$ENV{'request.course.id'}.'_discuss',\%discinfo,$ENV{'user.domain'},$ENV{'user.name'});
1.84 raeburn 1232: }
1.97 raeburn 1233: if (($ENV{'form.allposts'}) || ($ENV{'form.onlyunread'})) {
1234: # ----------------------------------------------------------------- Modify display setting for this discussion
1235: my $symb=$ENV{'form.allposts'}?$ENV{'form.allposts'}:$ENV{'form.onlyunread'};
1236: my $ressymb = $symb;
1237: ($map,$ind,$url)=&Apache::lonnet::decode_symb($symb);
1238: unless ($ressymb =~ m|bulletin___\d+___adm/wrapper|) {
1239: $ressymb=~s|(bulletin___\d+___)|$1adm/wrapper|;
1240: }
1241: my %discinfo = ();
1242: if ($ENV{'form.allposts'}) {
1243: $discinfo{$ressymb.'_showonlyunread'} = 0;
1244: } elsif ($ENV{'form.onlyunread'}) {
1245: $discinfo{$ressymb.'_showonlyunread'} = 1;
1.84 raeburn 1246: }
1.97 raeburn 1247: &Apache::lonnet::put('nohist_'.$ENV{'request.course.id'}.'_discuss',\%discinfo,$ENV{'user.domain'},$ENV{'user.name'});
1.84 raeburn 1248: }
1.97 raeburn 1249: if (($ENV{'form.markonread'}) || ($ENV{'form.allposts'}) || ($ENV{'form.onlyunread'}) ) {
1250: &redirect_back($r,&Apache::lonnet::clutter($url),&mt('Changed display status').'<br />','0','0','',$previous);
1251: } else {
1.84 raeburn 1252: &redirect_back($r,&Apache::lonnet::clutter($url),&mt('Changed display status').'<br />','0','0');
1253: }
1254: return OK;
1255: } elsif ($ENV{'form.markread'}) {
1256: # ----------------------------------------------------------------- Mark new posts as read
1257: &Apache::loncommon::content_type($r,'text/html');
1258: $r->send_http_header;
1259: my $symb=$ENV{'form.markread'};
1260: my $ressymb = $symb;
1261: my ($map,$ind,$url)=&Apache::lonnet::decode_symb($symb);
1262: unless ($ressymb =~ m|bulletin___\d+___adm/wrapper|) {
1263: $ressymb=~s|(bulletin___\d+___)|$1adm/wrapper|;
1.78 raeburn 1264: }
1.84 raeburn 1265: my %discinfo = ();
1266: my $lastkey = $ressymb.'_lastread';
1267: $discinfo{$lastkey} = time;
1268: &Apache::lonnet::put('nohist_'.$ENV{'request.course.id'}.'_discuss',\%discinfo,$ENV{'user.domain'},$ENV{'user.name'});
1269: &redirect_back($r,&Apache::lonnet::clutter($url),&mt('Changed reading status').'<br />','0','0');
1.78 raeburn 1270: return OK;
1271: } elsif (($ENV{'form.hide'}) || ($ENV{'form.unhide'})) {
1.15 www 1272: # ----------------------------------------------------------------- Hide/unhide
1.71 www 1273: &Apache::loncommon::content_type($r,'text/html');
1.15 www 1274: $r->send_http_header;
1275:
1276: my $entry=$ENV{'form.hide'}?$ENV{'form.hide'}:$ENV{'form.unhide'};
1277:
1278: my ($symb,$idx)=split(/\:\:\:/,$entry);
1.52 www 1279: my ($map,$ind,$url)=&Apache::lonnet::decode_symb($symb);
1.15 www 1280:
1281: my %contrib=&Apache::lonnet::restore($symb,$ENV{'request.course.id'},
1282: $ENV{'course.'.$ENV{'request.course.id'}.'.domain'},
1283: $ENV{'course.'.$ENV{'request.course.id'}.'.num'});
1284:
1285:
1286: my $currenthidden=$contrib{'hidden'};
1287:
1288: if ($ENV{'form.hide'}) {
1289: $currenthidden.='.'.$idx.'.';
1290: } else {
1291: $currenthidden=~s/\.$idx\.//g;
1292: }
1293: my %newhash=('hidden' => $currenthidden);
1.38 www 1294:
1295: &Apache::lonnet::store(\%newhash,$symb,$ENV{'request.course.id'},
1296: $ENV{'course.'.$ENV{'request.course.id'}.'.domain'},
1297: $ENV{'course.'.$ENV{'request.course.id'}.'.num'});
1298:
1299: &redirect_back($r,&Apache::lonnet::clutter($url),
1.80 raeburn 1300: &mt('Changed discussion status').'<br />','0','0','',$ENV{'form.previous'});
1.69 www 1301: } elsif (($ENV{'form.threadedon'}) || ($ENV{'form.threadedoff'})) {
1.72 albertel 1302: &Apache::loncommon::content_type($r,'text/html');
1303: $r->send_http_header;
1.69 www 1304: if ($ENV{'form.threadedon'}) {
1305: &Apache::lonnet::put('environment',{'threadeddiscussion' => 'on'});
1306: &Apache::lonnet::appenv('environment.threadeddiscussion' => 'on');
1307: } else {
1308: &Apache::lonnet::del('environment',['threadeddiscussion']);
1309: &Apache::lonnet::delenv('environment\.threadeddiscussion');
1.72 albertel 1310: }
1.69 www 1311: my $symb=$ENV{'form.threadedon'}?$ENV{'form.threadedon'}:$ENV{'form.threadedoff'};
1312: my ($map,$ind,$url)=&Apache::lonnet::decode_symb($symb);
1313: &redirect_back($r,&Apache::lonnet::clutter($url),
1.80 raeburn 1314: &mt('Changed discussion view mode').'<br />','0','0','',$ENV{'form.previous'});
1.38 www 1315: } elsif ($ENV{'form.deldisc'}) {
1316: # --------------------------------------------------------------- Hide for good
1.71 www 1317: &Apache::loncommon::content_type($r,'text/html');
1.38 www 1318: $r->send_http_header;
1319:
1320: my $entry=$ENV{'form.deldisc'};
1321:
1322: my ($symb,$idx)=split(/\:\:\:/,$entry);
1.52 www 1323: my ($map,$ind,$url)=&Apache::lonnet::decode_symb($symb);
1.38 www 1324:
1325: my %contrib=&Apache::lonnet::restore($symb,$ENV{'request.course.id'},
1326: $ENV{'course.'.$ENV{'request.course.id'}.'.domain'},
1327: $ENV{'course.'.$ENV{'request.course.id'}.'.num'});
1328:
1329:
1330: my $currentdeleted=$contrib{'deleted'};
1331:
1332: $currentdeleted.='.'.$idx.'.';
1333:
1334: my %newhash=('deleted' => $currentdeleted);
1.15 www 1335:
1336: &Apache::lonnet::store(\%newhash,$symb,$ENV{'request.course.id'},
1337: $ENV{'course.'.$ENV{'request.course.id'}.'.domain'},
1338: $ENV{'course.'.$ENV{'request.course.id'}.'.num'});
1339:
1.30 www 1340: &redirect_back($r,&Apache::lonnet::clutter($url),
1.80 raeburn 1341: &mt('Changed discussion status').'<br />','0','0','',$ENV{'form.previous'});
1.33 www 1342: } elsif ($ENV{'form.preview'}) {
1343: # -------------------------------------------------------- User wants a preview
1.76 albertel 1344: $r->content_type('text/html');
1345: $r->send_http_header;
1.33 www 1346: &show_preview($r);
1.15 www 1347: } else {
1348: # ------------------------------------------------------------- Normal feedback
1.6 albertel 1349: my $feedurl=$ENV{'form.postdata'};
1350: $feedurl=~s/^http\:\/\///;
1351: $feedurl=~s/^$ENV{'SERVER_NAME'}//;
1352: $feedurl=~s/^$ENV{'HTTP_HOST'}//;
1.62 www 1353: $feedurl=~s/\?.+$//;
1.8 www 1354:
1.66 www 1355: my $symb;
1356: if ($ENV{'form.replydisc'}) {
1357: $symb=(split(/\:\:\:/,$ENV{'form.replydisc'}))[0];
1358: my ($map,$id,$url)=&Apache::lonnet::decode_symb($symb);
1359: $feedurl=&Apache::lonnet::clutter($url);
1360: } else {
1361: $symb=&Apache::lonnet::symbread($feedurl);
1362: }
1.31 www 1363: unless ($symb) {
1364: $symb=$ENV{'form.symb'};
1365: if ($symb) {
1.52 www 1366: my ($map,$id,$url)=&Apache::lonnet::decode_symb($symb);
1.31 www 1367: $feedurl=&Apache::lonnet::clutter($url);
1368: }
1369: }
1.8 www 1370: my $goahead=1;
1371: if ($feedurl=~/\.(problem|exam|quiz|assess|survey|form)$/) {
1372: unless ($symb) { $goahead=0; }
1373: }
1.98 raeburn 1374: # backward compatibility (bulletin boards used to be 'wrapped')
1.73 albertel 1375: if ($feedurl=~m|^/adm/wrapper/adm/.*/bulletinboard$|) {
1376: $feedurl=~s|^/adm/wrapper||;
1377: }
1.8 www 1378: if ($goahead) {
1379: # Go ahead with feedback, no ambiguous reference
1.71 www 1380: &Apache::loncommon::content_type($r,'text/html');
1.8 www 1381: $r->send_http_header;
1.6 albertel 1382:
1.8 www 1383: if (
1.7 albertel 1384: (
1385: ($feedurl=~m:^/res:) && ($feedurl!~m:^/res/adm:)
1386: )
1387: ||
1388: ($ENV{'request.course.id'} && ($feedurl!~m:^/adm:))
1.31 www 1389: ||
1390: ($ENV{'request.course.id'} && ($symb=~/^bulletin\_\_\_/))
1.7 albertel 1391: ) {
1.6 albertel 1392: # --------------------------------------------------- Print login screen header
1393: unless ($ENV{'form.sendit'}) {
1394: my $options=&screen_header($feedurl);
1395: if ($options) {
1396: &mail_screen($r,$feedurl,$options);
1397: } else {
1398: &fail_redirect($r,$feedurl);
1399: }
1400: } else {
1401:
1402: # Get previous user input
1.9 albertel 1403: my $prevattempts=&Apache::loncommon::get_previous_attempt(
1.11 albertel 1404: $symb,$ENV{'user.name'},$ENV{'user.domain'},
1.9 albertel 1405: $ENV{'request.course.id'});
1.6 albertel 1406:
1407: # Get output from resource
1408: my $usersaw=&resource_output($feedurl);
1409:
1.50 albertel 1410: # Get resource answer (need to allow student to view grades for this to work)
1411: &Apache::lonnet::appenv(('allowed.vgr'=>'F'));
1.40 albertel 1412: my $useranswer=&Apache::loncommon::get_student_answers(
1413: $symb,$ENV{'user.name'},$ENV{'user.domain'},
1414: $ENV{'request.course.id'});
1.50 albertel 1415: &Apache::lonnet::delenv('allowed.vgr');
1.42 www 1416: # Get attachments, if any, and not too large
1417: my $attachmenturl='';
1418: if ($ENV{'form.attachment.filename'}) {
1419: unless (length($ENV{'form.attachment'})>131072) {
1.82 albertel 1420: $attachmenturl=&Apache::lonnet::userfileupload('attachment',undef,'feedback');
1.42 www 1421: }
1422: }
1.6 albertel 1423: # Filter HTML out of message (could be nasty)
1.39 www 1424: my $message=&clear_out_html($ENV{'form.comment'});
1.6 albertel 1425:
1426: # Assemble email
1.8 www 1427: my ($email,$citations)=&assemble_email($feedurl,$message,$prevattempts,
1.40 albertel 1428: $usersaw,$useranswer);
1429:
1.6 albertel 1430: # Who gets this?
1431: my ($typestyle,%to) = &decide_receiver($feedurl);
1432:
1433: # Actually send mail
1.43 www 1434: my ($status,$numsent)=&send_msg($feedurl,$email,$citations,
1435: $attachmenturl,%to);
1.13 www 1436:
1437: # Discussion? Store that.
1438:
1.32 albertel 1439: my $numpost=0;
1.13 www 1440: if ($ENV{'form.discuss'}) {
1.78 raeburn 1441: my $subject = &clear_out_html($ENV{'form.subject'});
1442: $typestyle.=&adddiscuss($symb,$message,0,$attachmenturl,$subject);
1.32 albertel 1443: $numpost++;
1.13 www 1444: }
1.6 albertel 1445:
1.14 www 1446: if ($ENV{'form.anondiscuss'}) {
1.78 raeburn 1447: my $subject = &clear_out_html($ENV{'form.subject'});
1448: $typestyle.=&adddiscuss($symb,$message,1,$attachmenturl,$subject);
1.32 albertel 1449: $numpost++;
1.14 www 1450: }
1451:
1452:
1.6 albertel 1453: # Receipt screen and redirect back to where came from
1.80 raeburn 1454: &redirect_back($r,$feedurl,$typestyle,$numsent,$numpost,$status,$ENV{'form.previous'});
1.6 albertel 1455:
1456: }
1.8 www 1457: } else {
1.7 albertel 1458: # Unable to give feedback
1.6 albertel 1459: &no_redirect_back($r,$feedurl);
1.8 www 1460: }
1461: } else {
1462: # Ambiguous Problem Resource
1.60 albertel 1463: if ( &Apache::lonnet::mod_perl_version() == 2 ) {
1.53 albertel 1464: &Apache::lonnet::cleanenv();
1.58 albertel 1465: }
1.53 albertel 1466: $r->internal_redirect('/adm/ambiguous');
1.6 albertel 1467: }
1.15 www 1468: }
1.6 albertel 1469: return OK;
1.1 www 1470: }
1471:
1472: 1;
1473: __END__
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>