--- loncom/interface/lonfeedback.pm 2002/10/11 20:52:13 1.34
+++ loncom/interface/lonfeedback.pm 2012/03/07 01:26:48 1.290.2.7.2.2
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Feedback
#
-# $Id: lonfeedback.pm,v 1.34 2002/10/11 20:52:13 www Exp $
+# $Id: lonfeedback.pm,v 1.290.2.7.2.2 2012/03/07 01:26:48 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -25,24 +25,7 @@
#
# http://www.lon-capa.org/
#
-# (Internal Server Error Handler
-#
-# (Login Screen
-# 5/21/99,5/22,5/25,5/26,5/31,6/2,6/10,7/12,7/14,
-# 1/14/00,5/29,5/30,6/1,6/29,7/1,11/9 Gerd Kortemeyer)
-#
-# 3/1/1 Gerd Kortemeyer)
-#
-# 3/1,2/3,2/5,2/6,2/8 Gerd Kortemeyer
-# 2/9 Guy Albertelli
-# 2/10 Gerd Kortemeyer
-# 2/13 Guy Albertelli
-# 7/25 Gerd Kortemeyer
-# 7/26 Guy Albertelli
-# 7/26,8/10,10/1,11/5,11/6,12/27,12/29 Gerd Kortemeyer
-# YEAR=2002
-# 1/1,1/16 Gerd Kortemeyer
-#
+###
package Apache::lonfeedback;
@@ -51,170 +34,2805 @@ use Apache::Constants qw(:common);
use Apache::lonmsg();
use Apache::loncommon();
use Apache::lontexconvert();
+use Apache::lonlocal; # must not have ()
+use Apache::lonnet;
+use Apache::lonhtmlcommon();
+use Apache::lonnavmaps;
+use Apache::lonenc();
+use Apache::lonrss();
+use HTML::LCParser();
+#use HTML::Tidy::libXML;
+use Apache::lonspeller();
+use Apache::longroup;
+use Cwd;
+use LONCAPA;
+
+sub discussion_open {
+ my ($status,$symb)=@_;
+# Advanced roles can always discuss
+ if ($env{'request.role.adv'}) { return 1; }
+# Get discussion closing date
+ my $close=&Apache::lonnet::EXT('resource.0.discussend',$symb);
+# If it is defined and in the future, the instructor wants this discussion to be open
+ if (defined($close) && $close ne '' && $close > time) {
+ return 1;
+ }
+# It was not explicitly open, check if the problem is available.
+# 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;
+ }
+# The problem is available, but check if the instructor explictly closed discussion
+ if (defined($close) && $close ne '' && $close < time) {
+ return 0;
+ }
+ return 1;
+}
-sub mail_screen {
- my ($r,$feedurl,$options) = @_;
- my $bodytag=&Apache::loncommon::bodytag('Resource Feedback and Discussion',
- '','onLoad="window.focus();"');
- $r->print(<$feedurl
-