def METHOD_NAME(activity):
    """
    This method is used to gather the number of times each answer was chosen. It enables anonymous voting.
    it returns a dictionary with the number of answers for each choice
    """
    answers = dict()
    for user in activity.student.all():
        for pl in activity.indexed_pl():
            last_answer = Answer.last_valid(pl, user)
            if last_answer:
                for question in last_answer.answers.values():
                    cid = question['cid']
                    # If question not encountered yet, initialize the dictionary
                    if cid not in answers:
                        answers[cid] = dict()
                        for item in question['items']:
                            answers[cid][item['id']] = 0
                    answers[question['cid']][question['selection']] += 1
    return answers