diff options
author | Prabhu Ramachandran | 2016-10-04 15:44:05 +0530 |
---|---|---|
committer | GitHub | 2016-10-04 15:44:05 +0530 |
commit | 91dd42214ba5ad88c5158b50a7746caa3841a883 (patch) | |
tree | 188f8aa284783e844eccffe350839d6a18f4da8b /yaksh/views.py | |
parent | 6b08e56fe3cf70ffbcbd1ed432dde25babe48148 (diff) | |
parent | 59fa975a9fd0f6728cf62b1069abecac95a77b68 (diff) | |
download | online_test-91dd42214ba5ad88c5158b50a7746caa3841a883.tar.gz online_test-91dd42214ba5ad88c5158b50a7746caa3841a883.tar.bz2 online_test-91dd42214ba5ad88c5158b50a7746caa3841a883.zip |
Merge pull request #143 from adityacp/python2to3-migrate
Migration Python 2 to 3
Diffstat (limited to 'yaksh/views.py')
-rw-r--r-- | yaksh/views.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/yaksh/views.py b/yaksh/views.py index 4c5b9b8..0ed5f5a 100644 --- a/yaksh/views.py +++ b/yaksh/views.py @@ -21,6 +21,7 @@ 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 from yaksh.models import Profile, Answer, AnswerPaper, User, TestCase, FileUpload,\ @@ -29,9 +30,9 @@ from yaksh.forms import UserRegisterForm, UserLoginForm, QuizForm,\ QuestionForm, RandomQuestionForm,\ QuestionFilterForm, CourseForm, ProfileForm, UploadFileForm,\ get_object_form, FileForm -from settings import URL_ROOT +from .settings import URL_ROOT from yaksh.models import AssignmentUpload -from file_utils import extract_files +from .file_utils import extract_files @@ -982,7 +983,7 @@ def grade_user(request, quiz_id=None, user_id=None, attempt_number=None): if request.method == "POST": papers = data['papers'] for paper in papers: - for question, answers in paper.get_question_answers().iteritems(): + for question, answers in six.iteritems(paper.get_question_answers()): marks = float(request.POST.get('q%d_marks' % question.id, 0)) answers = answers[-1] answers.set_marks(marks) |