summaryrefslogtreecommitdiff
path: root/yaksh/grader.py
diff options
context:
space:
mode:
authorPrabhu Ramachandran2017-01-03 18:10:24 +0530
committerGitHub2017-01-03 18:10:24 +0530
commit7ba65ddab30af0fdce75cecb8767c9a5c45af8a1 (patch)
tree75a69b163250d580557963d0f0dc0c7022ecbbd5 /yaksh/grader.py
parent011ca73b4c1042ceb208974e57c11474ecea65f2 (diff)
parentb617a0279a486ca4d98a2ca55d2f4d0fcf56e5e2 (diff)
downloadonline_test-7ba65ddab30af0fdce75cecb8767c9a5c45af8a1.tar.gz
online_test-7ba65ddab30af0fdce75cecb8767c9a5c45af8a1.tar.bz2
online_test-7ba65ddab30af0fdce75cecb8767c9a5c45af8a1.zip
Merge pull request #169 from ankitjavalkar/create_mark_fraction
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