'Extract compound and extended hint information from the xml based on the student_answers.
The hint information goes into the msg= in new_cmap for display.
Each choice in the checkboxgroup can have 2 extended hints, matching the
case that the student has or has not selected that choice:
<checkboxgroup label="Select the best snack">
<choice correct="true">Donut
<choicehint selected="tRuE">A Hint!</choicehint>
<choicehint selected="false">Another hint!</choicehint>
</choice>'

def get_extended_hints(self, student_answers, new_cmap):

    if self.get_compound_hints(new_cmap, student_answers):
        return
    choices = self.xml.xpath('//checkboxgroup[@id=$id]/choice', id=self.answer_id)
    hint_log = []
    label = None
    label_count = 0
    choice_all = []
    student_choice_list = student_answers.get(self.answer_id, [])
    for choice in choices:
        name = choice.get('name')
        choice_all.append(name)
        selected = (name in student_choice_list)
        if selected:
            selector = 'true'
        else:
            selector = 'false'
        hint_nodes = choice.findall('./choicehint')
        for hint_node in hint_nodes:
            if (hint_node.get('selected', '').lower() == selector):
                text = get_inner_html_from_xpath(hint_node)
                if (hint_node.get('label') is not None):
                    label = hint_node.get('label')
                    label_count += 1
                if text:
                    hint_log.append({'text': text, 'trigger': [{'choice': name, 'selected': selected}]})
    if hint_log:
        if (label_count > 1):
            label = None
        new_cmap[self.answer_id]['msg'] += self.make_hint_div(None, (new_cmap[self.answer_id]['correctness'] == 'correct'), student_choice_list, self.tags[0], label, hint_log, multiline_mode=True, log_extra={'choice_all': choice_all})
