summaryrefslogtreecommitdiff
path: root/yaksh/views.py
diff options
context:
space:
mode:
authoradityacp2017-03-17 22:08:45 +0530
committeradityacp2017-03-17 22:08:45 +0530
commitf29b18cdb0062e124a8f534bebde112e31d308c5 (patch)
tree85ab68365da6f05263c614a230c2ec0fb17c5c8b /yaksh/views.py
parentb4b33cc37244ed59765c705c6d882c00ddc88c62 (diff)
parent23ecd8fa33e7fa2e953aa9715ae45a2869a044a0 (diff)
downloadonline_test-f29b18cdb0062e124a8f534bebde112e31d308c5.tar.gz
online_test-f29b18cdb0062e124a8f534bebde112e31d308c5.tar.bz2
online_test-f29b18cdb0062e124a8f534bebde112e31d308c5.zip
Merge https://github.com/fossee/online_test into assignment_upload_check
Diffstat (limited to 'yaksh/views.py')
-rw-r--r--yaksh/views.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/yaksh/views.py b/yaksh/views.py
index bd3540d..ff1ef99 100644
--- a/yaksh/views.py
+++ b/yaksh/views.py
@@ -20,7 +20,6 @@ import pytz
from taggit.models import Tag
from itertools import chain
import json
-import zipfile
import six
# Local imports.
from yaksh.models import get_model_class, Quiz, Question, QuestionPaper, QuestionSet, Course
@@ -909,7 +908,8 @@ def show_all_questions(request):
if request.POST.get('delete') == 'delete':
data = request.POST.getlist('question')
if data is not None:
- questions = Question.objects.filter(id__in=data, user_id=user.id, active=True)
+ questions = Question.objects.filter(id__in=data, user_id=user.id,
+ active=True)
for question in questions:
question.active = False
question.save()
@@ -922,7 +922,8 @@ def show_all_questions(request):
if file_name[-1] == "zip":
ques = Question()
files, extract_path = extract_files(questions_file)
- ques.read_json(extract_path, user, files)
+ context['message'] = ques.read_json(extract_path, user,
+ files)
else:
message = "Please Upload a ZIP file"
context['message'] = message
@@ -962,7 +963,6 @@ def show_all_questions(request):
return my_render_to_response('yaksh/showquestions.html', context,
context_instance=ci)
-
@login_required
def user_data(request, user_id, questionpaper_id=None):
"""Render user data."""