'Find and install extended hints in new_cmap depending on the student answers.
StringResponse is probably the most complicated form we have.
The forms show below match in the order given, and the first matching one stops the matching.
<stringresponse answer="A" type="ci">
<correcthint>hint1</correcthint>                         <!-- hint for correct answer -->
<additional_answer answer="B">hint2</additional_answer>  <!-- additional_answer with its own hint -->
<stringequalhint answer="C">hint3</stringequalhint>      <!-- string matcher/hint for an incorrect answer -->
<regexphint answer="FG+">hint4</regexphint>              <!-- regex matcher/hint for an incorrect answer -->
<textline size="20"/>
</stringresponse>
The "ci" and "regexp" options are inherited from the parent stringresponse as appropriate.'

def get_extended_hints(self, student_answers, new_cmap):

    if (self.answer_id in student_answers):
        student_answer = student_answers[self.answer_id]
        responses = self.xml.xpath('//stringresponse[@id=$id]', id=self.id)
        if responses:
            response = responses[0]
            expected = response.get('answer').strip()
            if self.check_string([expected], student_answer):
                hint_node = response.find('./correcthint')
                if (hint_node is not None):
                    new_cmap[self.answer_id]['msg'] += self.make_hint_div(hint_node, True, [student_answer], self.tags[0])
                return
            for node in response.findall('./additional_answer'):
                if self.match_hint_node(node, student_answer, self.regexp, self.case_insensitive):
                    hint_node = node.find('./correcthint')
                    new_cmap[self.answer_id]['msg'] += self.make_hint_div(hint_node, True, [student_answer], self.tags[0])
                    return
            for hint_node in response.findall('./stringequalhint'):
                if self.match_hint_node(hint_node, student_answer, False, self.case_insensitive):
                    new_cmap[self.answer_id]['msg'] += self.make_hint_div(hint_node, False, [student_answer], self.tags[0])
                    return
            for hint_node in response.findall('./regexphint'):
                if self.match_hint_node(hint_node, student_answer, True, self.case_insensitive):
                    new_cmap[self.answer_id]['msg'] += self.make_hint_div(hint_node, False, [student_answer], self.tags[0])
                    return
