diff options
author | ankitjavalkar | 2015-04-23 19:32:37 +0530 |
---|---|---|
committer | ankitjavalkar | 2015-04-26 19:46:01 +0530 |
commit | 17752a69114e7dbad266337e768013920aec8c0c (patch) | |
tree | 7f88fe72bda2dfca49e0032888fb0cb01cc73d1a /testapp/exam/evaluate_java.py | |
parent | 0580f99fecc0bb495beb5706e18246834174710b (diff) | |
download | online_test-17752a69114e7dbad266337e768013920aec8c0c.tar.gz online_test-17752a69114e7dbad266337e768013920aec8c0c.tar.bz2 online_test-17752a69114e7dbad266337e768013920aec8c0c.zip |
Code Review: Code refactoring
- Add from_json classmethod
- Question language is passed directly to the code server
- Fix errors in evaluation of code
- Fix test cases
Diffstat (limited to 'testapp/exam/evaluate_java.py')
-rw-r--r-- | testapp/exam/evaluate_java.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/testapp/exam/evaluate_java.py b/testapp/exam/evaluate_java.py index f908102..d3d4e2a 100644 --- a/testapp/exam/evaluate_java.py +++ b/testapp/exam/evaluate_java.py @@ -8,7 +8,7 @@ import importlib # local imports from evaluate_c import EvaluateC -from code_server import TestCode +from test_code import TestCode from registry import registry @@ -16,14 +16,14 @@ from registry import registry class EvaluateJava(EvaluateC, TestCode): """Tests the C code obtained from Code Server""" def evaluate_code(self): - submit_path = self._create_submit_code_file('Test.java') + submit_path = self.create_submit_code_file('Test.java') get_ref_path = self.ref_code_path - ref_path, test_case_path = self._set_test_code_file_path(get_ref_path) + ref_path, test_case_path = self.set_test_code_file_path(get_ref_path) success = False # Set file paths java_student_directory = os.getcwd() + '/' - java_ref_file_name = (ref_code_path.split('/')[-1]).split('.')[0], + java_ref_file_name = (ref_code_path.split('/')[-1]).split('.')[0] # Set command variables compile_command = 'javac {0}'.format(submit_code_path), @@ -46,4 +46,4 @@ class EvaluateJava(EvaluateC, TestCode): return success, err -registry.register('java', evaluate_java, EvaluateJava)
\ No newline at end of file +registry.register('java', EvaluateJava)
\ No newline at end of file |