<?xml version="1.0"?>
<t name="Question: choice result (simple_choice, multiple_choice)" t-name="survey.question_result_choice">
        <ul class="nav nav-tabs d-print-none" role="tablist">
            <li t-if="question_answered" class="nav-item">
                <a t-att-href="'#survey_graph_question_%d' % question.id" t-att-aria-controls="'survey_graph_question_%d' % question.id" class="nav-link active" data-bs-toggle="tab" role="tab">
                    <i class="fa fa-bar-chart-o"/>
                    <span t-if="question.question_type == 'simple_choice'">Pie Graph</span>
                    <span t-else="">Graph</span>
                </a>
            </li>
            <li class="nav-item">
                <a t-att-href="'#survey_data_question_%d' % question.id" t-att-aria-controls="'survey_data_question_%d' % question.id" t-attf-class="nav-link #{'active' if not question_answered else ''}" data-bs-toggle="tab" role="tab">
                    <i class="fa fa-list-alt me-1"/>Data
                </a>
            </li>
        </ul>
        <div class="tab-content">
            <div t-if="question_answered" role="tabpanel" class="tab-pane active survey_graph" t-att-id="'survey_graph_question_%d' % question.id" t-att-data-question-id="question.id" t-att-data-graph-type="'pie' if question.question_type == 'simple_choice' else 'bar'" t-att-data-graph-data="graph_data" t-att-data-right-answers="list(question_data['right_answers'].mapped('value'))">
                <!-- canvas element for drawing bar chart -->
                <canvas/>
            </div>
            <div role="tabpanel" t-att-id="'survey_data_question_%d' % question.id" t-attf-class="tab-pane #{'active' if not question_answered else ''}">
                <table class="table table-hover">
                    <thead>
                        <tr>
                            <th>Answer</th>
                            <th>User Choice</th>
                            <th t-if="question.is_scored_question">Score</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr t-foreach="table_data" t-as="choice_data">
                            <td>
                                <p>
                                    <span t-if="question.question_type == 'numerical_box'" t-call="survey.survey_remove_unnecessary_decimals">
                                        <t t-set="value_to_format" t-value="choice_data['value']"/>
                                    </span>
                                    <span t-else="" t-esc="choice_data['value']"/>
                                    <i t-if="question.is_scored_question and choice_data['suggested_answer'].is_correct" class="fa fa-check"/>
                                </p>
                            </td>
                            <td class="o_survey_answer">
                                <span t-esc="round(choice_data['count'] * 100.0/ (len(question_data['answer_line_done_ids']) or 1), 2)"/> %
                                <span t-out="choice_data['count_text']" class="badge text-bg-primary"/>
                                <i t-if="choice_data['suggested_answer'].id and choice_data['count']" class="fa fa-filter text-primary filter-add-answer" t-att-data-question-id="question.id" t-att-data-answer-id="choice_data['suggested_answer'].id" role="img" aria-label="Filter surveys" title="Only show survey results having selected this answer"/>
                            </td>
                            <td t-if="question.is_scored_question" t-call="survey.survey_remove_unnecessary_decimals">
                                <t t-set="value_to_format" t-value="choice_data['suggested_answer'].answer_score"/>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
        <div t-if="comment_lines" t-call="survey.question_result_comments"/>
    </t>

    