Skip to content
Snippets Groups Projects
  • Patrick Hoste's avatar
    e42ee496
    [IMP] website_slides: add comments on answers showed after answering a quiz · e42ee496
    Patrick Hoste authored
    
    PURPOSE :
    
    A quiz after a course content is a good way to check if the user gets the previous lesson.
    Despite, the user/student may not understand why his answer was wrong/correct.
    In this task we'll allow the teacher to add a comment next to the asnwer of a quiz.
    
    SPECIFICATION :
    
    The quiz creator will now be able to comment the answers to inform the frontend user why
    his answer is wrong/correct. He will be able to add the comments both in backend and frontend.
    
    Task ID : 2072566
    PR : #41188
    
    Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
    e42ee496
    History
    [IMP] website_slides: add comments on answers showed after answering a quiz
    Patrick Hoste authored
    
    PURPOSE :
    
    A quiz after a course content is a good way to check if the user gets the previous lesson.
    Despite, the user/student may not understand why his answer was wrong/correct.
    In this task we'll allow the teacher to add a comment next to the asnwer of a quiz.
    
    SPECIFICATION :
    
    The quiz creator will now be able to comment the answers to inform the frontend user why
    his answer is wrong/correct. He will be able to add the comments both in backend and frontend.
    
    Task ID : 2072566
    PR : #41188
    
    Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
website_slides_templates_lesson.xml 31.77 KiB
<?xml version="1.0" ?>
<odoo><data>

<!-- Slide: main template: detailed view -->
<template id="slide_main" name="Slide Detailed View">
    <t t-set="body_classname" t-value="'o_wslides_body'"/>
    <t t-call="website.layout">
        <div id="wrap" class="wrap o_wslides_wrap">
            <div class="o_wslides_lesson_header o_wslides_gradient position-relative text-white pb-0 pt-2 pt-md-5">
                <t t-call="website_slides.course_nav">
                    <t t-set="channel" t-value="slide.channel_id"/>
                </t>
                <div class="container o_wslides_lesson_header_container mt-5 mt-md-3 mt-xl-4">
                    <div class="row align-items-end align-items-md-stretch">
                        <div t-attf-class="col-12 col-lg-9 d-flex flex-column #{'offset-lg-3' if slide.channel_id.channel_type == 'training' else ''}">
                            <h2 class="font-weight-medium w-100">
                                <a t-att-href="'/slides/%s' % (slug(slide.channel_id))" class="text-white text-decoration-none" t-field="slide.channel_id.name"/>
                                <t t-if="slide.channel_id.completed">
                                    <small><span class="badge badge-pill badge-success pull-right my-1 py-1 px-2 font-weight-normal"><i class="fa fa-check"/> Completed</span></small>
                                </t>
                            </h2>

                            <div t-if="slide.channel_id.channel_type == 'documentation'" class="mb-3 small">
                                <span class="font-weight-normal">Last update:</span>
                                <t t-esc="slide.date_published" t-options="{'widget': 'date'}"/>
                            </div>

                            <div t-else="" t-if="not slide.channel_id.completed" class="d-flex align-items-center pb-3">
                                <div class="progress w-50 bg-black-25" style="height: 10px;">
                                    <div class="progress-bar rounded-left" role="progressbar"
                                        t-att-aria-valuenow="slide.channel_id.completion" aria-valuemin="0" aria-valuemax="100"
                                        t-attf-style="width: #{slide.channel_id.completion}%;">
                                    </div>
                                </div>
                                <i t-att-class="'fa fa-trophy m-0 ml-2 p-0 %s' % ('text-warning' if slide.channel_id.completed else 'text-black-50')"></i>
                                <small class="ml-2 text-white-50"><t t-esc="slide.channel_id.completion"/> %</small>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="container o_wslides_lesson_main">
                <div class="row">
                    <div t-attf-class="o_wslides_lesson_aside col-lg-3 #{'order-2' if slide.channel_id.channel_type == 'documentation' else ''}">
                        <t t-if="slide.channel_id.channel_type == 'training'" t-call="website_slides.slide_aside_training"/>
                        <t t-if="slide.channel_id.channel_type == 'documentation'" t-call="website_slides.slide_aside_documentation"/>
                    </div>
                    <div t-attf-class="o_wslides_lesson_content col-lg-9 #{'order-1' if slide.channel_id.channel_type == 'documentation' else ''}">
                        <t t-call="website_slides.slide_content_detailed"/>
                    </div>
                </div>
            </div>
        </div>
    </t>
</template>

<!-- Slide: sidebar documentation mode -->
<template id="slide_aside_documentation" name="Slide: Sidebar in Documentation">
    <div class="o_wslides_lesson_aside_doc position-relative bg-white pb-1 my-3 border-bottom">
        <ul class="nav nav-tabs nav-fill" role="tablist">
            <li class="nav-item"><a aria-controls="related" href="#related" class="nav-link rounded-0 border-top-0 border-left-0 py-2 active" data-toggle="tab">Related</a></li>
            <li class="nav-item"><a aria-controls="most_viewed" href="#most_viewed" class="nav-link rounded-0 border-top-0 border-right-0 py-2" data-toggle="tab">Most Viewed</a></li>
        </ul>
        <div class="tab-content">
            <div role="tabpanel" id="related" class="tab-pane active bg-100">
                <ul class="list-group list-group-flush">
                    <t t-set="related_slides_list" t-value="list(related_slides)"/>
                    <t t-if="not related_slides_list">
                        No presentation available.
                    </t>