'Returns the extended hint div based on the student_answer
or the empty string if, after processing all the arguments, there is no hint.
As a side effect, logs a tracking log event detailing the hint.
Keyword args:
* hint_node: xml node such as <optionhint>, holding extended hint text. May be passed in as None.
* correct: bool indication if the student answer is correct
* student_answer: list length 1 or more of string answers
(only checkboxes make multiple answers)
* question_tag: string name of enclosing question, e.g. \'choiceresponse\'
* label: (optional) if None (the default), extracts the label from the node,
otherwise using this value. The value \'\' inhibits labeling of the hint.
* hint_log: (optional) hints to be used, passed in as list-of-dict format (below)
* multiline_mode: (optional) bool, default False, hints should be shown one-per line
* log_extra: (optional) dict items to be injected in the tracking log
There are many parameters to this method because a variety of extended hint contexts
all bottleneck through here. In addition, the caller must provide detailed background
information about the hint-trigger to go in the tracking log.
hint_log format: list of dicts with each hint as a \'text\' key. Each dict has extra
information for logging, essentially recording the logic which triggered the feedback.
Case 1: records which choices triggered
e.g. [{\'text\': \'feedback 1\', \'trigger\': [{\'choice\': \'choice_0\', \'selected\': True}]},...
Case 2: a compound hint, the trigger list has 1 or more choices
e.g. [{\'text\': \'a hint\', \'trigger\':[{\'choice\': \'choice_0\', \'selected\': True},
{\'choice\': \'choice_1\', \'selected\':True}]}]'

def make_hint_div(self, hint_node, correct, student_answer, question_tag, label=None, hint_log=None, multiline_mode=False, log_extra=None):

    _ = self.capa_system.i18n.ugettext
    if (not hint_log):
        if ((hint_node is None) or ((hint_node.text is None) and (len(hint_node.getchildren()) == 0))):
            return ''
        hint_text = get_inner_html_from_xpath(hint_node)
        if (not hint_text):
            return ''
        hint_log = [{'text': hint_text}]
    if ((not label) and (hint_node is not None)):
        label = hint_node.get('label', None)
    if (label is None):
        if correct:
            label = _(u'Correct:')
        else:
            label = _(u'Incorrect:')
    event_info = dict()
    event_info['module_id'] = self.capa_module.location.to_deprecated_string()
    event_info['problem_part_id'] = self.id
    event_info['trigger_type'] = 'single'
    event_info['hint_label'] = label
    event_info['hints'] = hint_log
    event_info['correctness'] = correct
    event_info['student_answer'] = student_answer
    event_info['question_type'] = question_tag
    if log_extra:
        event_info.update(log_extra)
    self.capa_module.runtime.track_function('edx.problem.hint.feedback_displayed', event_info)
    hints_wrap = HTML('').join([HTML('<div    class="{question_hint_text_style}">{hint_content}</div>').format(question_hint_text_style=QUESTION_HINT_TEXT_STYLE, hint_content=HTML(dct.get('text'))) for dct in hint_log])
    if multiline_mode:
        hints_wrap = HTML('<div    class="{question_hint_multiline}">{hints_wrap}</div>').format(question_hint_multiline=QUESTION_HINT_MULTILINE, hints_wrap=hints_wrap)
    label_wrap = ''
    if label:
        label_wrap = HTML('<span    class="{question_hint_label_style}">{label}    </span>').format(question_hint_label_style=QUESTION_HINT_LABEL_STYLE, label=Text(label))
    if correct:
        style = QUESTION_HINT_CORRECT_STYLE
    else:
        style = QUESTION_HINT_INCORRECT_STYLE
    return HTML('<div    class="{st}"><div    class="explanation-title">{text}</div>{lwrp}{hintswrap}</div>').format(st=style, text=Text(_('Answer')), lwrp=label_wrap, hintswrap=hints_wrap)
