Esempio n. 1
0
def navigate_to_an_openended_question_as_staff(step):
    world.register_by_course_key('MITx/3.091x/2012_Fall', True)
    world.log_in(email='*****@*****.**', password='******')
    problem = '/courses/MITx/3.091x/2012_Fall/courseware/Week_10/Polymer_Synthesis/'
    world.browser.visit(django_url(problem))
    tab_css = 'ol#sequence-list > li > a[data-element="5"]'
    world.css_click(tab_css)
Esempio n. 2
0
def make_populated_course(step):  # pylint: disable=unused-argument
    ## This is different than the function defined in common.py because it enrolls
    ## a staff, instructor, and student member regardless of what `role` is, then
    ## logs `role` in. This is to ensure we have 3 class participants to email.

    # Clear existing courses to avoid conflicts
    world.clear_courses()

    # Create a new course
    course = world.CourseFactory.create(org="edx", number="888", display_name="Bulk Email Test Course")
    world.bulk_email_course_key = course.id

    try:
        # See if we've defined the instructor & staff user yet
        world.bulk_email_instructor
    except AttributeError:
        # Make & register an instructor for the course
        world.bulk_email_instructor = InstructorFactory(course_key=world.bulk_email_course_key)
        world.enroll_user(world.bulk_email_instructor, world.bulk_email_course_key)

        # Make & register a staff member
        world.bulk_email_staff = StaffFactory(course_key=course.id)
        world.enroll_user(world.bulk_email_staff, world.bulk_email_course_key)

    # Make & register a student
    world.register_by_course_key(course.id, username="******", password="******", is_staff=False)

    # Store the expected recipients
    # given each "send to" option
    staff_emails = [world.bulk_email_staff.email, world.bulk_email_instructor.email]
    world.expected_addresses = {
        "course staff": staff_emails,
        "students, staff, and instructors": staff_emails + ["*****@*****.**"],
    }
Esempio n. 3
0
def make_populated_course(step):  # pylint: disable=unused-argument
    ## This is different than the function defined in common.py because it enrolls
    ## a staff, instructor, and student member regardless of what `role` is, then
    ## logs `role` in. This is to ensure we have 3 class participants to email.

    # Clear existing courses to avoid conflicts
    world.clear_courses()

    # Create a new course
    course = world.CourseFactory.create(org='edx',
                                        number='888',
                                        display_name='Bulk Email Test Course')
    world.bulk_email_course_key = course.id

    try:
        # See if we've defined the instructor & staff user yet
        world.bulk_email_instructor
    except AttributeError:
        # Make & register an instructor for the course
        world.bulk_email_instructor = InstructorFactory(
            course_key=world.bulk_email_course_key)
        world.enroll_user(world.bulk_email_instructor,
                          world.bulk_email_course_key)

        # Make & register a staff member
        world.bulk_email_staff = StaffFactory(course_key=course.id)
        world.enroll_user(world.bulk_email_staff, world.bulk_email_course_key)

    # Make & register a student
    world.register_by_course_key(course.id,
                                 username='******',
                                 password='******',
                                 is_staff=False)

    # Store the expected recipients
    # given each "send to" option
    staff_emails = [
        world.bulk_email_staff.email, world.bulk_email_instructor.email
    ]
    world.expected_addresses = {
        'course staff': staff_emails,
        'students, staff, and instructors': staff_emails + ['*****@*****.**']
    }
Esempio n. 4
0
def i_am_staff_for_course_by_id(step, course_id):
    course_key = SlashSeparatedCourseKey.from_deprecated_string(course_id)
    world.register_by_course_key(course_key, True)
Esempio n. 5
0
def i_am_staff_for_course_by_id(step, course_id):
    course_key = CourseKey.from_string(course_id)
    world.register_by_course_key(course_key, True)
Esempio n. 6
0
def i_am_staff_for_course_by_id(step, course_id):
    course_key = CourseKey.from_string(course_id)
    world.register_by_course_key(course_key, True)
Esempio n. 7
0
def i_am_staff_for_course_by_id(step, course_id):
    course_key = SlashSeparatedCourseKey.from_deprecated_string(course_id)
    world.register_by_course_key(course_key, True)
Esempio n. 8
0
def create_user_and_visit_course():
    world.register_by_course_key(world.scenario_dict['COURSE'].id)
    world.log_in()
    world.visit(u'/courses/{}/courseware/'.format(world.scenario_dict['COURSE'].id))
Esempio n. 9
0
def create_user_and_visit_course():
    world.register_by_course_key(world.scenario_dict['COURSE'].id)
    world.log_in()
    world.visit(u'/courses/{}/courseware/'.format(
        world.scenario_dict['COURSE'].id))
Esempio n. 10
0
def create_user_and_visit_course():
    # TODO:  this needs to update our mocked storage
    world.register_by_course_key(world.scenario_dict['COURSE'].id)
    world.log_in()
    world.visit(u'/courses/{}/courseware/'.format(
        world.scenario_dict['COURSE'].id))
Esempio n. 11
0
def create_user_and_visit_course():
    world.register_by_course_key(SlashSeparatedCourseKey('edx', '999', 'Test_Course'))
    world.log_in()
    world.visit('/courses/edx/999/Test_Course/courseware/')
Esempio n. 12
0
def create_user_and_visit_course():
    world.register_by_course_key(
        SlashSeparatedCourseKey('edx', '999', 'Test_Course'))
    world.log_in()
    world.visit('/courses/edx/999/Test_Course/courseware/')