summaryrefslogtreecommitdiff
path: root/yaksh/grader.py
diff options
context:
space:
mode:
authorankitjavalkar2016-12-27 15:52:07 +0530
committerankitjavalkar2016-12-27 15:52:07 +0530
commitb617a0279a486ca4d98a2ca55d2f4d0fcf56e5e2 (patch)
tree7b10d5342eb289d4d9c24e17b5a1471b8dea14c2 /yaksh/grader.py
parent48366e84b98157ac32b22b2aa19b1c1cde68afd4 (diff)
downloadonline_test-b617a0279a486ca4d98a2ca55d2f4d0fcf56e5e2.tar.gz
online_test-b617a0279a486ca4d98a2ca55d2f4d0fcf56e5e2.tar.bz2
online_test-b617a0279a486ca4d98a2ca55d2f4d0fcf56e5e2.zip
Add floating point mark_weight to control test case weightage
Diffstat (limited to 'yaksh/grader.py')
-rw-r--r--yaksh/grader.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/yaksh/grader.py b/yaksh/grader.py
index 0c057c2..086abb7 100644
--- a/yaksh/grader.py
+++ b/yaksh/grader.py
@@ -100,10 +100,10 @@ class Grader(object):
self.setup()
test_case_instances = self.get_evaluator_objects(kwargs)
with change_dir(self.in_dir):
- success, error, mark = self.safe_evaluate(test_case_instances)
+ success, error, weight = self.safe_evaluate(test_case_instances)
self.teardown()
- result = {'success': success, 'error': error, 'weight': mark}
+ result = {'success': success, 'error': error, 'weight': weight}
return result
# Private Protocol ##########
@@ -144,7 +144,7 @@ class Grader(object):
test_case_instance.compile_code()
test_case_success, err, mark_fraction = test_case_instance.check_code()
if test_case_success:
- weight += mark_fraction
+ weight += mark_fraction * test_case_instance.weight
else:
error.append(err)
test_case_success_status[idx] = test_case_success