From f2e09edeb2e5b884f0e75ad3747b51e7603d70e1 Mon Sep 17 00:00:00 2001 From: prathamesh Date: Tue, 20 Jan 2015 17:05:41 +0530 Subject: Assignment upload interface implementation --- testapp/exam/forms.py | 1 + testapp/exam/models.py | 3 ++- testapp/exam/templates/exam/question.html | 19 ++++++++----------- testapp/exam/urls.py | 2 +- testapp/exam/views.py | 30 +++++++++++++++++++----------- 5 files changed, 31 insertions(+), 24 deletions(-) (limited to 'testapp/exam') diff --git a/testapp/exam/forms.py b/testapp/exam/forms.py index 169632d..843ed15 100644 --- a/testapp/exam/forms.py +++ b/testapp/exam/forms.py @@ -27,6 +27,7 @@ question_types = ( ("mcq", "Multiple Choice"), ("mcc", "Multiple Correct Choices"), ("code", "Code"), + ("basgn", "Bash Assignment"), ) UNAME_CHARS = letters + "._" + digits diff --git a/testapp/exam/models.py b/testapp/exam/models.py index 1cafa89..88ba9ef 100644 --- a/testapp/exam/models.py +++ b/testapp/exam/models.py @@ -30,6 +30,7 @@ question_types = ( ("mcq", "Multiple Choice"), ("mcc", "Multiple Correct Choices"), ("code", "Code"), + ("basgn", "Bash Assignment"), ) attempts = [(i, i) for i in range(1, 6)] attempts.append((-1, 'Infinite')) @@ -42,7 +43,7 @@ test_status = ( ) def get_assignment_dir(instance, filename): - return '%s/%s/' % (instance.user.roll_number, instance.assignment.description) + return '%s/%s' % (instance.user.roll_number, instance.assignmentQuestion.id) ############################################################################### class Question(models.Model): diff --git a/testapp/exam/templates/exam/question.html b/testapp/exam/templates/exam/question.html index f8888b1..03284ce 100644 --- a/testapp/exam/templates/exam/question.html +++ b/testapp/exam/templates/exam/question.html @@ -96,23 +96,18 @@ function setSnippetHeight()
- {% if question.type == "bash assignment" %} - - {% endif %} - -