<?xml version="1.0"?>
<form string="Survey" class="o_survey_form">
                <field name="id" invisible="1"/>
                <field name="session_state" invisible="1"/>
                <field name="question_ids" invisible="1"/>
                <header>
                    <button name="action_send_survey" string="Share" type="object" class="oe_highlight" attrs="{'invisible': [('active', '=', False)]}"/>
                    <button name="action_result_survey" string="See results" type="object" class="oe_highlight" attrs="{'invisible': [('answer_done_count', '&lt;=', 0)]}"/>
                    <button name="action_start_session" string="Create Live Session" type="object" class="d-none d-sm-block" attrs="{'invisible': ['|', ('session_state', '!=', False), '|', ('active', '=', False), ('certification', '=', True)]}"/>
                    <button name="action_open_session_manager" string="Open Session Manager" type="object" class="d-none d-sm-block" attrs="{'invisible': [('session_state', '=', False)]}"/>
                    <button name="action_end_session" string="Close Live Session" type="object" class="d-none d-sm-block" attrs="{'invisible': [('session_state', 'not in', ['ready', 'in_progress'])]}"/>
                    <button name="action_test_survey" string="Test" type="object" attrs="{'invisible': ['|', ('active', '=', False), ('question_ids', '=', [])]}"/>
                    <button name="action_unarchive" string="Reopen" class="btn-primary" type="object" attrs="{'invisible': [('active', '=', True)]}"/>
                    <button name="action_print_survey" string="Print" type="object" attrs="{'invisible': [('active', '=', False)]}"/>
                    <button name="action_archive" string="Close" type="object" attrs="{'invisible': [('active', '=', False)]}"/>
                </header>
                <sheet>
                    <div class="oe_button_box" name="button_box">
                        <button name="action_survey_user_input" type="object" class="oe_stat_button" attrs="{'invisible': [('access_mode', '=', 'public')]}" icon="fa-envelope-o">
                            <field string="Registered" name="answer_count" widget="statinfo"/>
                        </button>
                        <button name="action_survey_user_input_certified" type="object" class="oe_stat_button" attrs="{'invisible': [('certification', '=', False)]}" icon="fa-trophy">
                            <field string="Certified" name="success_count" widget="statinfo"/>
                        </button>
                        <button name="action_survey_user_input_completed" type="object" class="oe_stat_button" icon="fa-check-square-o">
                            <field string="Participations" name="answer_done_count" widget="statinfo"/>
                        </button>
                    </div>
                    <widget name="web_ribbon" title="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
                    <field name="background_image" widget="image" class="oe_avatar"/>
                    <div class="oe_title" style="width: 100%;">
                        <label for="title" class="oe_edit_only" string="Survey Title" attrs="{'invisible': [('certification', '=', True)]}"/>
                        <label for="title" class="oe_edit_only" string="Certification Title" attrs="{'invisible': [('certification', '=', False)]}"/>
                        <h1>
                            <field name="title" placeholder="e.g. Satisfaction Survey"/>
                        </h1>
                    </div>
                    <group>
                        <group>
                            <field name="user_id" domain="[('share', '=', False)]" widget="many2one_avatar_user"/>
                            <field name="active" invisible="1"/>
                            <field name="has_conditional_questions" invisible="1"/>
                        </group>
                    </group>
                    <notebook>
                        <page string="Questions" name="questions">
                            <field name="question_and_page_ids" nolabel="1" widget="question_page_one2many" mode="tree,kanban" context="{'default_survey_id': active_id, 'default_questions_selection': questions_selection}">
                                <tree decoration-bf="is_page">
                                    <field name="sequence" widget="handle"/>
                                    <field name="title" widget="survey_description_page"/>
                                    <field name="background_image" invisible="1"/>
                                    <field name="question_type"/>
                                    <field name="is_page" invisible="1"/>
                                    <field name="questions_selection" invisible="1"/>
                                    <field name="survey_id" invisible="1"/>
                                    <field name="triggering_question_id" invisible="1"/>
                                    <field name="random_questions_count" attrs="{'column_invisible': [('parent.questions_selection', '=', 'all')], 'invisible': [('is_page', '=', False)]}"/>
                                    <button disabled="disabled" icon="fa-code-fork" attrs="{'invisible': [('triggering_question_id', '=', False)]}" title="This question depends on another question's answer." class="icon_rotates"/>
                                    <control>
                                        <create name="add_question_control" string="Add a question"/>
                                        <create name="add_section_control" string="Add a section" context="{'default_is_page': True, 'default_questions_selection': 'all'}"/>
                                    </control>
                                </tree>
                            </field>
                        </page>
                        <page string="Options" name="options">
                            <group name="options">
                                <group string="Questions" name="questions">
                                    <field name="questions_layout" widget="radio" attrs="{'readonly': [('session_state', 'in', ['ready', 'in_progress'])]}"/>
                                    <field name="progression_mode" widget="radio" attrs="{'invisible': [('questions_layout', '=', 'one_page')]}"/>
                                    <field name="questions_selection" widget="radio"/>
                                    <field name="users_can_go_back" string="Back Button" attrs="{'invisible': [('questions_layout', '=', 'one_page')]}"/>
                                </group>
                                <group string="Participants" name="participants">
                                    <field name="access_mode"/>
                                    <field name="users_login_required"/>
                                    <label for="is_attempts_limited" string="Limit Attempts" attrs="{'invisible': ['&amp;', ('access_mode', '=', 'public'), ('users_login_required', '=', False)]}"/>
                                    <div class="o_checkbox_optional_field" attrs="{'invisible': ['&amp;', ('access_mode', '=', 'public'), ('users_login_required', '=', False)]}">
                                        <field name="is_attempts_limited" nolabel="1"/>
                                        <div attrs="{'invisible': [('is_attempts_limited', '=', False)]}">
                                            to <field name="attempts_limit" nolabel="1" class="oe_inline"/> attempts
                                        </div>
                                    </div>
                                </group>
                                <group string="Time &amp; Scoring" name="scoring">
                                    <label for="is_time_limited" string="Survey Time Limit"/>
                                    <div class="o_checkbox_optional_field">
                                        <field name="is_time_limited" nolabel="1"/>
                                        <div attrs="{'invisible': [('is_time_limited', '=', False)]}">
                                            <field name="time_limit" widget="float_time" nolabel="1" class="oe_inline"/> minutes
                                        </div>
                                    </div>  
                                    <field name="scoring_type" widget="radio"/>
                                    <field name="scoring_success_min" attrs="{'invisible': [('scoring_type', '=', 'no_scoring')]}"/>
                                    <label for="certification" attrs="{'invisible': [('scoring_type', '=', 'no_scoring')]}"/>
                                    <div class="o_checkbox_optional_field">
                                        <field name="certification" attrs="{'invisible': [('scoring_type', '=', 'no_scoring')]}"/>
                                        <div attrs="{'invisible': [('certification', '=', False)]}" class="w-100">
                                            <field name="certification_report_layout" placeholder="Pick a Style..." class="w-50"/>
                                            <button name="action_survey_preview_certification_template" string="Preview" type="object" icon="fa-external-link" target="_blank" class="btn-link pt-0"/>
                                        </div>
                                    </div> 
                                    <field name="certification_mail_template_id" placeholder="Pick a Template..." attrs="{'invisible': [('certification', '=', False)]}"/>
                                    <label for="certification_give_badge" attrs="{'invisible': ['|', ('certification', '=', False), ('users_login_required', '=', False)]}"/>
                                    <div class="float-start o_checkbox_optional_field" attrs="{'invisible': ['|', ('certification', '=', False), ('users_login_required', '=', False)]}">
                                        <field name="certification_give_badge"/>
                                        <div attrs="{'invisible': [('certification_give_badge', '=', False)]}">
                                            <field name="certification_badge_id" placeholder="Pick a Badge..." attrs="{'invisible': ['|', ('certification_give_badge', '=', False), ('certification_badge_id', '!=', False)], 'required': [('certification_give_badge', '=', True)]}" domain="[('survey_id', '=', active_id), ('survey_id', '!=', False)]" context="{'default_name': title,                                                         'default_description': 'Congratulations, you have succeeded this certification',                                                         'default_rule_auth': 'nobody',                                                         'default_level': None,                                                         'form_view_ref': 'survey.gamification_badge_form_view_simplified'}"/>
                                            <field name="certification_badge_id_dummy" attrs="{'invisible': ['|', ('certification_give_badge', '=', False), ('certification_badge_id', '=', False)]}" placeholder="Pick a Badge..." options="{'no_create': True}" context="{'form_view_ref': 'survey.gamification_badge_form_view_simplified'}"/>
                                        </div>
                                    </div>
                                </group>
                                <group string="Live Session">
                                    <field name="session_code"/>
                                    <field name="session_link" widget="CopyClipboardChar"/>
                                    <field name="session_speed_rating"/>
                                </group>
                            </group>
                        </page>
                        <page string="Description" name="description">
                            <field name="description" placeholder="e.g. &quot;The following Survey will help us...&quot;" nolabel="1"/>
                        </page>
                        <page string="End Message" name="description_done">
                            <field name="description_done" placeholder="e.g. &quot;Thank you very much for your feedback!&quot;" nolabel="1"/>
                        </page>
                    </notebook>
                </sheet>
                <div class="oe_chatter">
                    <field name="message_follower_ids"/>
                    <field name="activity_ids"/>
                    <field name="message_ids"/>
                </div>
            </form>
        