summaryrefslogtreecommitdiff
path: root/yaksh/views.py
diff options
context:
space:
mode:
authoradityacp2016-09-30 17:55:40 +0530
committeradityacp2016-09-30 17:55:40 +0530
commit4a7762831ad7ae298f047e72e784630285219787 (patch)
treecb99df727a2ef49029d382114d0961817fc35f36 /yaksh/views.py
parent513f5a52fec1945250d2fe7d48f1f4e3103cf3a1 (diff)
downloadonline_test-4a7762831ad7ae298f047e72e784630285219787.tar.gz
online_test-4a7762831ad7ae298f047e72e784630285219787.tar.bz2
online_test-4a7762831ad7ae298f047e72e784630285219787.zip
modified views, models, forms for django as per python 3
Diffstat (limited to 'yaksh/views.py')
-rw-r--r--yaksh/views.py7
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)