--- loncom/interface/lonfeedback.pm 2006/11/30 08:51:20 1.225
+++ loncom/interface/lonfeedback.pm 2008/11/18 19:14:22 1.256
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Feedback
#
-# $Id: lonfeedback.pm,v 1.225 2006/11/30 08:51:20 albertel Exp $
+# $Id: lonfeedback.pm,v 1.256 2008/11/18 19:14:22 jms Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -27,6 +27,133 @@
#
###
+=pod
+
+=head1 NAME
+
+Apache::lonfeedback.pm
+
+=head1 SYNOPSIS
+
+Handles feedback from students to instructors and system administrators.
+
+Provides a screenshot of the current resource, as well as previous attempts if the resource was a homework.
+
+Used by lonmsg.pm.
+
+This is part of the LearningOnline Network with CAPA project
+described at http://www.lon-capa.org.
+
+=head1 OVERVIEW
+
+None
+
+=head1 SUBROUTINES
+
+=over
+
+=item discussion_open()
+
+=item discussion_visible()
+
+=item list_discussion()
+
+=item send_feedback_link()
+
+=item send_message_link()
+
+=item action_links_bar()
+
+=item postingform_display()
+
+=item build_posting_display
+
+=item filter_regexp()
+
+=item get_post_contents()
+
+=item replicate_attachments()
+
+=item mail_screen()
+
+=item print_display_options()
+
+=item print_sortfilter_options()
+
+=item print_showposters()
+
+=item get_post_versions()
+
+=item get_post_attachments()
+
+=item fail_redirect()
+
+=item redirect_back()
+
+=item no_redirect_back()
+
+=item screen_header()
+
+=item resource_output()
+
+=item clear_out_html()
+
+=item assemble_email()
+
+=item feedback_available()
+
+=item send_msg()
+
+=item adddiscuss()
+
+=item get_discussion_info()
+
+=item show_preview()
+
+=item newline_to_br()
+
+=item generate_preview_button()
+
+=item modify_attachments()
+
+=item process_attachments()
+
+=item generate_attachments_button()
+
+=item extract_attachments()
+
+=item construct_attachmenturl()
+
+=item add_blog_checkbox()
+
+=item has_discussion()
+
+=item sort_filter_names()
+
+=item handler()
+
+=item blocked_reply_or_edit()
+
+=item wrap_symb()
+
+=item dewrapper()
+
+=item get_feedurl()
+
+=item get_feedurl_and_clean_symb()
+
+=item editing_allowed()
+
+=item check_group_priv()
+
+=item group_args()
+
+=item get_resource_title()
+
+=back
+
+=cut
+
package Apache::lonfeedback;
use strict;
@@ -44,7 +171,6 @@ use HTML::LCParser();
use Apache::lonspeller();
use Apache::longroup;
use Cwd;
-use lib '/home/httpd/lib/perl/';
use LONCAPA;
sub discussion_open {
@@ -75,6 +201,9 @@ sub discussion_visible {
sub list_discussion {
my ($mode,$status,$ressymb,$imsextras,$group)=@_;
+ unless ($ressymb) { $ressymb=&Apache::lonnet::symbread(); }
+ unless ($ressymb) { return ''; }
+ $ressymb=&wrap_symb($ressymb);
my $outputtarget=$env{'form.grade_target'};
if (defined($env{'form.export'})) {
if($env{'form.export'}) {
@@ -86,16 +215,26 @@ sub list_discussion {
$outputtarget = 'export';
}
}
- if (not &discussion_visible($status)) { return ''; }
+ if (not &discussion_visible($status)) {
+ if ($mode ne 'board') {
+ &Apache::lonenc::check_encrypt(\$ressymb);
+ return '
'.&send_message_link($ressymb);
+ }
+ }
if ($group ne '' && $mode eq 'board') {
if (&check_group_priv($group,'vgb') ne 'ok') {
return '';
}
}
- my ($blocked,$blocktext) = &blocking_posts('boards',1);
+ my ($blocked,$blocktext) =
+ &Apache::loncommon::blocking_status('boards');
if ($blocked) {
- return $blocktext;
+ &Apache::lonenc::check_encrypt(\$ressymb);
+ if ($mode ne 'board') {
+ $blocktext.='
'.&send_message_link($ressymb);
+ }
+ return $blocktext;
}
my @bgcols = ("#cccccc","#eeeeee");
@@ -108,9 +247,6 @@ sub list_discussion {
$crs.='_'.$env{'request.course.sec'};
}
$crs=~s/\_/\//g;
- unless ($ressymb) { $ressymb=&Apache::lonnet::symbread(); }
- unless ($ressymb) { return ''; }
- $ressymb=&wrap_symb($ressymb);
my $encsymb=&Apache::lonenc::check_encrypt($ressymb);
my $viewgrades=(&Apache::lonnet::allowed('vgr',$crs)
&& ($ressymb=~/\.(problem|exam|quiz|assess|survey|form|task)$/));
@@ -628,7 +764,7 @@ END
}
}
if ($dischash{$toggkey}) {
- my $storebutton = &mt('Store read/unread changes');
+ my $storebutton = &mt('Save read/unread changes');
$discussion.='
NEW | '; +
'.&mt('NEW').' | '; } else { $$newitem{$idx} = 0; $$discussionitems[$idx] .= ' @@ -1459,7 +1599,7 @@ sub replicate_attachments { } sub mail_screen { - my ($r,$feedurl,$options) = @_; + my ($r,$feedurl,$options,$caller_symb,$attachmaxtext) = @_; if (exists($env{'form.origpage'})) { &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['subject','comment','currnewattach','addnewattach','deloldattach','delnewattach','timestamp','idx','anondiscuss','discuss','blog','group','ref']); } @@ -1469,10 +1609,9 @@ sub mail_screen { 'myqu' => 'My question/comment/feedback:', 'title' => 'Title', 'reta' => 'Retained attachments', - 'atta' => 'Attachment (128 KB max size)', - ); - my $title=&Apache::lonnet::gettitle($feedurl); - if (!$title) { $title = $feedurl; } + 'atta' => 'Attachment', + ); + my $restitle = &get_resource_title($caller_symb,$feedurl); my $quote=''; my $subject = ''; my $comment = ''; @@ -1660,7 +1799,7 @@ END $r->print(<