Fix grading for Gated Subsections
TNL-5955
This commit is contained in:
@@ -11,7 +11,6 @@ from util.milestones_helpers import (
|
||||
add_prerequisite_course,
|
||||
fulfill_course_milestone,
|
||||
)
|
||||
from xmodule.modulestore.django import modulestore
|
||||
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
|
||||
|
||||
|
||||
@@ -85,28 +84,36 @@ class MobileAPIMilestonesMixin(object):
|
||||
|
||||
def _add_entrance_exam(self):
|
||||
""" Sets up entrance exam """
|
||||
self.course.entrance_exam_enabled = True
|
||||
with self.store.bulk_operations(self.course.id):
|
||||
self.course.entrance_exam_enabled = True
|
||||
|
||||
self.entrance_exam = ItemFactory.create( # pylint: disable=attribute-defined-outside-init
|
||||
parent=self.course,
|
||||
category="chapter",
|
||||
display_name="Entrance Exam Chapter",
|
||||
is_entrance_exam=True,
|
||||
in_entrance_exam=True
|
||||
)
|
||||
self.problem_1 = ItemFactory.create( # pylint: disable=attribute-defined-outside-init
|
||||
parent=self.entrance_exam,
|
||||
category='problem',
|
||||
display_name="The Only Exam Problem",
|
||||
graded=True,
|
||||
in_entrance_exam=True
|
||||
)
|
||||
self.entrance_exam = ItemFactory.create( # pylint: disable=attribute-defined-outside-init
|
||||
parent=self.course,
|
||||
category="chapter",
|
||||
display_name="Entrance Exam Chapter",
|
||||
is_entrance_exam=True,
|
||||
in_entrance_exam=True,
|
||||
)
|
||||
self.subsection_1 = ItemFactory.create( # pylint: disable=attribute-defined-outside-init
|
||||
parent=self.entrance_exam,
|
||||
category='sequential',
|
||||
display_name="The Only Exam Sequential",
|
||||
graded=True,
|
||||
in_entrance_exam=True,
|
||||
)
|
||||
self.problem_1 = ItemFactory.create( # pylint: disable=attribute-defined-outside-init
|
||||
parent=self.subsection_1,
|
||||
category='problem',
|
||||
display_name="The Only Exam Problem",
|
||||
graded=True,
|
||||
in_entrance_exam=True,
|
||||
)
|
||||
|
||||
add_entrance_exam_milestone(self.course, self.entrance_exam)
|
||||
add_entrance_exam_milestone(self.course, self.entrance_exam)
|
||||
|
||||
self.course.entrance_exam_minimum_score_pct = 0.50
|
||||
self.course.entrance_exam_id = unicode(self.entrance_exam.location)
|
||||
modulestore().update_item(self.course, self.user.id)
|
||||
self.course.entrance_exam_minimum_score_pct = 0.50
|
||||
self.course.entrance_exam_id = unicode(self.entrance_exam.location)
|
||||
self.store.update_item(self.course, self.user.id)
|
||||
|
||||
def _add_prerequisite_course(self):
|
||||
""" Helper method to set up the prerequisite course """
|
||||
|
||||
Reference in New Issue
Block a user