[LON-CAPA-cvs] cvs: loncom(GCI_2) /homework structuretags.pm /interface lonindexer.pm

raeburn raeburn@source.lon-capa.org
Wed, 02 Dec 2009 18:22:20 -0000


raeburn		Wed Dec  2 18:22:20 2009 EDT

  Modified files:              (Branch: GCI_2)
    /loncom/homework	structuretags.pm 
    /loncom/interface	lonindexer.pm 
  Log:
  - Suppress unwanted button/text from lonindexer::showpreview()  
     when called by londocsgci.pm in GCI Test assembly.
  - Restore standard structuretags.pm behavior in other contexts (e.g., browsing 
    in RES space).
  - Unwanted <hr/> tag removed in GCI Test assembly context.
  - Preview files have .tn extension when generated for GCI Test Assembly.
  
  
Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.444.4.2.2.1 loncom/homework/structuretags.pm:1.444.4.2.2.2
--- loncom/homework/structuretags.pm:1.444.4.2.2.1	Fri Nov 27 21:20:44 2009
+++ loncom/homework/structuretags.pm	Wed Dec  2 18:22:12 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # definition of tags that give a structure to a document
 #
-# $Id: structuretags.pm,v 1.444.4.2.2.1 2009/11/27 21:20:44 www Exp $
+# $Id: structuretags.pm,v 1.444.4.2.2.2 2009/12/02 18:22:12 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -236,18 +236,19 @@
     $body_args{'no_auto_mt_title'} = 1;
     my $page_start = &Apache::loncommon::start_page($name,$extra_head,
 						    \%body_args);
-
-#    if (!defined($found{'body'}) 
-#	&& $env{'request.state'} ne 'construct'
-#	&& ($target eq 'web' || $target eq 'webgrade')) {
-#
-#	my ($symb,undef,undef,undef,$publicuser)= &Apache::lonnet::whichuser();
-#	if ($symb eq '' && !$publicuser) {
-#            $page_start .= '<p class="LC_info">'
-#                          .&mt('Browsing resource, all submissions are temporary.')
-#                          .'</p>';
-#       }
-#    }
+    unless ($env{'request.gcicontext'} eq 'buildtest') {
+        if (!defined($found{'body'}) 
+	    && $env{'request.state'} ne 'construct'
+	    && ($target eq 'web' || $target eq 'webgrade')) {
+
+	    my ($symb,undef,undef,undef,$publicuser)= &Apache::lonnet::whichuser();
+	    if ($symb eq '' && !$publicuser) {
+                $page_start .= '<p class="LC_info">'
+                              .&mt('Browsing resource, all submissions are temporary.')
+                              .'</p>';
+            }
+        }
+    }
 
     if (!defined($found{'body'}) && $env{'request.state'} ne 'construct') {
 	$page_start .= &Apache::lonxml::message_location();
@@ -895,29 +896,33 @@
 	    ($symb eq '' || $Apache::lonhomework::type eq 'practice')) {
 	    $form_tag_start.='<input type="hidden" name="rndseed" value="'.
 		$rndseed.'" />';
-#.
-#		    '<input type="submit" name="resetdata"
-#                             value="'.&mt('New Problem Variation').'" />';
+            unless ($env{'request.gcicontext'} eq 'buildtest') {
+		$form_tag_start .= '<input type="submit" name="resetdata"
+                             value="'.&mt('New Problem Variation').'" />';
+            }
 	    if (exists($env{'form.username'})) {
 		$form_tag_start.=
 		    '<input type="hidden" name="username"
                              value="'.$env{'form.username'}.'" />';
 	    }
-#            if ($env{'request.role.adv'}) {
-#                $form_tag_start.= ' <label class="LC_nobreak">'
-#                         .'<input type="checkbox" name="showallfoils"';
-#                if (defined($env{'form.showallfoils'})) {
-#                    $form_tag_start.=' checked="checked"';
-#                }
-#                $form_tag_start.= ' /> '
-#                                 .&mt('Show All Foils')
-#                                 .'</label>';
-#
-#	    }
+            unless ($env{'request.gcicontext'} eq 'buildtest') {
+                if ($env{'request.role.adv'}) {
+                    $form_tag_start.= ' <label class="LC_nobreak">'
+                             .'<input type="checkbox" name="showallfoils"';
+                    if (defined($env{'form.showallfoils'})) {
+                        $form_tag_start.=' checked="checked"';
+                    }
+                    $form_tag_start.= ' /> '
+                                     .&mt('Show All Foils')
+                                     .'</label>';
+                }
+	    }
             if ($Apache::lonhomework::type eq 'practice') {
                 $form_tag_start.=&practice_problem_header();
             }
-	    $form_tag_start.='<hr />';
+            unless ($env{'request.gcicontext'} eq 'buildtest') {
+	        $form_tag_start.='<hr />';
+            }
 	}
 
 	($status,$accessmsg,my $slot_name,my $slot) = 
Index: loncom/interface/lonindexer.pm
diff -u loncom/interface/lonindexer.pm:1.181.6.1 loncom/interface/lonindexer.pm:1.181.6.2
--- loncom/interface/lonindexer.pm:1.181.6.1	Wed Dec  2 17:46:46 2009
+++ loncom/interface/lonindexer.pm	Wed Dec  2 18:22:20 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Directory Indexer
 #
-# $Id: lonindexer.pm,v 1.181.6.1 2009/12/02 17:46:46 raeburn Exp $
+# $Id: lonindexer.pm,v 1.181.6.2 2009/12/02 18:22:20 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1296,8 +1296,12 @@
     my $output='';
     my $embstyle=&Apache::loncommon::fileembstyle($curfext);
     if ($embstyle eq 'ssi') {
-       my $cache=$Apache::lonnet::perlvar{'lonDocRoot'}.$filelink.
-                    '.tmp';
+       my $cache = $Apache::lonnet::perlvar{'lonDocRoot'}.$filelink;
+       if ($env{'request.gcicontext'} eq 'buildtest') {
+           $cache .= '.tn'; 
+       } else {
+           $cache .= '.tmp';
+       }
        if ((!$env{'form.updatedisplay'}) &&
                     (-e $cache)) {
           open(FH,$cache);