def create_cohorts_and_assign_students(self, student_a_username, student_b_username): """ Adds 2 manual cohorts, linked to content groups, to the course. Each cohort is assigned one student. """ instructor_dashboard_page = InstructorDashboardPage( self.browser, self.course_id) instructor_dashboard_page.visit() cohort_management_page = instructor_dashboard_page.select_cohort_management( ) cohort_management_page.is_cohorted = True def add_cohort_with_student(cohort_name, content_group, student): """ Create cohort and assign student to it. """ cohort_management_page.add_cohort(cohort_name, content_group=content_group) # After adding the cohort, it should automatically be selected EmptyPromise( lambda: cohort_name == cohort_management_page. get_selected_cohort(), "Waiting for new cohort").fulfill() cohort_management_page.add_students_to_selected_cohort([student]) add_cohort_with_student("Cohort Alpha", "alpha", student_a_username) add_cohort_with_student("Cohort Beta", "beta", student_b_username) cohort_management_page.wait_for_ajax()
def visit_instructor_dashboard(self): """ Visits the instructor dashboard. """ instructor_dashboard_page = InstructorDashboardPage(self.browser, self.course_id) instructor_dashboard_page.visit() return instructor_dashboard_page
def setUp(self, is_staff=True): super(TestCohortHelp, self).setUp(is_staff=is_staff) self.enable_cohorting(self.course_fixture) self.instructor_dashboard_page = InstructorDashboardPage( self.browser, self.course_id) self.instructor_dashboard_page.visit() self.cohort_management = self.instructor_dashboard_page.select_cohort_management( )
def setUp(self): """ Set up a cohorted course """ super(CohortConfigurationTest, self).setUp() # create course with cohorts self.manual_cohort_name = "ManualCohort1" self.auto_cohort_name = "AutoCohort1" self.course_fixture = CourseFixture(**self.course_info).install() self.setup_cohort_config(self.course_fixture, auto_cohort_groups=[self.auto_cohort_name]) self.manual_cohort_id = self.add_manual_cohort(self.course_fixture, self.manual_cohort_name) # create a non-instructor who will be registered for the course and in the manual cohort. self.student_name, self.student_email = self._generate_unique_user_data( ) self.student_id = AutoAuthPage(self.browser, username=self.student_name, email=self.student_email, course_id=self.course_id, staff=False).visit().get_user_id() self.add_user_to_cohort(self.course_fixture, self.student_name, self.manual_cohort_id) # create a second student user self.other_student_name, self.other_student_email = self._generate_unique_user_data( ) self.other_student_id = AutoAuthPage( self.browser, username=self.other_student_name, email=self.other_student_email, course_id=self.course_id, staff=False).visit().get_user_id() # login as an instructor self.instructor_name, self.instructor_email = self._generate_unique_user_data( ) self.instructor_id = AutoAuthPage(self.browser, username=self.instructor_name, email=self.instructor_email, course_id=self.course_id, staff=True).visit().get_user_id() # go to the membership page on the instructor dashboard self.instructor_dashboard_page = InstructorDashboardPage( self.browser, self.course_id) self.instructor_dashboard_page.visit() self.cohort_management_page = self.instructor_dashboard_page.select_cohort_management( )
def setUp(self): super(TestLTIConusmer, self).setUp() self.courseware_page = CoursewarePage(self.browser, self.course_id) self.lti_iframe = LTIContentIframe(self.browser, self.course_id) self.tab_nav = TabNavPage(self.browser) self.progress_page = ProgressPage(self.browser, self.course_id) self.instructor_dashboard_page = InstructorDashboardPage(self.browser, self.course_id) self.grade_book_page = GradeBookPage(self.browser) # Install a course display_name = "Test Course" + self.unique_id self.course_fix = CourseFixture( self.course_info['org'], self.course_info['number'], self.course_info['run'], display_name=display_name )
def create_cohorts_and_assign_students(self): """ Adds 2 manual cohorts, linked to content groups, to the course. Each cohort is assigned one student. """ instructor_dashboard_page = InstructorDashboardPage(self.browser, self.course_id) instructor_dashboard_page.visit() cohort_management_page = instructor_dashboard_page.select_cohort_management() def add_cohort_with_student(cohort_name, content_group, student): cohort_management_page.add_cohort(cohort_name, content_group=content_group) cohort_management_page.add_students_to_selected_cohort([student]) add_cohort_with_student("Cohort A", self.content_group_a, self.cohort_a_student_username) add_cohort_with_student("Cohort B", self.content_group_b, self.cohort_b_student_username)
def create_cohorts_and_assign_students(self, student_a_username, student_b_username): """ Adds 2 manual cohorts, linked to content groups, to the course. Each cohort is assigned one learner. """ instructor_dashboard_page = InstructorDashboardPage(self.browser, self.course_id) instructor_dashboard_page.visit() cohort_management_page = instructor_dashboard_page.select_cohort_management() cohort_management_page.is_cohorted = True def add_cohort_with_student(cohort_name, content_group, student): """ Create cohort and assign learner to it. """ cohort_management_page.add_cohort(cohort_name, content_group=content_group) cohort_management_page.add_students_to_selected_cohort([student]) add_cohort_with_student("Cohort Alpha", "alpha", student_a_username) add_cohort_with_student("Cohort Beta", "beta", student_b_username) cohort_management_page.wait_for_ajax()
def setUp(self): """ Set up a discussion topic """ super(BaseDividedDiscussionTest, self).setUp() self.discussion_id = "test_discussion_{}".format(uuid.uuid4().hex) self.course_fixture = CourseFixture(**self.course_info).add_children( XBlockFixtureDesc("chapter", "Test Section").add_children( XBlockFixtureDesc( "sequential", "Test Subsection").add_children( XBlockFixtureDesc( "vertical", "Test Unit").add_children( XBlockFixtureDesc("discussion", "Test Discussion", metadata={ "discussion_id": self.discussion_id }))))).install() # create course with single cohort and two content groups (user_partition of type "cohort") self.cohort_name = "OnlyCohort" self.setup_cohort_config(self.course_fixture) self.cohort_id = self.add_manual_cohort(self.course_fixture, self.cohort_name) # login as an instructor self.instructor_name = "instructor_user" self.instructor_id = AutoAuthPage(self.browser, username=self.instructor_name, email="*****@*****.**", course_id=self.course_id, staff=True).visit().get_user_id() # go to the membership page on the instructor dashboard self.instructor_dashboard_page = InstructorDashboardPage( self.browser, self.course_id) self.instructor_dashboard_page.visit() self.discussion_management_page = self.instructor_dashboard_page.select_discussion_management( ) self.discussion_management_page.wait_for_page() self.course_wide_key = 'course-wide' self.inline_key = 'inline' self.scheme_key = 'scheme'
def setUp(self): """ Set up a cohorted course with a user_partition of scheme "cohort". """ super(CohortContentGroupAssociationTest, self).setUp() # create course with single cohort and two content groups (user_partition of type "cohort") self.cohort_name = "OnlyCohort" self.course_fixture = CourseFixture(**self.course_info).install() self.setup_cohort_config(self.course_fixture) self.cohort_id = self.add_manual_cohort(self.course_fixture, self.cohort_name) self.course_fixture._update_xblock( self.course_fixture._course_location, { "metadata": { u"user_partitions": [ create_user_partition_json( 0, 'Apples, Bananas', 'Content Group Partition', [Group("0", 'Apples'), Group("1", 'Bananas')], scheme="cohort") ], }, }) # login as an instructor self.instructor_name = "instructor_user" self.instructor_id = AutoAuthPage(self.browser, username=self.instructor_name, email="*****@*****.**", course_id=self.course_id, staff=True).visit().get_user_id() # go to the membership page on the instructor dashboard self.instructor_dashboard_page = InstructorDashboardPage( self.browser, self.course_id) self.instructor_dashboard_page.visit() self.cohort_management_page = self.instructor_dashboard_page.select_cohort_management( )