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

albertel lon-capa-cvs-allow@mail.lon-capa.org
Sat, 17 Nov 2007 02:03:46 -0000


albertel		Fri Nov 16 21:03:46 2007 EDT

  Modified files:              
    /loncom/homework	inputtags.pm 
  Log:
  - BUG#5520 - situations exist where a student can get marked 'correct_by_override' but have zero points. Prevent the display of a receipt in these cases
  
  
Index: loncom/homework/inputtags.pm
diff -u loncom/homework/inputtags.pm:1.234 loncom/homework/inputtags.pm:1.235
--- loncom/homework/inputtags.pm:1.234	Thu Nov  1 16:56:51 2007
+++ loncom/homework/inputtags.pm	Fri Nov 16 21:03:46 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # input  definitons
 #
-# $Id: inputtags.pm,v 1.234 2007/11/01 20:56:51 albertel Exp $
+# $Id: inputtags.pm,v 1.235 2007/11/17 02:03:46 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -667,14 +667,17 @@
 		$message.= $computer;
 	    }
 	    $added_computer_text=1;
-	    my ($symb) = &Apache::lonnet::whichuser();
-	    if (($symb ne '') 
-		&&
-		($env{'course.'.$env{'request.course.id'}.
-			    '.disable_receipt_display'} ne 'yes')) { 
-		$message.=(($target eq 'web')?'<br />':' ').
-		    &mt('Your receipt is').' '.&Apache::lonnet::receipt($Apache::inputtags::part).
-		    (($target eq 'web')?&Apache::loncommon::help_open_topic('Receipt'):'');
+	    if ($awarded > 0) {
+		my ($symb) = &Apache::lonnet::whichuser();
+		if (($symb ne '') 
+		    &&
+		    ($env{'course.'.$env{'request.course.id'}.
+			      '.disable_receipt_display'} ne 'yes')) { 
+		    $message.=(($target eq 'web')?'<br />':' ').
+			&mt('Your receipt is [_1]',
+			    (&Apache::lonnet::receipt($Apache::inputtags::part).
+			     (($target eq 'web')?&Apache::loncommon::help_open_topic('Receipt'):'')));
+		}
 	    }
 	}
 	$button=0;
@@ -701,12 +704,14 @@
 		$message.= $computer;
 	    }
 	    $added_computer_text=1;
-	    unless ($env{'course.'.
+	    if  ($awarded > 0 
+		 && $env{'course.'.
 			     $env{'request.course.id'}.
-			     '.disable_receipt_display'} eq 'yes') { 
+			     '.disable_receipt_display'} ne 'yes') { 
 		$message.=(($target eq 'web')?'<br />':' ').
-		    'Your receipt is '.&Apache::lonnet::receipt($Apache::inputtags::part).
-		    (($target eq 'web')?&Apache::loncommon::help_open_topic('Receipt'):'');
+		    &mt('Your receipt is [_1]',
+			(&Apache::lonnet::receipt($Apache::inputtags::part).
+			 (($target eq 'web')?&Apache::loncommon::help_open_topic('Receipt'):'')));
 	    }
 	    $css_class=$possible_class{'correct'};
 	    $button=0;