'Helper to perform the common action "set up a timed exam as staff,
then take it as student"'

def _setup_and_take_timed_exam(self, hide_after_due=False):

    LogoutPage(self.browser).visit()
    auto_auth(self.browser, 'STAFF_TESTER', 'staff101@example.com', True, self.course_id)
    self.studio_course_outline.visit()
    self.studio_course_outline.open_subsection_settings_dialog()
    self.studio_course_outline.select_advanced_tab()
    self.studio_course_outline.make_exam_timed(hide_after_due=hide_after_due)
    LogoutPage(self.browser).visit()
    self._login_as_a_verified_user()
    self.courseware_page.visit()
    self.courseware_page.start_timed_exam()
    self.assertTrue(self.courseware_page.is_timer_bar_present)
    self.courseware_page.stop_timed_exam()
    self.courseware_page.wait_for_page()
    self.assertTrue(self.courseware_page.has_submitted_exam_message())
    LogoutPage(self.browser).visit()
