summaryrefslogtreecommitdiff
path: root/testapp/exam/views.py
diff options
context:
space:
mode:
authorankitjavalkar2015-04-23 19:32:37 +0530
committerankitjavalkar2015-04-26 19:46:01 +0530
commit17752a69114e7dbad266337e768013920aec8c0c (patch)
tree7f88fe72bda2dfca49e0032888fb0cb01cc73d1a /testapp/exam/views.py
parent0580f99fecc0bb495beb5706e18246834174710b (diff)
downloadonline_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/views.py')
-rw-r--r--testapp/exam/views.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/testapp/exam/views.py b/testapp/exam/views.py
index 840f30a..508b623 100644
--- a/testapp/exam/views.py
+++ b/testapp/exam/views.py
@@ -1025,7 +1025,7 @@ def validate_answer(user, user_answer, question, info_parameter=None):
message = 'Correct answer'
elif question.type == 'code':
user_dir = get_user_dir(user)
- json_result = code_server.run_code(info_parameter, user_dir)
+ json_result = code_server.run_code(info_parameter, question.language, user_dir)
result = json.loads(json_result)
if result.get('success'):
correct = True