diff options
author | ankitjavalkar | 2016-12-19 19:37:23 +0530 |
---|---|---|
committer | ankitjavalkar | 2016-12-20 12:46:04 +0530 |
commit | 798d36aa12e22928e884668ae5c80a25d48393ea (patch) | |
tree | 8de32b8f4eac72ad103272ab056c421c46718c11 /yaksh | |
parent | 4a0f94084bc26559ef3e26470619e87314f9d70e (diff) | |
download | online_test-798d36aa12e22928e884668ae5c80a25d48393ea.tar.gz online_test-798d36aa12e22928e884668ae5c80a25d48393ea.tar.bz2 online_test-798d36aa12e22928e884668ae5c80a25d48393ea.zip |
Change weight variable name to mark_fraction
Diffstat (limited to 'yaksh')
-rw-r--r-- | yaksh/bash_code_evaluator.py | 10 | ||||
-rw-r--r-- | yaksh/bash_stdio_evaluator.py | 6 | ||||
-rw-r--r-- | yaksh/code_evaluator.py | 4 | ||||
-rw-r--r-- | yaksh/cpp_code_evaluator.py | 6 | ||||
-rw-r--r-- | yaksh/cpp_stdio_evaluator.py | 6 | ||||
-rw-r--r-- | yaksh/java_code_evaluator.py | 6 | ||||
-rw-r--r-- | yaksh/java_stdio_evaluator.py | 6 | ||||
-rw-r--r-- | yaksh/python_assertion_evaluator.py | 6 | ||||
-rw-r--r-- | yaksh/python_stdio_evaluator.py | 6 |
9 files changed, 28 insertions, 28 deletions
diff --git a/yaksh/bash_code_evaluator.py b/yaksh/bash_code_evaluator.py index 43d7be7..1e6fc9c 100644 --- a/yaksh/bash_code_evaluator.py +++ b/yaksh/bash_code_evaluator.py @@ -60,7 +60,7 @@ class BashCodeEvaluator(BaseEvaluator): """ ref_code_path = self.test_case success = False - test_case_weight = 0.0 + mark_fraction = 0.0 self.submit_code_path = self.create_submit_code_file('submit.sh') self._set_file_as_executable(self.submit_code_path) @@ -103,8 +103,8 @@ class BashCodeEvaluator(BaseEvaluator): ) proc, stdnt_stdout, stdnt_stderr = ret if inst_stdout == stdnt_stdout: - test_case_weight = float(self.weight) if self.partial_grading else 0.0 - return True, "Correct answer", test_case_weight + mark_fraction = float(self.weight) if self.partial_grading else 0.0 + return True, "Correct answer", mark_fraction else: err = "Error: expected %s, got %s" % (inst_stderr, stdnt_stderr @@ -146,8 +146,8 @@ class BashCodeEvaluator(BaseEvaluator): proc, stdnt_stdout, stdnt_stderr = ret valid_answer = inst_stdout == stdnt_stdout if valid_answer and (num_lines == loop_count): - test_case_weight = float(self.weight) if self.partial_grading else 0.0 - return True, "Correct answer", test_case_weight + mark_fraction = float(self.weight) if self.partial_grading else 0.0 + return True, "Correct answer", mark_fraction else: err = ("Error:expected" " {0}, got {1}").format(inst_stdout+inst_stderr, diff --git a/yaksh/bash_stdio_evaluator.py b/yaksh/bash_stdio_evaluator.py index 38b48e6..63bf3dc 100644 --- a/yaksh/bash_stdio_evaluator.py +++ b/yaksh/bash_stdio_evaluator.py @@ -42,7 +42,7 @@ class BashStdioEvaluator(StdIOEvaluator): def check_code(self): success = False - test_case_weight = 0.0 + mark_fraction = 0.0 self.expected_input = str(self.expected_input).replace('\r', '') proc = subprocess.Popen("bash ./Test.sh", @@ -55,5 +55,5 @@ class BashStdioEvaluator(StdIOEvaluator): self.expected_input, self.expected_output ) - test_case_weight = float(self.weight) if self.partial_grading and success else 0.0 - return success, err, test_case_weight + mark_fraction = float(self.weight) if self.partial_grading and success else 0.0 + return success, err, mark_fraction diff --git a/yaksh/code_evaluator.py b/yaksh/code_evaluator.py index ae61752..095099b 100644 --- a/yaksh/code_evaluator.py +++ b/yaksh/code_evaluator.py @@ -144,9 +144,9 @@ class CodeEvaluator(object): for idx, test_case_instance in enumerate(test_case_instances): test_case_success = False test_case_instance.compile_code() - test_case_success, err, test_case_weight = test_case_instance.check_code() + test_case_success, err, mark_fraction = test_case_instance.check_code() if test_case_success: - weight += test_case_weight + weight += mark_fraction error += err + "\n" test_case_success_status[idx] = test_case_success diff --git a/yaksh/cpp_code_evaluator.py b/yaksh/cpp_code_evaluator.py index f97f274..f0c2029 100644 --- a/yaksh/cpp_code_evaluator.py +++ b/yaksh/cpp_code_evaluator.py @@ -114,7 +114,7 @@ class CppCodeEvaluator(BaseEvaluator): if the required permissions are not given to the file(s). """ success = False - test_case_weight = 0.0 + mark_fraction = 0.0 proc, stdnt_out, stdnt_stderr = self.compiled_user_answer stdnt_stderr = self._remove_null_substitute_char(stdnt_stderr) @@ -134,7 +134,7 @@ class CppCodeEvaluator(BaseEvaluator): proc, stdout, stderr = ret if proc.returncode == 0: success, err = True, "Correct answer" - test_case_weight = float(self.weight) if self.partial_grading else 0.0 + mark_fraction = float(self.weight) if self.partial_grading else 0.0 else: err = "{0} \n {1}".format(stdout, stderr) else: @@ -160,4 +160,4 @@ class CppCodeEvaluator(BaseEvaluator): except: err = "{0} \n {1}".format(err, stdnt_stderr) - return success, err, test_case_weight + return success, err, mark_fraction diff --git a/yaksh/cpp_stdio_evaluator.py b/yaksh/cpp_stdio_evaluator.py index 76c132d..6d4b55d 100644 --- a/yaksh/cpp_stdio_evaluator.py +++ b/yaksh/cpp_stdio_evaluator.py @@ -70,7 +70,7 @@ class CppStdioEvaluator(StdIOEvaluator): def check_code(self): success = False - test_case_weight = 0.0 + mark_fraction = 0.0 proc, stdnt_out, stdnt_stderr = self.compiled_user_answer stdnt_stderr = self._remove_null_substitute_char(stdnt_stderr) @@ -112,5 +112,5 @@ class CppStdioEvaluator(StdIOEvaluator): err = err + "\n" + e except: err = err + "\n" + stdnt_stderr - test_case_weight = float(self.weight) if self.partial_grading and success else 0.0 - return success, err, test_case_weight + mark_fraction = float(self.weight) if self.partial_grading and success else 0.0 + return success, err, mark_fraction diff --git a/yaksh/java_code_evaluator.py b/yaksh/java_code_evaluator.py index f94321e..5d3fd28 100644 --- a/yaksh/java_code_evaluator.py +++ b/yaksh/java_code_evaluator.py @@ -124,7 +124,7 @@ class JavaCodeEvaluator(BaseEvaluator): """ success = False - test_case_weight = 0.0 + mark_fraction = 0.0 proc, stdnt_out, stdnt_stderr = self.compiled_user_answer stdnt_stderr = self._remove_null_substitute_char(stdnt_stderr) @@ -143,7 +143,7 @@ class JavaCodeEvaluator(BaseEvaluator): proc, stdout, stderr = ret if proc.returncode == 0: success, err = True, "Correct answer" - test_case_weight = float(seelf.weight) if self.partial_grading else 0.0 + mark_fraction = float(seelf.weight) if self.partial_grading else 0.0 else: err = stdout + "\n" + stderr else: @@ -169,4 +169,4 @@ class JavaCodeEvaluator(BaseEvaluator): except: err = err + "\n" + stdnt_stderr - return success, err, test_case_weight + return success, err, mark_fraction diff --git a/yaksh/java_stdio_evaluator.py b/yaksh/java_stdio_evaluator.py index a3b528d..a5f5540 100644 --- a/yaksh/java_stdio_evaluator.py +++ b/yaksh/java_stdio_evaluator.py @@ -59,7 +59,7 @@ class JavaStdioEvaluator(StdIOEvaluator): def check_code(self): success = False - test_case_weight = 0.0 + mark_fraction = 0.0 proc, stdnt_out, stdnt_stderr = self.compiled_user_answer stdnt_stderr = self._remove_null_substitute_char(stdnt_stderr) if stdnt_stderr == '' or "error" not in stdnt_stderr: @@ -85,5 +85,5 @@ class JavaStdioEvaluator(StdIOEvaluator): err = err + "\n" + e except: err = err + "\n" + stdnt_stderr - test_case_weight = float(self.weight) if self.partial_grading and success else 0.0 - return success, err, test_case_weight + mark_fraction = float(self.weight) if self.partial_grading and success else 0.0 + return success, err, mark_fraction diff --git a/yaksh/python_assertion_evaluator.py b/yaksh/python_assertion_evaluator.py index 8e4f0b3..0b49cb0 100644 --- a/yaksh/python_assertion_evaluator.py +++ b/yaksh/python_assertion_evaluator.py @@ -66,7 +66,7 @@ class PythonAssertionEvaluator(BaseEvaluator): the required permissions are not given to the file(s). """ success = False - test_case_weight = 0.0 + mark_fraction = 0.0 try: tb = None _tests = compile(self.test_case, '<string>', mode='exec') @@ -86,6 +86,6 @@ class PythonAssertionEvaluator(BaseEvaluator): else: success = True err = '-----\nCorrect answer\nTest Case: {0}\n-----'.format(self.test_case) - test_case_weight = float(self.weight) if self.partial_grading else 0.0 + mark_fraction = float(self.weight) if self.partial_grading else 0.0 del tb - return success, err, test_case_weight + return success, err, mark_fraction diff --git a/yaksh/python_stdio_evaluator.py b/yaksh/python_stdio_evaluator.py index 0f24a27..07bd59c 100644 --- a/yaksh/python_stdio_evaluator.py +++ b/yaksh/python_stdio_evaluator.py @@ -65,13 +65,13 @@ class PythonStdioEvaluator(BaseEvaluator): def check_code(self): success = False - test_case_weight = 0.0 + mark_fraction = 0.0 tb = None if self.output_value == self.expected_output: success = True err = "Correct answer" - test_case_weight = self.weight + mark_fraction = self.weight else: success = False err = dedent(""" @@ -85,4 +85,4 @@ class PythonStdioEvaluator(BaseEvaluator): ) ) del tb - return success, err, test_case_weight + return success, err, mark_fraction |