Task #1902306
Purpose
=======
This commit adds certification capabilities to the survey module.
A certification is a survey with the "certification" flag set to true than can be linked
to a certification email template that contains a certification document (PDF).
This template can be edited by the user in the technical settings to customize the certification email/document.
To be able to implement this certification concept, we also have to add scoring mechanisms to surveys.
survey.questions of type 'simple_choice' and 'multiple_choice' now have scores for the suggested answers.
These question scores allow to compute a global score that is used to determine whether the user has successfully
passed the certification or not.
As additional features, we also have:
- A time limit with an interface timer that limits the test to X minutes
When reached, the survey is automatically submitted and unregistered (= unsubmitted) answers are not taken into account.
- A limited number of attempts for the survey/certification
If reached, the user can't take the survey/certification anymore
The 'survey result' layout was adapted accordingly to show the success rate of participants and the correct answers
to the survey questions.
Specs
=======
- Create a new survey :
- Add a description field for the survey
- Options on a survey :
- Passing score : (sum of all good answers) in %
- If No scoring => No passing score, no certificate
- If Scoring with answers => Passing score and can see the answers (can create certificate)
- If Scoring without answers => Passing score but can't review the answers at the end (can create certificate)
- for the questions, if "no scoring" selected, can 't see the option "good answer" and "score" on the questions
- If the 2 others options, can see the options "good answer" and "score" on the questions
- all the types of questions are available for each option.
- Questions
- Add the option correct answer on the multiples questions (one or more good answers)
- Certifications
- If scoring, force "mandatory" for "mutliple choices (1or multiple answers)"
- On the dashboard => visual information that this specific survey is a certification
- Time Limit : The student is informed on the home screen of the survey of the time limit.
The clock start when he clicks on "start survey"
- Template of the certificate : send email with attachment PDF
- Front-end :
- Add some margin
- Replace "Back to survey" with the blue-bar from the portal
- Add a timer (start when the survey starts)
- Add a progress bar (number of section and number of question inside the section)
- Analyse of the results :
- First a global graph with the number of people who''ve participated and passed the test
- Stages of a survey :
- Remove the stage "Permanent"
- 3 stages :
- draft : not on-line but can be tested (with phantom token)
- In progress : on-line
- closed : not on-line
- Who can test a survey : the manager and the user. Add this condition to the phantom token.
Task #1902306
Purpose
=======
survey.question is now also the model used for the survey's pages (with the "is_page" field set to True).
This allows to put all the pages and questions together in a o2m field on the view side and
easily reorganize your survey by dragging the items around.
It also removes one level of encoding by directly having 'Add a page' and 'Add a question'
links on the tree view of questions, enabling a faster encoding.
However, this has the downside of making the code reading a little bit more complicated.
Efforts were made at the model level to create computed fields so that the use of these models
still seems somewhat logical. That means:
- A survey still has "page_ids" (question_and_page_ids filtered on is_page = True)
- These "page_ids" still have question_ids (questions located between this page and the next)
- These "question_ids" still have a "page_id"
That makes the use and display of these information at view and controller levels easier to understand.
Purpose is to clean a bit those fields. A field holding the number of send
invitations is added as well as a button. It allows to directly jump on
answer linked to an invite which helps dealing with private surveys.
This commit is linked to task ID 1935176 and PR #30689 .
Tours in survey cannot be launched due to missing assets. Currently on runbot
website is installed before survey and with a nice side effect tours are
launched and green. However with survey installed without website tours
cannot be launched either in browser or using command line.
This commit is related to task ID 1915356 and PR #29264.
The configuration of question of type 'Date' was not used at all.
The datetimepicker configuration was hardcoded and did not take into
account the configuration of questions of type 'Date'.
Now, for each datetimepicker, we use the corresponding configuration
for min and max date.
Task ID : 1912194
Closes PR #28966
The prefill of the date field must be done after the initialisation,
otherwise, it would override the value. so prefill must be done inside
the .then to avoid prefill before the locale is ready.
Since the datetime are real datetime in DB, we cannot give real datetime
to JSON but string instead.
Finally, no need to keep the div class row. Otherwise, it would put everything
on same line and the jumbotorn div wouldn't be on top on the rest of the page.
Special thanks to @awa-odoo that gave me his masterpiece brain
to help me on this.
Task ID : 1911291
Closes PR #28966
In survey template, the datetimepicker was created with always the same id.
So if two date fields were present on the same page, it created a
multidemensional vortex that broke an alternative reality, resulting in
not being able to fill in both date fields and other crapy stuffs.
Also, the sass file needed to work with tempusdominus library were not
loaded with the js file that comes with it. Resulting in an hugly calendar
(if it could be called calendar) widget.
As survey does not load backend nor frontend assets, it's necessary to have
both files (js and sass files) in common assets.
Task ID : 1911291
Closes PR #28966
This commit aims to make unit tests pass when creating a new database
with only 'survey' installed.
The tour 'test_survey' was not loaded before reaching /survey/start,
causing tests to fail.
The js asset is now loaded within web.assets_common because the tour
should also work with the 'public' user. For this reason,
'web.assets_backend' is not a good fit.
Widget 'root.widget' was undefined too. Appropriate js file is now
loaded.
Closes#33330
Signed-off-by: Christophe Simonis <chs@odoo.com>
* survey, website_slides
While not changing their name or their amount, this commit reorganizes
the assets helpers to:
Avoid all file duplicates in different helpers
----------------------------------------------
Before, we had to put some files in different helpers, like our
bootstrap mixin overrides which were in the _assets_utils template and
in the _assets_bootstrap template.
Enforce the use of an helper when using bootstrap
-------------------------------------------------
Bootstrap functions, variables and mixins are now out of the
_assets_bootstrap template, which now only contains bootstrap css rules
and our bootstrap fixes and extensions.
Allow using the correct bootstrap utils in all assets
-----------------------------------------------------
In some assets (especially editor ones), we may want to use bootstrap
variables even though bootstrap is not included in those. This worked
before but using *default* bootstrap variables. Now, our overrides can
be properly included if necessary.
Note: this commit may also be a first step to allow for backend
bootstrap and frontend bootstrap to co-exist.
closesodoo/odoo#28204
Purpose of this commit is to polish a bit this old module before working
on it. Contains
* split python model into separate main files to ease models understanding;
* split views into separate main files to ease views finding;
* move data lost in views to data files (server action notably);
* merge templates in the same file to have all available at hand;
* move assets in their own file in order to remove noise from templates;
No functional behavior change should occur with this commit. Only move
has been performed.
This commit is linked to task ID 1903617 and PR #28166.
Purpose of this commit is to rename some files before going into some more
work. No split or cleaning is done here, only preparing by doing some pure
renaming.
No functional behavior change should occur with this commit. Only move
has been performed.
This commit is linked to task ID 1903617 and PR #28166.
Purpose is to remove an unnecessary template by directly including the "no
result" inside the main result template. It eases understanding and updating
of templates.
This commit is linked to task ID 1932508 and PR #30508.
Purpose of this commit is to provide a real signup URL and redirection when
login is required on survey. It depends correctly on current partner state
and auth signup parameters. Redirection is now correctly managed so that
customer will be back on survey with their token.
This commit is linked to task ID 1932508 and PR #30508.
Purpose of this merge is to improve access mode and authentication management
introduced at 9771fdfe8f . Purpose of this cleaning is to simplify options and make
them clearer. Instead of a selection with 4 entries we propose to use two
fields on survey model :
* access_mode: everyone with a public link can access and answer; or only
invited people;
* login required: whether people have to login to answer or not;
All main use cases are covered with combination of those two options.
This commit is linked to task ID 1932508 and PR #30508.
Purpose of this commit is to use an access token to access survey instead
of their ID. Routes are updated to use that token instead of the survey ID.
Purpose is to have less discoverable routes and be able to control a bit more
survey access even if it is not really a security parameter.
Some renaming is performed to avoid confusion in terms. Survey token and
answer token are now clearly labeled differently in the code to know which
model we are working on.
Some templates are updated to directly use the answer as base record to
have access to token and test_entry fields instead of giving those parameter
values directly in the controller. It makes some more diff but also allow
easier edition and improvement in templates when having directly survey
and answer record available.
This commit is linked to task ID 1932508 and PR #30508.
Purpose of this commit is to remove test entries from statistics and reports
in survey. Indeed they are not real results and should not be taken into
account. We also display a warning on portal page of surveys when user is
in test mode.
This commit is linked to task ID 1865453 and PR #29316.
Purpose of this commit is to add a category selection field on surveys. It
will allow to filter / select surveys according to their category and their
main use.
This commit is linked to task ID 1911586 and PR #28986.
Purpose is to clean and simplify invite wizard on surveys. Main purpose is
to simplify options.
Public link is displayed for public surveys, allowing to quickly share
it. When sending emails a token is now generated for each recipient. There is
no "batch public link" sending option anymore as it is not really necessary.
Check is done on recipients and emails to match the access mode option. Having
a restricted survey gives the same limitations on people to invite (users,
employees, ...).
Code is cleaned to ease its understanding and prepare future evolution notably
with appraisals.
An existing mode field is added on invite model. All options are currently
not used but it prepares future addition to survey, notably for certifications.
Its purpose is to know what to do with existing tokens when inviting new
recipients. It is used notably to resend tokens through the user_input form
view instead of relying on a custom context key.
This commit is linked to task ID 1911586 and PR #28986.
Survey has several side pages related to corner cases: closed surveys, void
surveys, ... those templates need a bit of polishing. Other main templates
are left untouched and will probably be improved in other tasks.
This commit is linked to task ID 1911586 and PR #28986.
In this commit we extend access option on survey model. Access mode is now
defined as
* public: everyone can access this survey. People having a link to the survey
can create answers and fill survey. Those are used for example as
satisfaction surveys;
* login required: only users can access this survey. Depending on auth
signup configuration this either limits survey access or forces people
to create an account;
* employees only: only users belonging to base.group_user can access this
survey. Those are used for example for internal polls;
* on invitation only: only people receiving a token can access this survey.
They do not need to be an user, having a token is sufficient. Those are
used for example for appraisals;
Note that survey officers and managers can always create and update answers
according to their ACLs.
In this commit we also improve a bit survey form view while changing the
access field. Surveys users now have access to all buttons and some labels
have been updated to better fit current Odoo style. Archive button is now
always displayed as it is considered as a standard way of managing surveys.
This commit is linked to task ID 1911586 and PR #28986.
Purpose of this commit is to adapt controllers and routes to new ACLs. As
survey access is now controlled routes have to use survey ID and browse
records as sudo when access is granted.
This commit is linked to task ID 1911586 and PR #28986.
This commit holds several improvements on survey models.
[IMP] re-order fields in survey models and update strings / helps
Purpose is to ease understanding and future modifications of survey models
by reordering fields in survey, question and user input models. Those are the
main models we want to clean in future updates.
Some comments have been moved into help and some labels and helps have been
updated to clarify a bit the use of various fields, notably in question model.
No functional or technical change occur with this commit. It is just pure
code move. Reordering them allow to already understand a bit more the logic
of this module.
[REF] survey: remove unnecessary/unused fields on answer models
Purpose of this commit is to remove unnecessary and/or unused fields on survey
answer line model. In this commit we
* remove useless date_create field on answer and answer lines models. This
field is basically a renamed create_date. Let us remove this dummy field
as it adds nothing to the answer and answer lines models;
* remove useless URL-related fields and actions on answer and answer lines
models. Having those fields actually bloats the model without really helping
understanding survey models. As changing routes should not occur frequently
hiding routes in fields does not really help. Templates are update to
directly include links instead of fields;
We also remove a button on user input that redirects to the survey global
results. Surveys results are available on survey kanban and form views. It
makes no sense to have that kind of button on a specific answer.
[REF] survey: remove unnecessary/unused fields on survey models
Purpose of this commit is to remove unnecessary and/or unused fields on survey
model. In this commit we
* remove useless is_designed field on survey model. We remove is_designed
field that is based on having page and/or questions. It is just used to
make some links inactive in kanban view. Having fields just for that
purpose bloats the model and is not necessary. Testing void surveys will
just lead to a void page;
* remove useless email_template_id field on survey model. This field is
completely not used anywhere in survey codebase;
* remove useless urls field in survey model. In this commit we remove support
of both relative and global urls computation. It was used only in invite
wizard but was actually not really necessary as knowing the survey access
url is the only really necessary thing to display;
* Print and results URLs are removed from survey model. Having them inlined
directly in code is simpler that actually hiding them behind field. As
changing routes should not occur often it is not a big deal to write them
when necessary. We therefore remove public_url_html, print_url and
result_url fields;
This commit is linked to task ID 1911586 and PR #28986.
Purpose of this commit is to ease understanding or routes. In this commit
we make token a parameter where it is optional and force is where it is
not; we remove unnecessary list on routes; we rename some controller methods
to ease understanding;
Code calling those URLs is adapted accordingly. No functional change should
occur with this commit.
Some routes are json-http-mixed as a result of old implementation. Those
will be updated in future tasks when cleaning the templates and routes.
This commit is linked to task ID 1911586 and PR #28986.
Stages modification through the clickable statusbar wasn't very intuitive.
By fixing default behavior through states (and corresponding buttons), default user experience is simplified.
3 static states available : draft, open, closed
Form view: navigation through states with buttons
Kanban view: disabled modification of survey state
Task ID : 1949110
closesodoo/odoo#32325
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
The comment for the question types:
- matrix
- simple_choice
- multiple_choice
Is now a textarea with a single row to allow expending it and see the full
answer when there is too much text to fit on the screen.
Some labels & alignments were also reworked in the process.
Task-ID: 1960726
closes : #32189
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Task #1949652
Some fields were renamed/moved around to improve the survey.survey
form usability.
closesodoo/odoo#31775
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
In order to allow the user to ealisy retake the survey he just either passed
or failed (in case of scoring activated), a retry button is added not only
in case of failed scoring survey (like it was already the case)
but also for non scoring survey.
This button is also added in the review survey page, to get direct access to
retry the survey.
The rule is the following and apply to all survey types :
If not quizz passed (this will be always true for non scoring survey):
if is_attempts_limited
if attempts left
Add retry button
else
Add retry button
Task ID : 1950429
PR #31802
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Commit: a034a17d37
with a starking lack of foresight, erroneously put a native input date.
It wrongly assumed that the text input was a text input instead of a BS
datetimepicker, which was broken when upgrading BS3 to BS4.
Which means that it wasn't styled as the rest as Odoo, as well as not being
configurable, not working on some browsers, and subject to locale errors.
We fix the DOM so that the BS datetimepicker is correctly applied.
Related to 9a6cd4e41dda56c4f454ed898ed17adad0d8556f
closesodoo/odoo#28135
Purpose of this commit is to rename type column to something matching the
the real business use of the field. That way it is easier to find and grep
in the code. It also lessens potential conflicts with type build-in python
function. It also lessens conflicts when using the field in JS as type
is a build-in attribute.
Renaming type column is a long-living issue. We choose to do it at the
beginning of the v13 development to catch errors as soon as possible.
This commit is linked to task ID 1896245. It is also a subpart of community
PR #27599.
Purpose of this commit is to rename type column to something matching the
the real business use of the field. That way it is easier to find and grep
in the code. It also lessens potential conflicts with type build-in python
function. It also lessens conflicts when using the field in JS as type
is a build-in attribute.
Renaming type column is a long-living issue. We choose to do it at the
beginning of the v13 development to catch errors as soon as possible.
This commit is linked to task ID 1896245. It is also a subpart of community
PR #27599.
Purpose is to extend the use of the newly-introduced activity view allowing
to see at a glance activities to perform on a given model. It eases daily
job of people working with activities.
Updated :
* survey main menu action;
This commit is linked to task ID 1889413.
Future update will allow to save oe_structure editions in an inherited
view instead of editing the original view in place. The condition is
to have an id on the .oe_structure element which contains the
'oe_structure' string.
* survey, website_slides
Before this commit, the web_editor app created bg and text classes its
own way for theming (alpha, beta, grays, ...). Now the system is far
more automatic by extending BS4 color maps.
The '.badge' elements must now also use the 'badge-pill' class to get
the same style as before as '.badge' elements without it are meant to
replace the old 'label' component.