'Dump poll information.
Returns:
string - Serialize json.'

def dump_poll(self):

    if (self.poll_answers is None):
        self.poll_answers = {}
    answers_to_json = OrderedDict()
    temp_poll_answers = self.poll_answers
    for answer in self.answers:
        if (answer['id'] not in temp_poll_answers):
            temp_poll_answers[answer['id']] = 0
        answers_to_json[answer['id']] = cgi.escape(answer['text'])
    self.poll_answers = temp_poll_answers
    return json.dumps({'answers': answers_to_json, 'question': cgi.escape(self.question), 'poll_answer': self.poll_answer, 'poll_answers': (self.poll_answers if self.voted else {}), 'total': (sum(self.poll_answers.values()) if self.voted else 0), 'reset': str(self.descriptor.xml_attributes.get('reset', 'true')).lower()})
