question_report.xml 1.64 KB
<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <data>
        <template id="exam_question_repot">
            <t t-call="web.html_container">
                <t t-foreach="docs" t-as="exam">
                    <t t-call="web.external_layout">
                        <div class="page">
                            <h2>
                                <span t-field="exam.name"/>
                            </h2>
                            <t t-set="foo" t-value="0"/>
                            <t t-foreach="exam.questions" t-as="question">
                                <h4>
                                    <t t-esc="question_index+1"/>)
                                    <t t-raw="question.question.replace('&lt;p&gt;','').replace('&lt;/p&gt;','')"/>
                                </h4>
                                <t t-foreach="question.question_options" t-as="answers">
                                    <t t-if="answers.correct==True">
                                        <b>
                                            <span t-field="answers.option"/>
                                        </b>
                                    </t>
                                    <t t-if="answers.correct==False">
                                        <span t-field="answers.option"/>
                                    </t>
                                    <br/>
                                </t>
                                <br/>

                            </t>
                        </div>
                    </t>
                </t>
            </t>
        </template>
    </data>
</odoo>