diff options
author | mahesh | 2017-03-20 17:04:46 +0530 |
---|---|---|
committer | mahesh | 2017-03-20 17:04:46 +0530 |
commit | b5daabb45621ac47c98382303800cb7a240827c2 (patch) | |
tree | f3369879e3170a2a5e831fe6763a4615d27e2bec /yaksh/views.py | |
parent | ac292ed1099b49f9d0e8a7ed3699bacdd8031de3 (diff) | |
parent | 23ecd8fa33e7fa2e953aa9715ae45a2869a044a0 (diff) | |
download | online_test-b5daabb45621ac47c98382303800cb7a240827c2.tar.gz online_test-b5daabb45621ac47c98382303800cb7a240827c2.tar.bz2 online_test-b5daabb45621ac47c98382303800cb7a240827c2.zip |
Merge branch 'master' of https://github.com/fossee/online_test into fill_in_the_blanks
Diffstat (limited to 'yaksh/views.py')
-rw-r--r-- | yaksh/views.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/yaksh/views.py b/yaksh/views.py index 6929ced..ef24f06 100644 --- a/yaksh/views.py +++ b/yaksh/views.py @@ -21,7 +21,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 @@ -915,7 +914,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() @@ -928,7 +928,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 @@ -968,7 +969,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.""" |