'Assign IDs to all the responses
Assign sub-IDs to all entries (textline, schematic, etc.)
Annoted correctness and value
In-place transformation
Also create capa Response instances for each responsetype and save as self.responders
Obtain all responder answers and save as self.responder_answers dict (key = response)'

def _preprocess_problem(self, tree, minimal_init):

    response_id = 1
    problem_data = {}
    self.responders = {}
    for response in tree.xpath(('//' + '|//'.join(responsetypes.registry.registered_tags()))):
        responsetype_id = ((self.problem_id + '_') + str(response_id))
        response.set('id', responsetype_id)
        response_id += 1
        answer_id = 1
        input_tags = inputtypes.registry.registered_tags()
        inputfields = tree.xpath('|'.join([((('//' + response.tag) + '[@id=$id]//') + x) for x in input_tags]), id=responsetype_id)
        for entry in inputfields:
            entry.attrib['response_id'] = str(response_id)
            entry.attrib['answer_id'] = str(answer_id)
            entry.attrib['id'] = ('%s_%i_%i' % (self.problem_id, response_id, answer_id))
            answer_id = (answer_id + 1)
        self.response_a11y_data(response, inputfields, responsetype_id, problem_data)
        responsetype_cls = responsetypes.registry.get_class_for_tag(response.tag)
        responder = responsetype_cls(response, inputfields, self.context, self.capa_system, self.capa_module, minimal_init)
        self.responders[response] = responder
    if (not minimal_init):
        self.responder_answers = {}
        for response in self.responders.keys():
            try:
                self.responder_answers[response] = self.responders[response].get_answers()
            except:
                log.debug('responder    %s    failed    to    properly    return    get_answers()', self.responders[response])
                raise
        solution_id = 1
        for solution in tree.findall('.//solution'):
            solution.attrib['id'] = ('%s_solution_%i' % (self.problem_id, solution_id))
            solution_id += 1
    return problem_data
