def get_answer_to_question(assignment, question_name):
    """Get the answer to the given question from an assignment.

    :param assignment: An assignment
    :type assignment: boto.mturk.Assignment
    :param question_name: The name of the question
    :type question_name: str or unicode
    :rtype: str or unicode
    """
    if not assignment:
        return None

    if not assignment.answers:
        return None

    for each in assignment.answers[0]:
        if each.qid == question_name:
            return each.fields[0] if each.fields else None

    return None