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

albertel lon-capa-cvs@mail.lon-capa.org
Sun, 16 Nov 2003 03:23:17 -0000


albertel		Sat Nov 15 22:23:17 2003 EDT

  Modified files:              
    /loncom/homework	inputtags.pm 
  Log:
  - making it so you can inhibit the Submit answer button and the feedback on correctness by setting tries to a negative number
  
  
Index: loncom/homework/inputtags.pm
diff -u loncom/homework/inputtags.pm:1.122 loncom/homework/inputtags.pm:1.123
--- loncom/homework/inputtags.pm:1.122	Thu Oct 30 15:52:54 2003
+++ loncom/homework/inputtags.pm	Sat Nov 15 22:23:17 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # input  definitons
 #
-# $Id: inputtags.pm,v 1.122 2003/10/30 20:52:54 albertel Exp $
+# $Id: inputtags.pm,v 1.123 2003/11/16 03:23:17 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -642,6 +642,8 @@
     my $tries = $Apache::lonhomework::history{"resource.$id.tries"};
     my $maxtries = &Apache::lonnet::EXT("resource.$id.maxtries");
     &Apache::lonxml::debug("got maxtries of :$maxtries:");
+    #if tries are set to negative turn off the Tries/Button and messages
+    if (defined($maxtries) && $maxtries < 0) { return ''; }
     if ( $tries eq '' ) { $tries = '0'; }
     if ( $maxtries eq '' ) { $maxtries = '2'; } 
     if ( $maxtries eq 'con_lost' ) { $maxtries = '0'; }