diff options
author | adityacp | 2017-03-15 18:12:31 +0530 |
---|---|---|
committer | adityacp | 2017-03-15 18:12:31 +0530 |
commit | e937c2a3a17bfc127af89a86e213e434350cd360 (patch) | |
tree | e9c2e8661419236d804de2c14af0b9ef76796aa9 /yaksh/models.py | |
parent | 5e500f3344a13d375d018312936280d88d47c93c (diff) | |
download | online_test-e937c2a3a17bfc127af89a86e213e434350cd360.tar.gz online_test-e937c2a3a17bfc127af89a86e213e434350cd360.tar.bz2 online_test-e937c2a3a17bfc127af89a86e213e434350cd360.zip |
Change assignment dir path and add condition for json data
Diffstat (limited to 'yaksh/models.py')
-rw-r--r-- | yaksh/models.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/yaksh/models.py b/yaksh/models.py index 9134663..4dcd2ec 100644 --- a/yaksh/models.py +++ b/yaksh/models.py @@ -66,7 +66,7 @@ test_status = ( def get_assignment_dir(instance, filename): return os.sep.join(( - str(instance.user.user), str(instance.assignmentQuestion.id), filename + instance.user.username, str(instance.assignmentQuestion.id), filename )) @@ -1145,7 +1145,7 @@ class AnswerPaper(models.Model): if set(user_answer) == set(expected_answers): result['success'] = True result['error'] = ['Correct answer'] - elif question.type == 'code': + elif question.type == 'code' or question.type == "upload": user_dir = self.user.profile.get_user_dir() json_result = code_server.run_code( question.language, json_data, user_dir |