[LON-CAPA-cvs] cvs: loncom /interface lonfeedback.pm /xml lonxml.pm

albertel lon-capa-cvs@mail.lon-capa.org
Wed, 28 Jan 2004 16:10:26 -0000


albertel		Wed Jan 28 11:10:26 2004 EDT

  Modified files:              
    /loncom/xml	lonxml.pm 
    /loncom/interface	lonfeedback.pm 
  Log:
  - turning on the code to hide the FDBK discussion if the problem shouldn't allow it.
  -  currently only allows view of discussion when in 'CAN_ANSWER' 'CANNOT_ANSWER' modes
  
  
  
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.297 loncom/xml/lonxml.pm:1.298
--- loncom/xml/lonxml.pm:1.297	Tue Jan 20 21:33:05 2004
+++ loncom/xml/lonxml.pm	Wed Jan 28 11:10:26 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # XML Parser Module 
 #
-# $Id: lonxml.pm,v 1.297 2004/01/21 02:33:05 sakharuk Exp $
+# $Id: lonxml.pm,v 1.298 2004/01/28 16:10:26 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -192,7 +192,7 @@
 	$mode='problem';
 	$status=$Apache::inputtags::status[-1]; 
     }
-    return &Apache::lonfeedback::list_discussion().'</html>';
+    return &Apache::lonfeedback::list_discussion($mode,$status).'</html>';
 }
 
 sub tokeninputfield {
@@ -1294,10 +1294,10 @@
 }
 
 sub debug {
-  if ($Apache::lonxml::debug eq 1) {
-    $|=1;
-    print('<font size="-2"<pre>DEBUG:'.&HTML::Entities::encode($_[0])."</pre></font>\n");
-  }
+    if ($Apache::lonxml::debug eq "1") {
+	$|=1;
+	Apache->request->print('<font size="-2"<pre>DEBUG:'.&HTML::Entities::encode($_[0])."</pre></font>\n");
+    }
 }
 
 sub error {
Index: loncom/interface/lonfeedback.pm
diff -u loncom/interface/lonfeedback.pm:1.74 loncom/interface/lonfeedback.pm:1.75
--- loncom/interface/lonfeedback.pm:1.74	Mon Jan 12 21:31:09 2004
+++ loncom/interface/lonfeedback.pm	Wed Jan 28 11:10:26 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Feedback
 #
-# $Id: lonfeedback.pm,v 1.74 2004/01/13 02:31:09 www Exp $
+# $Id: lonfeedback.pm,v 1.75 2004/01/28 16:10:26 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -55,6 +55,10 @@
 
 sub list_discussion {
     my ($mode,$status,$symb)=@_;
+    &Apache::lonnet::logthis("status is $status");
+    if (!($status eq 'CAN_ANSWER' || $status eq 'CANNOT_ANSWER')) {
+	return '';
+    }
     my $discussiononly=0;
     if ($mode eq 'board') { $discussiononly=1; }
     unless ($ENV{'request.course.id'}) { return ''; }