def make_ccx_membership(self): """create registration of self.user in self.ccx registration will be inactive """ self.create_user() CcxMembershipFactory.create(ccx=self.ccx, student=self.user)
def make_ccx_membership(self, active=True): """create registration of self.user in self.ccx registration will be inactive """ CcxMembershipFactory.create(ccx=self.ccx, student=self.user, active=active)
def setup_course(self, size, enable_ccx): """ Build a gradable course where each node has `size` children. """ grading_policy = { "GRADER": [ { "drop_count": 2, "min_count": 12, "short_label": "HW", "type": "Homework", "weight": 0.15 }, { "drop_count": 2, "min_count": 12, "type": "Lab", "weight": 0.15 }, { "drop_count": 0, "min_count": 1, "short_label": "Midterm", "type": "Midterm Exam", "weight": 0.3 }, { "drop_count": 0, "min_count": 1, "short_label": "Final", "type": "Final Exam", "weight": 0.4 } ], "GRADE_CUTOFFS": { "Pass": 0.5 } } self.course = CourseFactory.create( graded=True, start=datetime.now(UTC), grading_policy=grading_policy, enable_ccx=enable_ccx, ) self.populate_course(size) CourseEnrollment.enroll( self.student, self.course.id ) if enable_ccx: self.ccx = CcxFactory.create() CcxMembershipFactory.create( student=self.student, ccx=self.ccx )
def setup_course(self, size, enable_ccx): """ Build a gradable course where each node has `size` children. """ grading_policy = { "GRADER": [{ "drop_count": 2, "min_count": 12, "short_label": "HW", "type": "Homework", "weight": 0.15 }, { "drop_count": 2, "min_count": 12, "type": "Lab", "weight": 0.15 }, { "drop_count": 0, "min_count": 1, "short_label": "Midterm", "type": "Midterm Exam", "weight": 0.3 }, { "drop_count": 0, "min_count": 1, "short_label": "Final", "type": "Final Exam", "weight": 0.4 }], "GRADE_CUTOFFS": { "Pass": 0.5 } } self.course = CourseFactory.create( graded=True, start=datetime.now(UTC), grading_policy=grading_policy, enable_ccx=enable_ccx, ) self.populate_course(size) CourseEnrollment.enroll(self.student, self.course.id) if enable_ccx: self.ccx = CcxFactory.create() CcxMembershipFactory.create(student=self.student, ccx=self.ccx)