<?xml version="1.0" encoding="utf-8"?>
<odoo>


	<template id="sh_survmate_theme_multichoice_question_tmpl" inherit_id='survey.question_multiple_choice' name="Survmate Theme Custom Multichoice Question">
		<xpath expr="//div[hasclass('d-flex','flex-wrap','col-lg-12')]//label[contains(@t-att-class, 'o_survey_choice_btn')]" position="replace">
			<label t-att-class="'o_survey_choice_btn form-label me-2 py-1 px-3 rounded %s %s' % (answer_class, 'o_survey_selected' if answer_line else '')">
				<t t-call="survey.survey_selection_key">
					<t t-set="selection_key_class" t-value="'position-relative float-start d-flex'"/>
				</t>
				<input type="checkbox" t-att-value='label.id' class="o_survey_form_choice_item invisible position-absolute"
					   t-att-name="question.id"
					   t-att-checked="'checked' if answer_line else None"
					   t-att-data-selection-key="letters[item_idx] if useKeySelection else ''"/>
				<span class="ms-2 text-break" t-field='label.value'/>
				<t t-if="has_correct_answer and answer_selected">
					<!-- While displaying results: change icons to have a check mark for a right answer and a cross for a wrong one -->
					<i t-if="is_correct" class="float-end mt-1 position-relative d-inline fa fa-check-square"/>
					<i t-else="" class="float-end mt-1 position-relative d-inline fa fa-times-square"/>
				</t>
				<t t-else="">
					<i class="fa fa-check-square float-end mt-1 position-relative"></i>
					<i class="fa fa-square-o float-end mt-1 position-relative"></i>
				</t>
				<t t-call="survey.question_suggested_value_image"/>
			</label>
		</xpath>
		<xpath expr="//div[hasclass('js_ck_comments','col-lg-12')]//label[contains(@t-att-class, 'o_survey_choice_btn')]" position="replace">
			<label t-att-class="'o_survey_choice_btn form-label me-2 py-1 px-3 rounded %s' % ('o_survey_selected' if comment_line else '')">
				<t t-set="item_idx" t-value="item_idx + 1"/>
				<t t-call="survey.survey_selection_key">
					<t t-set="selection_key_class" t-value="'position-relative float-start d-flex'"/>
				</t>
				<input type="checkbox" class="o_survey_form_choice_item o_survey_js_form_other_comment invisible position-absolute" value="-1"
					   t-att-name="question.id"
					   t-att-checked="comment_line and 'checked' or None"
					   t-att-data-selection-key="letters[item_idx] if useKeySelection else ''"/>
				<span class="ms-2" t-out="question.comments_message or default_comments_message" />
				<i class="fa fa-check-square float-end mt-1 position-relative"></i>
				<i class="fa fa-square-o float-end mt-1 position-relative"></i>
			</label>
		</xpath>
	</template>

	
	<template id="sh_survmate_theme_review_template_inherit" inherit_id="survey.survey_page_print" name="Survmate Question Review">
        
		<xpath expr="//t[@t-set='answer_lines']" position="before">
			<t t-set="sh_survmate_question_grid_cls" t-value="'col-md-%s' % (question.sh_survmate_theme_grid_type)" />
		</xpath>
		
		<xpath expr="//div[hasclass('wrap')]//fieldset" position="attributes">
			<attribute name="class">row</attribute>
		</xpath>
		
		<xpath expr="//div[hasclass('js_question-wrapper')]" position="attributes">
			<attribute name="t-att-class">'js_question-wrapper %s' %(sh_survmate_question_grid_cls)</attribute>
		</xpath>
		
		<!-- Not to display empty question description -->
		<xpath expr='//div[@t-if="question.description"]' position="before">
			<t t-set="shhtmlempty" t-value="'&lt;p&gt;&lt;br&gt;&lt;/p&gt;'"/>            
		</xpath>
		
		<xpath expr='//div[@t-if="question.description"]' position="attributes">
			<attribute name='t-if'>question.description != shhtmlempty</attribute>
		</xpath>
		
	</template>
	
	<template id="sh_survmate_theme_question_template_inherit" inherit_id="survey.question_container" name="Survmate Question">
		
		<xpath expr="//t[@t-set='extra_right_margin']" position="before">
			<t t-set="sh_survmate_question_grid_cls" t-value="'col-md-%s' % (question.sh_survmate_theme_grid_type)" />
		</xpath>
		<xpath expr="//div[@t-att-data-constr-error-msg='question.constr_error_msg or default_constr_error_msg']" position="attributes">
			<attribute name="t-att-class">'js_question-wrapper pb-4 %s %s col-md-%s' % ('d-none' if not display_question else '', 'mr-2' if extra_right_margin else '',question.sh_survmate_theme_grid_type)</attribute>
		</xpath>
	</template>

        	
	
	<template id="sh_survmate_theme_question_template_inherit_fill" inherit_id="survey.survey_fill_form" name="Survmate Question Fill">
		<xpath expr="//div[hasclass('o_survey_form_content')]" position="attributes">
			<attribute name="class">o_survey_form_content row w-100</attribute>
		</xpath>
	</template>
	

	<!-- Timer Position -->
	<template id="sh_survmate_theme_survey_header_inherit" inherit_id="survey.survey_fill_header" name="Emaxamination Header">
        <xpath expr="//div[hasclass('o_survey_timer')]" position="attributes">
            <attribute name="t-att-class">'o_survey_timer col-lg-2 pt-4 %s' % ('sh_survmate_timer_fixed' if survey.sh_is_time_fixed else '')</attribute>
        </xpath>
    </template> 


</odoo>