diff 2.00/testcases.py @ 24:c23d81f4a1a3

Score returned by TestCase.__call__() is now normalized to 0..1 TestCase.__call__() now returns the fraction (a number from 0 to 1) of case.points that is to be awarded. Bug fix: %-patterns in configuration variables common to all problems are now substituted.
author Oleg Oshmyan <chortos@inbox.lv>
date Thu, 23 Sep 2010 00:11:24 +0000
parents c1f52b5d80d6
children b500e117080e
line wrap: on
line diff
--- a/2.00/testcases.py	Wed Sep 22 23:34:51 2010 +0000
+++ b/2.00/testcases.py	Thu Sep 23 00:11:24 2010 +0000
@@ -321,7 +321,7 @@
 					pass
 				else:
 					raise WrongAnswer
-			return case.points
+			return 1
 		elif callable(case.validator):
 			return case.validator(output)
 		else:                 
@@ -340,9 +340,9 @@
 				if case.process.returncode:
 					raise WrongAnswer(comment)
 				else:
-					return case.points, comment
+					return 1, comment
 			else:
-				return case.points * case.process.returncode / case.problem.config.maxexitcode, comment
+				return case.process.returncode / case.problem.config.maxexitcode, comment
 
 
 class BatchTestCase(ValidatedTestCase):