summaryrefslogtreecommitdiff
path: root/yaksh
diff options
context:
space:
mode:
authorankitjavalkar2019-04-08 16:12:50 +0530
committerankitjavalkar2019-04-09 12:59:47 +0530
commit54e674c12704013377b9dd6b6c82df526f4e1cdb (patch)
tree64fac43ea99189bae9c689cce489c1043c0e07ee /yaksh
parente1eedca03401223e51ef26ae166a2319c5c89eee (diff)
downloadonline_test-54e674c12704013377b9dd6b6c82df526f4e1cdb.tar.gz
online_test-54e674c12704013377b9dd6b6c82df526f4e1cdb.tar.bz2
online_test-54e674c12704013377b9dd6b6c82df526f4e1cdb.zip
Fix PEP8 issues
Diffstat (limited to 'yaksh')
-rw-r--r--yaksh/models.py6
-rw-r--r--yaksh/test_models.py34
-rw-r--r--yaksh/views.py9
3 files changed, 29 insertions, 20 deletions
diff --git a/yaksh/models.py b/yaksh/models.py
index f9dda45..1e96ae1 100644
--- a/yaksh/models.py
+++ b/yaksh/models.py
@@ -720,8 +720,10 @@ class LearningModule(models.Model):
learning_units_with_quiz = self.learning_unit.filter(type='quiz')
ordered_units = learning_units_with_quiz.order_by("order")
- statuses = [unit.quiz.get_answerpaper_passing_status(user, course)
- for unit in ordered_units]
+ statuses = [
+ unit.quiz.get_answerpaper_passing_status(user, course)
+ for unit in ordered_units
+ ]
if not statuses:
status = False
diff --git a/yaksh/test_models.py b/yaksh/test_models.py
index d4e0141..1adf64a 100644
--- a/yaksh/test_models.py
+++ b/yaksh/test_models.py
@@ -153,25 +153,35 @@ class LearningModuleTestCases(unittest.TestCase):
self.course_status = CourseStatus.objects.get(
course=self.course, user=self.student)
- self.prereq_course = Course.objects.create(name="Prerequisite Course",
- enrollment="Enroll Request", creator=self.creator)
-
+ self.prereq_course = Course.objects.create(
+ name="Prerequisite Course",
+ enrollment="Enroll Request", creator=self.creator
+ )
self.prereq_learning_module = LearningModule.objects.create(
name='LM3', description='module one', creator=self.creator
- )
+ )
self.test_learning_module = LearningModule.objects.create(
- name='LM4', description='module two', creator=self.creator, order=1
- )
+ name='LM4', description='module two',
+ creator=self.creator, order=1
+ )
course_status = CourseStatus.objects.create(
course=self.prereq_course, user=self.student
)
- lesson = Lesson.objects.create(name='P1', description='Video Lesson',
- creator=self.creator)
- learning_unit_lesson = LearningUnit.objects.create(order=2, lesson=lesson,
- type='lesson')
- learning_unit_quiz = LearningUnit.objects.create(order=1, quiz=self.quiz,
- type='quiz')
+ lesson = Lesson.objects.create(
+ name='P1', description='Video Lesson',
+ creator=self.creator
+ )
+ learning_unit_lesson = LearningUnit.objects.create(
+ order=2,
+ lesson=lesson,
+ type='lesson'
+ )
+ learning_unit_quiz = LearningUnit.objects.create(
+ order=1,
+ quiz=self.quiz,
+ type='quiz'
+ )
self.prereq_learning_module.learning_unit.add(learning_unit_quiz)
self.prereq_learning_module.learning_unit.add(learning_unit_lesson)
self.prereq_learning_module.save()
diff --git a/yaksh/views.py b/yaksh/views.py
index 79fb537..526c774 100644
--- a/yaksh/views.py
+++ b/yaksh/views.py
@@ -480,8 +480,7 @@ def start(request, questionpaper_id=None, attempt_num=None, course_id=None,
if not learning_module.is_prerequisite_passed(user, course):
msg = (
"You have not successfully passed the module"
- " previous to {0}".format(
- learning_module.name)
+ " previous to {0}".format(learning_module.name)
)
return course_modules(request, course_id, msg)
@@ -2441,8 +2440,7 @@ def show_lesson(request, lesson_id, module_id, course_id):
if not learn_module.is_prerequisite_passed(user, course):
msg = (
"You have not successfully passed the module"
- " previous to {0}".format(
- learn_module.name)
+ " previous to {0}".format(learn_module.name)
)
return view_module(request, module_id, course_id, msg)
@@ -2767,8 +2765,7 @@ def view_module(request, module_id, course_id, msg=None):
if not learning_module.is_prerequisite_passed(user, course):
msg = (
"You have not successfully passed the module"
- " previous to {0}".format(
- learning_module.name)
+ " previous to {0}".format(learning_module.name)
)
return course_modules(request, course_id, msg)