'Use external server to get expected answers'

def get_answers(self):

    try:
        rxml = self.do_external_request('get_answers', {})
        exans = json.loads(rxml.find('expected').text)
    except Exception as err:
        log.error('Error    %s', err)
        if self.capa_system.DEBUG:
            msg = ('<span    class="inline-error">%s</span>' % str(err).replace('<', '&lt;'))
            exans = ([''] * len(self.answer_ids))
            exans[0] = msg
    if (not (len(exans) == len(self.answer_ids))):
        log.error('Expected    %s    answers    from    external    server,    only    got    %s!', len(self.answer_ids), len(exans))
        raise Exception('Short    response    from    external    server')
    return dict(zip(self.answer_ids, exans))
