[LON-CAPA-cvs] cvs: loncom /homework structuretags.pm

foxr lon-capa-cvs@mail.lon-capa.org
Tue, 21 Nov 2006 10:01:32 -0000


foxr		Tue Nov 21 05:01:32 2006 EDT

  Modified files:              
    /loncom/homework	structuretags.pm 
  Log:
  Only print the <postanswerdate> block for persons with 'pav' for the
  course/section.
  
  
  
Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.369 loncom/homework/structuretags.pm:1.370
--- loncom/homework/structuretags.pm:1.369	Mon Nov 20 06:52:10 2006
+++ loncom/homework/structuretags.pm	Tue Nov 21 05:01:31 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # definition of tags that give a structure to a document
 #
-# $Id: structuretags.pm,v 1.369 2006/11/20 11:52:10 foxr Exp $
+# $Id: structuretags.pm,v 1.370 2006/11/21 10:01:31 foxr Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1490,10 +1490,14 @@
 # tags if the conditions are not right to display it.
 sub start_postanswerdate {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
+    my $pav = &Apache::lonnet::allowed('pav', $env{'request.course.id'}) ||
+	&Apache::lonnet::allowed('pav',
+			   $env{'request.course.id'}.'/'.$env{'request.course.sec'});
     if ($target eq 'web' || $target eq 'grade' || $target eq 'webgrade' ||
-	$target eq 'tex') {
+	$target eq 'tex' ) {
 	if ($Apache::lonhomework::scantronmode ||
-	    $Apache::inputtags::status['-1'] ne 'SHOW_ANSWER') {
+	    $Apache::inputtags::status['-1'] ne 'SHOW_ANSWER' ||
+	    (($target eq 'tex') && !$pav)) {
 	    &Apache::lonxml::get_all_text("/postanswerdate",$parser,$style);
 	}
     }