summaryrefslogtreecommitdiff
path: root/addons/website_slides/static/src/xml
diff options
context:
space:
mode:
authorPatrick Hoste <pko@odoo.com>2019-12-02 13:47:53 +0000
committerThibault Delavallée <tde@odoo.com>2019-12-24 08:56:12 +0000
commite42ee496f89a830c938a20389a9fc645dfbf96c8 (patch)
tree57a456e02861f7cab1f645a2ddf905bee5934269 /addons/website_slides/static/src/xml
parent9b534649d5a223523895f1440a359b3ef9529dff (diff)
[IMP] website_slides: add comments on answers showed after answering a quiz
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: Thibault Delavallee (tde) <tde@openerp.com>
Diffstat (limited to 'addons/website_slides/static/src/xml')
-rw-r--r--addons/website_slides/static/src/xml/slide_quiz.xml4
-rw-r--r--addons/website_slides/static/src/xml/slide_quiz_create.xml36
2 files changed, 30 insertions, 10 deletions
diff --git a/addons/website_slides/static/src/xml/slide_quiz.xml b/addons/website_slides/static/src/xml/slide_quiz.xml
index 288aa36f8a1..5b1d6e960be 100644
--- a/addons/website_slides/static/src/xml/slide_quiz.xml
+++ b/addons/website_slides/static/src/xml/slide_quiz.xml
@@ -28,6 +28,10 @@
<span t-esc="answer.text_value"/>
</a>
</t>
+ <div class="o_wslides_quiz_answer_info list-group-item list-group-item-info d-none">
+ <i class="fa fa-info-circle"/>
+ <span class="o_wslides_quiz_answer_comment"/>
+ </div>
</div>
</div>
<div t-if="!widget.slide.completed" class="o_wslides_js_lesson_quiz_validation border-top pt-3"/>
diff --git a/addons/website_slides/static/src/xml/slide_quiz_create.xml b/addons/website_slides/static/src/xml/slide_quiz_create.xml
index 0d19371e0b3..ab159543c8f 100644
--- a/addons/website_slides/static/src/xml/slide_quiz_create.xml
+++ b/addons/website_slides/static/src/xml/slide_quiz_create.xml
@@ -34,16 +34,32 @@
<t t-name="slide.quiz.answer.line">
<div class="o_wslides_js_quiz_answer row align-items-center mb-1" t-attf-data-answer-id="#{answer ? answer.id : ''}" >
- <a class="o_wslides_js_quiz_is_correct col-1 text-center" title="Select one good answer">
- <label class="my-0">
- <input t-if="answer and answer.is_correct" class="d-none" type="radio" name="radio" checked="true" />
- <input t-else="" class="d-none" type="radio" name="radio" />
- <i class="fa fa-lg fa-check-circle-o" />
- </label>
- </a>
- <input type="text" class="form-control col-9" placeholder="Enter your answer" t-attf-value="#{answer ? answer.text_value : ''}"/>
- <i class="o_wslides_js_quiz_add_answer fa fa-lg fa-plus-circle p-2" title="Add another answer" />
- <i class="o_wslides_js_quiz_remove_answer fa fa-lg fa-trash-o p-2" title="Remove this answer" />
+ <div class="col offset-1">
+ <div class="row align-items-center">
+ <div class="input-group col-9 p-0">
+ <input type="text" class="o_wslides_js_quiz_answer_value form-control" placeholder="Enter your answer" t-attf-value="#{answer ? answer.text_value : ''}"/>
+ <div class="input-group-append">
+ <div class="input-group-text">
+ <a class="o_wslides_js_quiz_is_correct" title="This is the correct answer">
+ <label class="my-0">
+ <input t-if="answer and answer.is_correct" class="d-none" type="radio" name="radio" checked="true" />
+ <input t-else="" class="d-none" type="radio" name="radio" />
+ <i class="o_wslides_js_quiz_icon fa fa-lg fa-check-circle-o text-muted" />
+ </label>
+ </a>
+ </div>
+ </div>
+ </div>
+ <i t-attf-class="o_wslides_js_quiz_icon o_wslides_js_quiz_comment_answer fa fa-lg fa-info-circle p-2 #{answer &amp;&amp; answer.comment ? 'text-primary' : 'text-muted'}" title="Add comment on this answer" />
+ <i class="o_wslides_js_quiz_icon o_wslides_js_quiz_add_answer fa fa-lg fa-plus-circle p-2 text-muted" title="Add an answer below this one" />
+ <i class="o_wslides_js_quiz_icon o_wslides_js_quiz_remove_answer fa fa-lg fa-trash-o p-2 text-muted" title="Remove this answer" />
+ </div>
+ <div class="o_wslides_js_quiz_answer_comment row align-items-center d-none">
+ <input type="text" class="form-control col-8 offset-1 mt-1" placeholder="This is the correct answer, congratulation"
+ t-attf-value="#{answer ? answer.comment : ''}" />
+ <i class="o_wslides_js_quiz_icon o_wslides_js_quiz_remove_answer_comment fa fa-lg fa-trash-o p-2 text-muted" title="Remove the answer comment" />
+ </div>
+ </div>
</div>
</t>