<?xml version="1.0"?>
<t name="Question: matrix" t-name="survey.question_matrix">
        <t t-set="comment_line" t-value="answer_lines.filtered(lambda line: line.value_char_box)"/>
        <table class="table table-borderless o_survey_question_matrix text-white text-center mb-0" t-att-data-name="question.id" t-att-data-question-type="question.question_type" t-att-data-sub-questions="question.matrix_row_ids.ids">
            <thead>
                <tr>
                    <th> </th>
                    <th class="fw-normal" t-foreach="question.suggested_answer_ids" t-as="col_label"><span t-field="col_label.value"/></th>
                </tr>
            </thead>
            <tbody>
                <t t-set="item_idx" t-value="0"/>
                <!-- For matrix, we have an extra check because we have rows * columns total options -->
                <t t-set="useKeySelection" t-value="useKeySelection and (len(question.suggested_answer_ids) * len(question.matrix_row_ids)) &lt; len(letters)"/>
                <tr class="bg-white text-white" t-foreach="question.matrix_row_ids" t-as="row_label" t-att-id="row_label.id">
                    <th class="fw-normal text-start"><span t-field="row_label.value"/></th>
                    <t t-foreach="question.suggested_answer_ids" t-as="col_label">
                        <t t-set="answer" t-value="answer_lines.filtered(lambda line: line.suggested_answer_id == col_label and line.matrix_row_id == row_label)"/>
                        <td t-att-class="'o_survey_matrix_btn text-primary position-relative %s'                         % ('o_survey_selected' if answer else '')">
                            <input t-att-type="'checkbox' if question.matrix_subtype == 'multiple' else 'radio'" t-att-name="'%s_%s' % (question.id, row_label.id)" t-att-value="col_label.id" t-att-checked="'checked' if answer else None" t-att-data-row-id="row_label.id" t-att-data-selection-key="letters[item_idx] if useKeySelection else ''" class="o_survey_form_choice_item d-none"/>
                            <i t-att-class="'o_survey_matrix_empty_checkbox fa fa-%s position-relative'                             % ('square-o' if question.matrix_subtype == 'multiple' else 'circle-thin')"/>
                            <i t-att-class="'fa fa-%s position-relative'                             % ('check-square' if question.matrix_subtype == 'multiple' else 'check-circle')"/>
                            <t t-call="survey.survey_selection_key">
                                <t t-set="selection_key_class" t-value="'position-absolute float-end fw-bold %s' % ('o_survey_radio_btn' if question.matrix_subtype != 'multiple' else '')"/>
                            </t>
                            <t t-set="item_idx" t-value="item_idx + 1"/>
                        </td>
                    </t>
                </tr>
            </tbody>
        </table>
        <div t-if="question.comments_allowed">
            <textarea type="text" class="form-control o_survey_question_text_box o_survey_comment bg-transparent rounded-0 p-0 mt-3" t-att-placeholder="question.comments_message or default_comments_message if not survey_form_readonly else ''" t-att-name="'%s_%s' % (question.id, 'comment')"><t t-esc="comment_line.value_char_box if comment_line else ''"/></textarea>
        </div>
    </t>

    