[MERGE][IMP] survey: implement a tour & revamp onboarding data
PURPOSE This commit improves the accessibility of the survey samples when no records are shown, revamps the onboarding data, slightly modifies the integration of test surveys and related filters, and adds a tour that is started when the survey module is installed SPECS 1. Remove the modal used to show the samples and show them on the empty screen instead. When no survey exists, the user gets the proposition of trying survey samples. Previously, the user had to click on a button to open a modal showing the different samples. Now, the samples are shown in the empty screen directly. 2. Revamp sample surveys data Considering this is the data wa want to push forward, it needs to be as relevant as possible while being "light" for the db. 3. Consider completed test surveys as completed surveys Most people expect to see the test the just did counted in the completed surveys counter in the survey view. The filter excluding the tests surveys has therefore also been removed from the participation view. 4. Rename the filters related to the test surveys "Tests Only" and "Exclude Tests" are more straight to the point than "Test Entries" and "Exclude Test Entries". 5. Implementation of the tour The tour suggests to the user to try and test a sample survey, and shows how to check the results gathered for this survey. 6. Changed the target of the "test" button to "self" Since the test action is used during the tour, the test page needs to be opened in the same tab so that the tour can continue. 7. Added ids to some elements These ids are used by the tour to identify which element is the current target of the tour. Task-2794884 closes odoo/odoo#87326 Related: odoo/enterprise#26661 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit is contained in:
@@ -99,6 +99,9 @@ sent mails with personal token for the invitation of the survey.
|
||||
'web.assets_tests': [
|
||||
'survey/static/tests/**/*',
|
||||
],
|
||||
'web.assets_common': [
|
||||
'survey/static/src/js/tours/survey_tour.js',
|
||||
]
|
||||
},
|
||||
'license': 'LGPL-3',
|
||||
}
|
||||
|
||||
@@ -76,10 +76,10 @@ class Survey(models.Model):
|
||||
question_ids = fields.One2many('survey.question', string='Questions', compute="_compute_page_and_question_ids")
|
||||
question_count = fields.Integer('# Questions', compute="_compute_page_and_question_ids")
|
||||
questions_layout = fields.Selection([
|
||||
('one_page', 'One page with all the questions'),
|
||||
('page_per_question', 'One page per question'),
|
||||
('page_per_section', 'One page per section'),
|
||||
('page_per_question', 'One page per question')],
|
||||
string="Pagination", required=True, default='one_page')
|
||||
('one_page', 'One page with all the questions')],
|
||||
string="Pagination", required=True, default='page_per_question')
|
||||
questions_selection = fields.Selection([
|
||||
('all', 'All questions'),
|
||||
('random', 'Randomized per Section')],
|
||||
@@ -200,7 +200,7 @@ class Survey(models.Model):
|
||||
}
|
||||
stat = dict((cid, dict(default_vals, answer_score_avg_total=0.0)) for cid in self.ids)
|
||||
UserInput = self.env['survey.user_input']
|
||||
base_domain = ['&', ('survey_id', 'in', self.ids), ('test_entry', '!=', True)]
|
||||
base_domain = [('survey_id', 'in', self.ids)]
|
||||
|
||||
read_group_res = UserInput._read_group(base_domain, ['survey_id', 'state'], ['survey_id', 'state', 'scoring_percentage', 'scoring_success'], lazy=False)
|
||||
for item in read_group_res:
|
||||
@@ -953,7 +953,7 @@ class Survey(models.Model):
|
||||
return {
|
||||
'type': 'ir.actions.act_url',
|
||||
'name': "Test Survey",
|
||||
'target': 'new',
|
||||
'target': 'self',
|
||||
'url': '/survey/test/%s' % self.access_token,
|
||||
}
|
||||
|
||||
@@ -961,8 +961,7 @@ class Survey(models.Model):
|
||||
action = self.env['ir.actions.act_window']._for_xml_id('survey.action_survey_user_input')
|
||||
ctx = dict(self.env.context)
|
||||
ctx.update({'search_default_survey_id': self.ids[0],
|
||||
'search_default_completed': 1,
|
||||
'search_default_not_test': 1})
|
||||
'search_default_completed': 1})
|
||||
action['context'] = ctx
|
||||
return action
|
||||
|
||||
@@ -970,16 +969,14 @@ class Survey(models.Model):
|
||||
action = self.env['ir.actions.act_window']._for_xml_id('survey.action_survey_user_input')
|
||||
ctx = dict(self.env.context)
|
||||
ctx.update({'search_default_survey_id': self.ids[0],
|
||||
'search_default_scoring_success': 1,
|
||||
'search_default_not_test': 1})
|
||||
'search_default_scoring_success': 1})
|
||||
action['context'] = ctx
|
||||
return action
|
||||
|
||||
def action_survey_user_input(self):
|
||||
action = self.env['ir.actions.act_window']._for_xml_id('survey.action_survey_user_input')
|
||||
ctx = dict(self.env.context)
|
||||
ctx.update({'search_default_survey_id': self.ids[0],
|
||||
'search_default_not_test': 1})
|
||||
ctx.update({'search_default_survey_id': self.ids[0]})
|
||||
action['context'] = ctx
|
||||
return action
|
||||
|
||||
|
||||
@@ -18,78 +18,67 @@ class SurveyTemplate(models.Model):
|
||||
|
||||
@api.model
|
||||
def action_load_sample_feedback_form(self):
|
||||
company = self.env.user.company_id.name
|
||||
return self.env['survey.survey'].create({
|
||||
'title': _('Feedback Form'),
|
||||
'description': _('What do you think of our new eShop? Let us hear your voice!'),
|
||||
'description_done': _('Thank you very much for your feedback. We at MyCompany value your opinion!'),
|
||||
'description': '<br>'.join([
|
||||
_('Please complete this very short survey to let us know how satisfied your are with our products.'),
|
||||
_('Your responses will help us improve our product range to serve you even better.')
|
||||
]),
|
||||
'description_done': _('Thank you very much for your feedback. We at %s value your opinion very highly!', company),
|
||||
'progression_mode': 'number',
|
||||
'questions_layout': 'one_page',
|
||||
'questions_layout': 'page_per_question',
|
||||
'question_and_page_ids': [
|
||||
(0, 0, { # survey.question
|
||||
'title': _('About you'),
|
||||
'is_page': True,
|
||||
'question_type': False
|
||||
}),
|
||||
(0, 0, { # survey.question
|
||||
'title': _('How frequently do you buy products online?'),
|
||||
'title': _('How frequently do you use our products?'),
|
||||
'question_type': 'simple_choice',
|
||||
'constr_mandatory': True,
|
||||
'suggested_answer_ids': [
|
||||
(0, 0, { # survey.question.answer
|
||||
'value': _('Once a day')
|
||||
'value': _('Often (1-3 times per week)')
|
||||
}),
|
||||
(0, 0, { # survey.question.answer
|
||||
'value': _('Once a week')
|
||||
'value': _('Rarely (1-3 times per month)')
|
||||
}),
|
||||
(0, 0, { # survey.question.answer
|
||||
'value': _('Once a month')
|
||||
}),
|
||||
(0, 0, { # survey.question.answer
|
||||
'value': _('Once a year')
|
||||
}),
|
||||
(0, 0, { # survey.question.answer
|
||||
'value': _('Never')
|
||||
'value': _('Never (less than once a month)')
|
||||
})
|
||||
]
|
||||
}),
|
||||
(0, 0, { # survey.question
|
||||
'title': _('How many times did you order products on our website?'),
|
||||
'question_type': 'numerical_box'
|
||||
'title': _('How many orders did you pass during the last 6 months?'),
|
||||
'question_type': 'numerical_box',
|
||||
}),
|
||||
(0, 0, { # survey.question
|
||||
'title': _('About our ecommerce'),
|
||||
'is_page': True,
|
||||
'question_type': False
|
||||
}),
|
||||
(0, 0, { # survey.question
|
||||
'title': _('What do you think about our new eCommerce?'),
|
||||
'title': _('How likely are you to recommend the following products to a friend?'),
|
||||
'question_type': 'matrix',
|
||||
'matrix_subtype': 'simple',
|
||||
'suggested_answer_ids': [
|
||||
(0, 0, { # survey.question.answer
|
||||
'value': _('Strongly disagree')
|
||||
'value': _('Very Unlikely')
|
||||
}),
|
||||
(0, 0, { # survey.question.answer
|
||||
'value': _('Disagree')
|
||||
'value': _('Unlikely')
|
||||
}),
|
||||
(0, 0, { # survey.question.answer
|
||||
'value': _('Neutral')
|
||||
}),
|
||||
(0, 0, { # survey.question.answer
|
||||
'value': _('Agree')
|
||||
'value': _('Likely')
|
||||
}),
|
||||
(0, 0, { # survey.question.answer
|
||||
'value': _('Strongly agree')
|
||||
'value': _('Very Likely')
|
||||
})
|
||||
],
|
||||
'matrix_row_ids': [
|
||||
(0, 0, { # survey.question.answer
|
||||
'value': _('The new layout and design is fresh and up-to-date')
|
||||
'value': _('Red Pen')
|
||||
}),
|
||||
(0, 0, { # survey.question.answer
|
||||
'value': _('It is easy to find the product that I want')
|
||||
'value': _('Blue Pen')
|
||||
}),
|
||||
(0, 0, { # survey.question.answer
|
||||
'value': _('The tool to compare the products is useful to make a choice')
|
||||
'value': _('Yellow Pen')
|
||||
})
|
||||
]
|
||||
})
|
||||
@@ -109,8 +98,11 @@ class SurveyTemplate(models.Model):
|
||||
'progression_mode': 'number',
|
||||
'scoring_type': 'scoring_without_answers',
|
||||
'users_can_go_back': True,
|
||||
'description': '<br>'.join([
|
||||
_('Welcome to the History certification. You will receive 2 random questions.'),
|
||||
'description': ''.join([
|
||||
_('Welcome to this Odoo certification. You will receive 2 random questions out of a pool of 3.'),
|
||||
'(<span style="font-style: italic">',
|
||||
_('Cheating on your neighbors will not help!'),
|
||||
'</span> 😁).<br>',
|
||||
_('Good luck!')
|
||||
]),
|
||||
'description_done': _('Thank you. We will contact you soon.'),
|
||||
@@ -118,68 +110,65 @@ class SurveyTemplate(models.Model):
|
||||
'questions_selection': 'random',
|
||||
'question_and_page_ids': [
|
||||
(0, 0, { # survey.question
|
||||
'title': _('History'),
|
||||
'title': _('Odoo Certification'),
|
||||
'is_page': True,
|
||||
'question_type': False,
|
||||
'random_questions_count': 2
|
||||
}),
|
||||
(0, 0, { # survey.question
|
||||
'title': _('When did Genghis Khan die?'),
|
||||
'title': _('What does "ODOO" stand for?'),
|
||||
'question_type': 'simple_choice',
|
||||
'suggested_answer_ids': [
|
||||
(0, 0, { # survey.question.answer
|
||||
'value': _('1227'),
|
||||
'value': _('It\'s a Belgian word for "Management"')
|
||||
}),
|
||||
(0, 0, { # survey.question.answer
|
||||
'value': _('Object-Directed Open Organization')
|
||||
}),
|
||||
(0, 0, { # survey.question.answer
|
||||
'value': _('Organizational Development for Operation Officers')
|
||||
}),
|
||||
(0, 0, { # survey.question.answer
|
||||
'value': _('It does not mean anything specific'),
|
||||
'is_correct': True,
|
||||
'answer_score': 10
|
||||
}),
|
||||
]
|
||||
}),
|
||||
(0, 0, { # survey.question
|
||||
'title': _('On Survey questions, one can define "placeholders". But what are they for?'),
|
||||
'question_type': 'simple_choice',
|
||||
'suggested_answer_ids': [
|
||||
(0, 0, { # survey.question.answer
|
||||
'value': _('They are a default answer, used if the participant skips the question')
|
||||
}),
|
||||
(0, 0, { # survey.question.answer
|
||||
'value': _('It is a small bit of text, displayed to help participants answer'),
|
||||
'is_correct': True,
|
||||
'answer_score': 10
|
||||
}),
|
||||
(0, 0, { # survey.question.answer
|
||||
'value': _('1324')
|
||||
}),
|
||||
(0, 0, { # survey.question.answer
|
||||
'value': _('1055')
|
||||
'value': _('They are technical parameters that guarantees the responsiveness of the page')
|
||||
})
|
||||
]
|
||||
}),
|
||||
(0, 0, { # survey.question
|
||||
'title': _('Who is the architect of the Great Pyramid of Giza ?'),
|
||||
'title': _('What does one need to get to pass an Odoo Survey?'),
|
||||
'question_type': 'simple_choice',
|
||||
'suggested_answer_ids': [
|
||||
(0, 0, { # survey.question.answer
|
||||
'value': _('Imhotep')
|
||||
}),
|
||||
(0, 0, { # survey.question.answer
|
||||
'value': _('Amenhotep')
|
||||
}),
|
||||
(0, 0, { # survey.question.answer
|
||||
'value': _('Hemiunu'),
|
||||
'value': _('It is an option that can be different for each Survey'),
|
||||
'is_correct': True,
|
||||
'answer_score': 10
|
||||
}),
|
||||
(0, 0, { # survey.question.answer
|
||||
'value': _('Papyrus')
|
||||
'value': _('One needs to get 50% of the total score')
|
||||
}),
|
||||
(0, 0, { # survey.question.answer
|
||||
'value': _('One needs to answer at least half the questions correctly')
|
||||
})
|
||||
]
|
||||
}),
|
||||
(0, 0, { # survey.question
|
||||
'title': _('How many years did the 100 years war last?'),
|
||||
'question_type': 'simple_choice',
|
||||
'suggested_answer_ids': [
|
||||
(0, 0, { # survey.question.answer
|
||||
'value': _('99 years')
|
||||
}),
|
||||
(0, 0, { # survey.question.answer
|
||||
'value': _('100 years')
|
||||
}),
|
||||
(0, 0, { # survey.question.answer
|
||||
'value': _('116 years'),
|
||||
'is_correct': True,
|
||||
'answer_score': 10
|
||||
}),
|
||||
(0, 0, { # survey.question.answer
|
||||
'value': _('127 years')
|
||||
})
|
||||
]
|
||||
})
|
||||
]
|
||||
}
|
||||
mail_template = self.env.ref('survey.mail_template_certification', raise_if_not_found=False)
|
||||
@@ -194,7 +183,7 @@ class SurveyTemplate(models.Model):
|
||||
return self.env['survey.survey'].create({
|
||||
'title': _('Live Presentation'),
|
||||
'description': '<br>'.join([
|
||||
_('How well do you know trees? Let\'s find out!'),
|
||||
_('How good of a presenter are you? Let\'s find out!'),
|
||||
_('But first, keep listening to the host.')
|
||||
]),
|
||||
'description_done': _('Thank you for your participation, hope you had a blast!'),
|
||||
@@ -204,66 +193,61 @@ class SurveyTemplate(models.Model):
|
||||
'session_speed_rating': True,
|
||||
'question_and_page_ids': [
|
||||
(0, 0, { # survey.question
|
||||
'title': _('About you'),
|
||||
'is_page': True,
|
||||
'question_type': False
|
||||
}),
|
||||
(0, 0, { # survey.question
|
||||
'title': _('Pick a nickname'),
|
||||
'question_type': 'char_box',
|
||||
'save_as_nickname': True
|
||||
}),
|
||||
(0, 0, { # survey.question
|
||||
'title': _('Quiz'),
|
||||
'is_page': True,
|
||||
'question_type': False
|
||||
}),
|
||||
(0, 0, { # survey.question
|
||||
'title': _('In which country did the bonsai technique develop?'),
|
||||
'title': _('What is the best way to catch the attention of an audience?'),
|
||||
'question_type': 'simple_choice',
|
||||
'suggested_answer_ids': [
|
||||
(0, 0, { # survey.question.answer
|
||||
'value': _('Japan'),
|
||||
'value': _('Speak softly so that they need to focus to hear you')
|
||||
}),
|
||||
(0, 0, { # survey.question.answer
|
||||
'value': _('Use a fun visual support, like a live presentation'),
|
||||
'is_correct': True,
|
||||
'answer_score': 20
|
||||
}),
|
||||
(0, 0, { # survey.question.answer
|
||||
'value': _('China')
|
||||
}),
|
||||
(0, 0, { # survey.question.answer
|
||||
'value': _('Vietnam')
|
||||
}),
|
||||
(0, 0, { # survey.question.answer
|
||||
'value': _('South Korea')
|
||||
'value': _('Show them slides with a ton of text they need to read fast')
|
||||
})
|
||||
]
|
||||
}),
|
||||
(0, 0, { # survey.question
|
||||
'title': _('In the list below, select all the coniferous.'),
|
||||
'title': _('What is a frequent mistake public speakers do?'),
|
||||
'question_type': 'simple_choice',
|
||||
'suggested_answer_ids': [
|
||||
(0, 0, { # survey.question.answer
|
||||
'value': _('Practice in front of a mirror')
|
||||
}),
|
||||
(0, 0, { # survey.question.answer
|
||||
'value': _('Speak too fast'),
|
||||
'is_correct': True,
|
||||
'answer_score': 20
|
||||
}),
|
||||
(0, 0, { # survey.question.answer
|
||||
'value': _('Use humor and make jokes')
|
||||
})
|
||||
]
|
||||
}),
|
||||
(0, 0, { # survey.question
|
||||
'title': _('Why should you consider making your presentation more fun with a small quiz?'),
|
||||
'question_type': 'multiple_choice',
|
||||
'suggested_answer_ids': [
|
||||
(0, 0, { # survey.question.answer
|
||||
'value': _('Douglas Fir'),
|
||||
'value': _('It helps attendees focus on what you are saying'),
|
||||
'is_correct': True,
|
||||
'answer_score': 5
|
||||
'answer_score': 20
|
||||
}),
|
||||
(0, 0, { # survey.question.answer
|
||||
'value': _('Norway Spruce'),
|
||||
'value': _('It is more engaging for your audience'),
|
||||
'is_correct': True,
|
||||
'answer_score': 5
|
||||
'answer_score': 20
|
||||
}),
|
||||
(0, 0, { # survey.question.answer
|
||||
'value': _('European Yew'),
|
||||
'value': _('It helps attendees remember the content of your presentation'),
|
||||
'is_correct': True,
|
||||
'answer_score': 5
|
||||
}),
|
||||
(0, 0, { # survey.question.answer
|
||||
'value': _('Mountain Pine'),
|
||||
'is_correct': True,
|
||||
'answer_score': 5
|
||||
'answer_score': 20
|
||||
})
|
||||
]
|
||||
})
|
||||
}),
|
||||
|
||||
]
|
||||
}).action_show_sample()
|
||||
|
||||
|
||||
@@ -1,55 +1,58 @@
|
||||
/** @odoo-module */
|
||||
|
||||
import Dialog from 'web.Dialog';
|
||||
import KanbanRenderer from 'web.KanbanRenderer';
|
||||
import ListRenderer from 'web.ListRenderer';
|
||||
import { qweb as QWeb, _t } from 'web.core';
|
||||
import { Markup } from 'web.utils';
|
||||
|
||||
const SurveySampleMixin = {
|
||||
|
||||
const SurveySampleModalMixin = {
|
||||
/**
|
||||
* Opens a dialog allowing the user to load a sample survey
|
||||
* We currently have 3 different samples to load (and one "tile" to click on
|
||||
* for each in the modal).
|
||||
* @override
|
||||
*/
|
||||
_render: function () {
|
||||
// Remove "Try It" buttons of the no content helper if user can not create surveys
|
||||
if (!this.activeActions.create) {
|
||||
this.noContentHelp = Markup(this.noContentHelp.replaceAll(
|
||||
'<a class="btn btn-primary o_survey_load_sample text-white"><span>Try It</span></a>',
|
||||
''
|
||||
));
|
||||
}
|
||||
this.isLoadingSample = false;
|
||||
this._super.apply(this, arguments);
|
||||
},
|
||||
|
||||
/**
|
||||
* Load and show the sample survey related to the clicked element,
|
||||
* when there is no survey to display.
|
||||
* We currently have 3 different samples to load:
|
||||
* - Sample Feedback Form
|
||||
* - Sample Certification
|
||||
* - Sample Live Presentation
|
||||
*
|
||||
* @private
|
||||
* @param {Event} ev
|
||||
*/
|
||||
_onOpenSurveySampleModalClick: function () {
|
||||
const $content = $(QWeb.render('survey.survey_sample_modal_body'));
|
||||
$content.find('.o_survey_sample_tile').each((_index, tile) => {
|
||||
const $tile = $(tile);
|
||||
$tile.on('click', async () => {
|
||||
const surveySampleAction = await this._rpc({
|
||||
model: 'survey.survey',
|
||||
method: $tile.data('action'),
|
||||
});
|
||||
this.do_action(surveySampleAction);
|
||||
});
|
||||
});
|
||||
const dialog = new Dialog(this, {
|
||||
title: _t('Load a Survey'),
|
||||
$content: $content,
|
||||
renderFooter: false,
|
||||
});
|
||||
dialog.open();
|
||||
_loadSample: function (ev) {
|
||||
// Prevent loading multiple samples if double clicked
|
||||
if (!this.isLoadingSample && this.activeActions.create) {
|
||||
this.isLoadingSample = true;
|
||||
this.do_action(this._rpc({
|
||||
model: 'survey.survey',
|
||||
method: $(ev.target).closest('.o_survey_sample_container').attr('action'),
|
||||
}));
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
const SurveyKanbanRenderer = KanbanRenderer.extend(SurveySampleModalMixin, {
|
||||
xmlDependencies: (KanbanRenderer.prototype.xmlDependencies || []).concat([
|
||||
'survey/static/src/xml/survey_sample_modal.xml',
|
||||
]),
|
||||
const SurveyKanbanRenderer = KanbanRenderer.extend(SurveySampleMixin, {
|
||||
events: _.extend({}, KanbanRenderer.prototype.events, {
|
||||
'click .o_survey_open_sample_modal': '_onOpenSurveySampleModalClick',
|
||||
'click .o_survey_load_sample': '_loadSample',
|
||||
}),
|
||||
});
|
||||
|
||||
const SurveyListRenderer = ListRenderer.extend(SurveySampleModalMixin, {
|
||||
xmlDependencies: (ListRenderer.prototype.xmlDependencies || []).concat([
|
||||
'survey/static/src/xml/survey_sample_modal.xml',
|
||||
]),
|
||||
const SurveyListRenderer = ListRenderer.extend(SurveySampleMixin, {
|
||||
events: _.extend({}, ListRenderer.prototype.events, {
|
||||
'click .o_survey_open_sample_modal': '_onOpenSurveySampleModalClick',
|
||||
'click .o_survey_load_sample': '_loadSample',
|
||||
}),
|
||||
});
|
||||
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
/** @odoo-module */
|
||||
|
||||
import { _t } from 'web.core';
|
||||
import { Markup } from 'web.utils';
|
||||
import tour from 'web_tour.tour';
|
||||
|
||||
tour.register('survey_tour', {
|
||||
url: "/web",
|
||||
rainbowManMessage: _t("Congratulations! You are now ready to collect feedback like a pro :-)"),
|
||||
sequence: 225,
|
||||
}, [
|
||||
...tour.stepUtils.goToAppSteps('survey.menu_surveys', Markup(_t("Ready to change the way you <b>gather data</b>?"))),
|
||||
{
|
||||
trigger: 'body:has(.o_survey_load_sample) .o_survey_sample_container',
|
||||
content: Markup(_t("Load a <b>sample Survey</b> to get started quickly.")),
|
||||
position: 'bottom',
|
||||
}, {
|
||||
trigger: 'button[name=action_test_survey]',
|
||||
content: _t("Let's give it a spin!"),
|
||||
position: 'bottom',
|
||||
}, {
|
||||
trigger: '.o_survey_start button[type=submit]',
|
||||
content: _t("Let's get started!"),
|
||||
position: 'bottom',
|
||||
}, {
|
||||
trigger: '.o_survey_simple_choice button[type=submit]',
|
||||
extra_trigger: '.js_question-wrapper span:contains("How frequently")',
|
||||
content: _t("Whenever you pick an answer, Odoo saves it for you."),
|
||||
position: 'bottom',
|
||||
}, {
|
||||
trigger: '.o_survey_numerical_box button[type=submit]',
|
||||
extra_trigger: '.js_question-wrapper span:contains("How many")',
|
||||
content: _t("Only a single question left!"),
|
||||
position: 'bottom',
|
||||
}, {
|
||||
trigger: '.o_survey_matrix button[value=finish]',
|
||||
extra_trigger: '.js_question-wrapper span:contains("How likely")',
|
||||
content: _t("Now that you are done, submit your form."),
|
||||
position: 'bottom',
|
||||
}, {
|
||||
trigger: '.o_survey_review a',
|
||||
content: _t("Let's have a look at your answers!"),
|
||||
position: 'bottom',
|
||||
}, {
|
||||
trigger: '.alert-info a:contains("This is a Test Survey")',
|
||||
content: _t("Now, use this shortcut to go back to the survey."),
|
||||
position: 'bottom',
|
||||
}, {
|
||||
trigger: 'button[name=action_survey_user_input_completed]',
|
||||
content: _t("Here, you can overview all the participations."),
|
||||
position: 'bottom',
|
||||
}, {
|
||||
trigger: 'td[name=survey_id]',
|
||||
content: _t("Let's open the survey you just submitted."),
|
||||
position: 'bottom',
|
||||
}, {
|
||||
trigger: '.breadcrumb a:contains("Feedback Form")',
|
||||
content: _t("Use the breadcrumbs to quickly go back to the dashboard."),
|
||||
position: 'bottom',
|
||||
}
|
||||
]);
|
||||
@@ -1,37 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<templates id="template" xml:space="preserve">
|
||||
<t t-name="survey.survey_sample_modal_body">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div class="o_survey_sample_tile position-relative w-100 d-flex align-items-center justify-content-center m-auto"
|
||||
data-action="action_load_sample_feedback_form">
|
||||
<img src="/survey/static/src/img/survey_sample_feedback_form.png" class="img-fluid"/>
|
||||
<div class="o_survey_sample_tile_cover w-100 h-100 position-absolute text-center text-white p-3">
|
||||
Gather feedbacks from your employees and customers.
|
||||
</div>
|
||||
</div>
|
||||
<div class="h4 text-center m-2">Feedback Form</div>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<div class="o_survey_sample_tile position-relative w-100 d-flex align-items-center justify-content-center m-auto"
|
||||
data-action="action_load_sample_certification">
|
||||
<img src="/survey/static/src/img/survey_sample_certification.png" class="img-fluid"/>
|
||||
<div class="o_survey_sample_tile_cover w-100 h-100 position-absolute text-center text-white p-3">
|
||||
Handle quiz & certifications online.
|
||||
</div>
|
||||
</div>
|
||||
<div class="h4 text-center m-2">Certification</div>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<div class="o_survey_sample_tile position-relative w-100 d-flex align-items-center justify-content-center m-auto"
|
||||
data-action="action_load_sample_live_presentation">
|
||||
<img src="/survey/static/src/img/survey_sample_live_presentation.png" class="img-fluid"/>
|
||||
<div class="o_survey_sample_tile_cover w-100 h-100 position-absolute text-center text-white p-3">
|
||||
Add some fun to your presentations by sharing questions live.
|
||||
</div>
|
||||
</div>
|
||||
<div class="h4 text-center m-2">Live Presentation</div>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
</templates>
|
||||
@@ -15,6 +15,7 @@ class TestUiCertification(HttpCaseWithUserDemo):
|
||||
'title': 'MyCompany Vendor Certification',
|
||||
'access_token': '4ead4bc8-b8f2-4760-a682-1fde8daaaaac',
|
||||
'access_mode': 'public',
|
||||
'questions_layout': 'one_page',
|
||||
'users_can_go_back': True,
|
||||
'users_login_required': True,
|
||||
'scoring_type': 'scoring_with_answers',
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
type="object"
|
||||
class="oe_stat_button"
|
||||
icon="fa-check-square-o">
|
||||
<field string="Answers" name="answer_done_count" widget="statinfo"/>
|
||||
<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)]}"/>
|
||||
@@ -180,7 +180,7 @@
|
||||
<field name="name">survey.survey.view.tree</field>
|
||||
<field name="model">survey.survey</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Survey" sample="1" js_class="survey_view_tree">
|
||||
<tree string="Survey" js_class="survey_view_tree">
|
||||
<field name="active" invisible="1"/>
|
||||
<field name="certification" invisible="1"/>
|
||||
<field name="title"/>
|
||||
@@ -202,7 +202,7 @@
|
||||
<field name="name">survey.survey.view.kanban</field>
|
||||
<field name="model">survey.survey</field>
|
||||
<field name="arch" type="xml">
|
||||
<kanban class="o_survey_survey_view_kanban" js_class="survey_view_kanban" sample="1">
|
||||
<kanban class="o_survey_survey_view_kanban" js_class="survey_view_kanban">
|
||||
<field name="active"/>
|
||||
<field name="certification"/>
|
||||
<field name="color"/>
|
||||
@@ -399,13 +399,52 @@
|
||||
<field name="res_model">survey.survey</field>
|
||||
<field name="view_mode">kanban,tree,form,activity</field>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
Create a Survey
|
||||
</p><p>
|
||||
Surveys can serve many purposes: collect customer feedback, gather market insights, structure employee evaluations, test and certify resellers, support a live presentation, ...
|
||||
</p><p>
|
||||
Let's create one and share it! Not sure where to start? <a href="#" class="o_survey_open_sample_modal fw-bold">Load a survey</a>
|
||||
</p>
|
||||
<div class="row mb-4">
|
||||
<div class="col-sm-4 o_survey_sample_container" action="action_load_sample_feedback_form">
|
||||
<div class="o_survey_sample_tile position-relative w-100 d-flex align-items-center justify-content-center m-auto">
|
||||
<img src="/survey/static/src/img/survey_sample_feedback_form.png" class="img-fluid"/>
|
||||
<div class="o_survey_sample_tile_cover o_survey_load_sample w-100 h-100 position-absolute rounded-circle text-center text-white p-3">
|
||||
Gather feedbacks from your employees and customers.
|
||||
</div>
|
||||
</div>
|
||||
<div class="my-3">
|
||||
<a class="o_survey_load_sample h3 text-center text-primary">Feedback Form</a>
|
||||
</div>
|
||||
<a class="btn btn-primary o_survey_load_sample text-white"><span>Try It</span></a>
|
||||
</div>
|
||||
<div class="col-sm-4 o_survey_sample_container" action="action_load_sample_certification">
|
||||
<div class="o_survey_sample_tile position-relative w-100 d-flex align-items-center justify-content-center m-auto">
|
||||
<img src="/survey/static/src/img/survey_sample_certification.png" class="img-fluid"/>
|
||||
<div class="o_survey_sample_tile_cover o_survey_load_sample w-100 h-100 position-absolute rounded-circle text-center text-white p-3">
|
||||
Handle quiz & certifications online.
|
||||
</div>
|
||||
</div>
|
||||
<div class="my-3">
|
||||
<a class="o_survey_load_sample h3 text-center text-primary">Certification</a>
|
||||
</div>
|
||||
<a class="btn btn-primary o_survey_load_sample text-white"><span>Try It</span></a>
|
||||
</div>
|
||||
<div class="col-sm-4 o_survey_sample_container" action="action_load_sample_live_presentation">
|
||||
<div class="o_survey_sample_tile position-relative w-100 d-flex align-items-center justify-content-center m-auto">
|
||||
<img src="/survey/static/src/img/survey_sample_live_presentation.png" class="img-fluid"/>
|
||||
<div class="o_survey_sample_tile_cover o_survey_load_sample w-100 h-100 position-absolute rounded-circle text-center text-white p-3">
|
||||
Add some fun to your presentations by sharing questions live.
|
||||
</div>
|
||||
</div>
|
||||
<div class="my-3">
|
||||
<a class="o_survey_load_sample h3 text-center text-primary">Live Presentation</a>
|
||||
</div>
|
||||
<a class="btn btn-primary o_survey_load_sample text-white"><span>Try It</span></a>
|
||||
</div>
|
||||
</div>
|
||||
<p>
|
||||
Create a Survey
|
||||
</p>
|
||||
<p>
|
||||
Surveys can serve many purposes: collect customer feedback, gather market insights, structure employee evaluations, test and certify resellers, support a live presentation, ...
|
||||
</p><p>
|
||||
Not sure where to start? Try a sample Survey!
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -282,7 +282,7 @@
|
||||
</t>
|
||||
</t>
|
||||
<t t-call="survey.survey_button_retake"/>
|
||||
<div t-if="survey.scoring_type != 'scoring_without_answers'">
|
||||
<div t-if="survey.scoring_type != 'scoring_without_answers'" class="o_survey_review">
|
||||
If you wish, you can <a t-att-href="'/survey/print/%s?answer_token=%s&review=True' % (survey.access_token, answer.access_token)">review your answers</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
<template id="survey_button_form_view" name="Survey: back to form view">
|
||||
<div groups="survey.group_survey_manager" t-ignore="true" class="alert alert-info alert-dismissible rounded-0 fade show d-print-none css_editable_mode_hidden mb-0">
|
||||
<div t-ignore="true" class="text-center">
|
||||
<a t-attf-href="/web#view_type=form&model=survey.survey&id=#{survey.id}&action=survey.action_survey_form"><span t-if="answer and answer.test_entry">This is a Test Survey. </span><i class="fa fa-fw fa-arrow-right"/>Back to edit mode</a>
|
||||
<a t-attf-href="/web#view_type=form&model=survey.survey&id=#{survey.id}&action=survey.action_survey_form"><span t-if="answer and answer.test_entry">This is a Test Survey. </span><i class="fa fa-fw fa-arrow-right"/>Edit Survey</a>
|
||||
</div>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
</div>
|
||||
@@ -99,7 +99,7 @@
|
||||
</t>
|
||||
<t t-else="">
|
||||
<p><a role="button" class="btn btn-primary btn-lg" t-att-href="'/survey/retry/%s/%s' % (survey.access_token, answer.access_token)">
|
||||
Retry</a></p>
|
||||
Take Again</a></p>
|
||||
</t>
|
||||
</t>
|
||||
</div>
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
</t>
|
||||
<!-- Inputs info -->
|
||||
<span class="badge text-bg-info ms-0 ms-sm-1 me-1 me-sm-0">
|
||||
<span t-esc="len(question_data['answer_input_done_ids'])" class="me-1"/>Answered
|
||||
<span t-esc="len(question_data['answer_input_done_ids'])" class="me-1"/>Responded
|
||||
</span>
|
||||
<span class="badge text-bg-info ms-0 ms-sm-1 me-1 me-sm-0">
|
||||
<span t-esc="len(question_data['answer_input_skipped_ids'])" class="me-1"/>Skipped
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
<separator/>
|
||||
<filter string="Quizz passed" name="scoring_success" domain="[('scoring_success','=', True)]"/>
|
||||
<separator/>
|
||||
<filter string="Test Entries" name="test" domain="[('test_entry','=', True)]"/>
|
||||
<filter string="Exclude Test Entries" name="not_test" domain="[('test_entry','=', False)]"/>
|
||||
<filter string="Tests Only" name="test" domain="[('test_entry','=', True)]"/>
|
||||
<filter string="Exclude Tests" name="not_test" domain="[('test_entry','=', False)]"/>
|
||||
<group expand="0" string="Group By">
|
||||
<filter name="group_by_survey" string="Survey" domain="[]" context="{'group_by': 'survey_id'}"/>
|
||||
<filter string="Email" name="group_by_email" domain="[]" context="{'group_by': 'email'}"/>
|
||||
|
||||
@@ -57,6 +57,7 @@ class TestUi(TestUICommon):
|
||||
'title': 'Furniture Creation Certification',
|
||||
'access_token': '5632a4d7-48cf-aaaa-8c52-2174d58cf50b',
|
||||
'access_mode': 'public',
|
||||
'questions_layout': 'one_page',
|
||||
'users_can_go_back': True,
|
||||
'users_login_required': True,
|
||||
'scoring_type': 'scoring_with_answers',
|
||||
|
||||
Reference in New Issue
Block a user