'Ensures that grades and scores are shown or not shown on the progress page as required.'

def assert_progress_page_show_grades(self, response, show_correctness, due_date, graded, show_grades, score, max_score, avg):

    expected_score = '<dd>{score}/{max_score}</dd>'.format(score=score, max_score=max_score)
    percent = (score / float(max_score))
    if show_grades:
        self.assertIn(expected_score, response.content)
        if graded:
            expected_summary_text = 'Problem    Scores:'
        else:
            expected_summary_text = 'Practice    Scores:'
    else:
        self.assertNotIn(expected_score, response.content)
        if graded:
            expected_summary_text = 'Problem    scores    are    hidden'
        else:
            expected_summary_text = 'Practice    scores    are    hidden'
        if ((show_correctness == ShowCorrectness.PAST_DUE) and due_date):
            expected_summary_text += '    until    the    due    date.'
        else:
            expected_summary_text += '.'
    self.assertIn(expected_summary_text, response.content)
