summaryrefslogtreecommitdiff
path: root/yaksh/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'yaksh/models.py')
-rw-r--r--yaksh/models.py4
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