[LON-CAPA-cvs] cvs: loncom /interface lonprintout.pm

sakharuk lon-capa-cvs@mail.lon-capa.org
Wed, 14 May 2003 18:06:36 -0000


sakharuk		Wed May 14 14:06:36 2003 EDT

  Modified files:              
    /loncom/interface	lonprintout.pm 
  Log:
   Two changes: 1. Additional test for the ability to print answers. Only those who have access to grades can do this fron the course. Anybody who has access to the construction space can print answers too.
  2. Answers are printed inside the problems body - at the very end.
  
  
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.169 loncom/interface/lonprintout.pm:1.170
--- loncom/interface/lonprintout.pm:1.169	Wed May 14 13:33:59 2003
+++ loncom/interface/lonprintout.pm	Wed May 14 14:06:36 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Printout
 #
-# $Id: lonprintout.pm,v 1.169 2003/05/14 17:33:59 albertel Exp $
+# $Id: lonprintout.pm,v 1.170 2003/05/14 18:06:36 sakharuk Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1388,7 +1388,7 @@
 		$form{'rndseed'}=$rndseed;
 		my $answer=&Apache::lonnet::ssi($currentURL,%form);
 #		$r->print('<pre>'.$answer.'</pre>'); return OK;
-		$texversion=~s/(\\end{document})/$answer$1/;
+		$texversion=~s/(\\keephidden{ENDOFPROBLEM})/$answer$1/;
 	    }
 	    $result .= $texversion;
 	    if ($currentURL=~m/\.page\s*$/) {
@@ -1891,7 +1891,8 @@
     $paramHash->{CHOICES} = $printChoices;
     Apache::lonhelper::choices->new();
 
-    if ($ENV{'request.role.adv'}) {
+    if (($ENV{'request.role.adv'} and &Apache::lonnet::allowed('vgr',$ENV{'request.course.id'})) or 
+	($helper->{VARS}->{'construction'} eq '1')) {
         $paramHash = Apache::lonhelper::getParamHash();
         $paramHash->{MESSAGE_TEXT} = "<br /><big><b><i>Next option is available only for advanced users:</i></b></big><br />";
         Apache::lonhelper::message->new();