def renderSingleItem(
                    imageFilename,
                    questionIndex,
                    question,
                    correctAnswer,
                    topAnswers=None,
                    topAnswerScores=None,
                    modelNames=None):
    """
    Render a single item.
    topAnswers: a list of top answer strings
    topAnswerScores: a list of top answer scores
    modelNames: if multiple items, then above are list of lists.
    """
    htmlList = []
    htmlList.append('<td class="item">\
                    <div class="img">\
                    <img src="%s"/></div>\n' % \
                    imageFilename)
    htmlList.append('<div class="ans">Q%d: %s<br/>' % \
                    (questionIndex, question))
    htmlList.append('Correct answer: <span class="good">\
                    %s</span><br/>' % correctAnswer)
    if topAnswers is not None:
        for modelAnswer, modelAnswerScore, modelName in \
            zip(topAnswers, topAnswerScores, modelNames):
            htmlList.append('%s:<br/>' % modelName)
            htmlList.append(
                renderAnswerList(
                                 correctAnswer,
                                 modelAnswer,
                                 modelAnswerScore))
    htmlList.append('</div></td>')
    return ''.join(htmlList)
dataset/ETHPy150Open renmengye/imageqa-public/src/imageqa_render.py/renderSingleItem/original