'Use ajax interface to submit a student answer.
Assumes the input list of responses has two values.'

def submit_student_answer(self, username, problem_url_name, responses):

    def get_input_id(response_id):
        'Creates    input    id    using    information    about    the    test    course    and    the    current    problem.'
        course_key = self.course.id
        return u'input_i4x-{0}-{1}-problem-{2}_{3}'.format(course_key.org.replace(u'.', u'_'), course_key.course.replace(u'.', u'_'), problem_url_name, response_id)
    self.login_username(username)
    modx_url = reverse('xblock_handler', kwargs={'course_id': self.course.id.to_deprecated_string(), 'usage_id': quote_slashes(InstructorTaskModuleTestCase.problem_location(problem_url_name, self.course.id).to_deprecated_string()), 'handler': 'xmodule_handler', 'suffix': 'problem_check'})
    resp = self.client.post(modx_url, {get_input_id(u'{}_1').format(index): response for (index, response) in enumerate(responses, 2)})
    return resp
