'Given that I am a staff member on the exam settings section
select advanced settings tab
When I Make the exam timed.
And I login as a verified student.
And visit the courseware as a verified student.
And I start the timed exam
Then I am taken to the exam with a timer bar showing
When I finish the exam
Then I see the exam submitted dialog in place of the exam
When I log back into studio as a staff member
And change the problem\'s due date to be in the past
And log back in as the original verified student
Then I see the exam or message in accordance with the hide_after_due setting'

@ddt.data(True, False)
def test_timed_exam_flow(self, hide_after_due):

    self._setup_and_take_timed_exam(hide_after_due)
    LogoutPage(self.browser).visit()
    auto_auth(self.browser, 'STAFF_TESTER', 'staff101@example.com', True, self.course_id)
    self.studio_course_outline.visit()
    last_week = (datetime.today() - timedelta(days=7)).strftime('%m/%d/%Y')
    self.studio_course_outline.change_problem_due_date(last_week)
    LogoutPage(self.browser).visit()
    auto_auth(self.browser, self.USERNAME, self.EMAIL, False, self.course_id)
    self.courseware_page.visit()
    self.assertEqual(self.courseware_page.has_submitted_exam_message(), hide_after_due)
