This commit moves the graph data the user got at the end
of the survey to the review answers section.
Task-2991360
closesodoo/odoo#114130
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Purpose
=======
Improve the results page filter to allow the filtering
on questions of type text_box, char_box, numerical_box,
date and datetime.
Specifications
==============
Updating the URL filters representation to avoid passing the
question types directly in the URL parameters.
Answer matching per question type:
- char_box, text_box: 'ilike'
- numerical_box, date, datetime: '='
Adding a new filter restricts the current filter results.
Handling the filters depending on the 2 different answer models:
'survey.question.answer': matrix, simple_choice, multiple_choice
'survey.user_input.line': char_box, text_box, numerical_box, date,
datetime.
The filters can be combined but their query count doesn't add up
if their related answers data are stored in the same model.
Task-3138245
closesodoo/odoo#110252
Related: odoo/enterprise#36383
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Purpose
=======
Make sure we display a correct progress number.
Specs
=====
When configuring a survey as one page per question and the random selection
of the questions, the numbers near the progress bar where not correct.
With this commit they now are.
task-2988062
closesodoo/odoo#109802
X-original-commit: 9487495e5e9a3f6ce899249f7eab6c7074c64464
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
The render API was confusing as mixing the access to the report and
the rendering env.
The ambiguity was present for code such as
`report.sudo()._render(record_ids)` where it was not clear if the
`sudo()` is needed to access to `report` or to `record_ids`. For low
priviledge users (such as portal or public), it was common to use
`report.with_user(SUPERUSER_ID)._render(record_ids)`.
This PR changes the render methods signature to be `api.model`. The
`report_ref` can be:
- ir.actions.report external id
- ir.actions.report id
- ir.actions.report recod
- `report_name` value
This will allow to call the report methods with any user and no longer
need to use `with_user(1)` to render reports as public user.
Task-id 2670865
closesodoo/odoo#91341
Related: odoo/upgrade#3650
Related: odoo/enterprise#27323
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
PURPOSE:
This commit allows to handle the situation in which the quick access
link is used but the live session is not launched yet, by showing an
appropriate error message and by allowing a user with sufficient rights
to launch the live session directly from the quick access page.
Since a session can be launched multiple times, the error related to
closed sessions has been removed, so that the user with the rights to do
it can also "relaunch" a session if it has been closed before.
Task-2816685
Part-of: odoo/odoo#88434
Rationnals
----------
Web servers can serve some resources (e.g. static files) right away
without any interaction with the web application. The network model of
most web servers makes them capable of handling thousands of
simultaneous requests when it comes to intensive IO operations such as
streaming data from a file. The network model of Odoo is different: it
is capable of a lot of processing power but can only serve a handful of
requests at a time, i.e. Odoo (with some help from postgres) is
optimized for CPU operations, not IO.
Some users don't configure their web server, they use a basic
configuration that relay all requests to Odoo. The result is that many
Odoo HTTP Workers can be busy streaming static files instead of
processing other requests. This can lead to a worker starvation, i.e.
all workers are busy streaming files and cannot process new requests.
X-Sendfile
----------
In this work, we add the support for the [X-Sendfile] header family,
they are multiples http headers that can be used by the web application
to communicate with the web server in order to delegate the delivery of
files stored on the file system. Odoo still receives the request but it
does no more stream the file content from within its HTTP worker,
instead it skips the response body altogether and sets the `X-Sendfile`
special header with the path of the file on the filesystem. The web
server intercepts that special header, open the file and stream it.
Using those headers, we can use the best of both the web application and
the web server. The web application is still responsible to locate the
resource and verify the access rights, the web server is still
responsible of streaming the content.
Using X-Sendfile is opt-in via the `--x-sendfile` CLI flag. We set both
`X-Sendfile` (apache) and `X-Accel-Redirect` (nginx). If you are using
apache, make sure `mod_xsendfile` is enabled. If you are using NGINX
you have to add the following location block:
location /web/filestore { # custom path, hardcoded within Odoo
# Prevent access from the outside world, i.e. makes this
# route only accessible via X-Accel. MANDATORY!!!
internal;
# Give access to the filestore using this server's
# permissions. Odoo is in charge of verifying the access
# rights.
alias /path/to/odoo/data-dir/filestore;
}
The Odoo [deployment documentation] has been updated accordingly.
[X-Sendfile]: https://www.nginx.com/resources/wiki/start/topics/examples/xsendfile/
[deployment documentation]: https://www.odoo.com/documentation/master/administration/install/deploy.html#serving-static-files-and-attachments
Changes to the API
------------------
To benefit most from X-Sendfile, all APIs related to streaming content
over HTTP has to be adapted. They are: (1) `request._serve_static`,
(2) `ir.http._serve_fallback`, (3) `/web/content` and (4) `/web/image`.
Each used it own way to deliver content: (1) `_serve_static` was using
`send_file` (flask's send_file that as been vendored with odoo 10
years ago and not maintenained since then), (2) _serve_fallback was
handcrafting a `werkzeug.wrappers.Response`, (3) /web/content-image were
using the "binary server" `ir.http.binary_content` API.
I has been decided to remove all 3 APIs and to merge the code inside of
the new `http.Stream` object and the `ir.binary` helper model.
A Stream wraps what is going to be sent to the browser, it can be a path
to a file on the locale filesystem, a blob of raw data or an URL to an
external resource. The Stream also holds various metadata that are
mainly used for caching. The preferred way to create a Stream is via one
of its three factories so that all the metadata are set. The factories
are: `from_path`, `from_attachment` and `from_binary_field`. A stream
instance exposes a single method `get_response()` used to create the
corresponding HTTP response object out of the stream.
Inside of `ir.http` were a few methods that were not related to the http
routing and formed what was called the "binary server". All those
methods have been removed and the feature have been refactored inside of
the new `ir.binary` model. The removed methods are:
- `_xmlid_to_obj`
- `_get_record_and_check`
- `_binary_ir_attachment_redirect_content`
- `_binary_record_content`
- `_binary_set_headers`
- `binary_content`
- `_response_by_status`
- `_get_content_common`
- `_content_image`
- `_content_image_get_response`
- `_placeholder_image_get_response`
The new `ir.binary` abstract model exposes the following utilities:
**`_find_record`**
Find an attachment or a record with a binary-field out of an xmlid or
out of a pair record-model/record-id. Check the access rights and the
access token.
**`_get_stream_from`**
Create a Stream from an attachment or a record with a binary-field.
**`_get_image_stream_from`**
Same as `_get_stream_from` but adapted for images. It sets a sensible
ETag on the stream and has image resizing support.
**`_placeholder`**
Get the image placeholder blob.
Testing
-------
It is possible to test the web server configuration using the
`test_http` module. Install the module then run the unittest using the
`webserver` test-tag. By default it attempts to connect to a web-server
running on `http://localhost:80`, you can change this URL by setting the
`WEB_SERVER_URL` environment variable.
odoo-bin -i test_http --stop-after-init
WEB_SERVER_URL='http://localhost:80' odoo-bin --test-tags webserver --stop-after-init
closesodoo/odoo#88134
Task: 2801675
Related: odoo/documentation#2083
Related: odoo/enterprise#26191
Signed-off-by: Julien Castiaux <juc@odoo.com>
Purpose
=======
Change all masculine nouns in Odoo's code to neutral nouns (when
possible), making sure that demo data is correctly handled. This is
particularly important since our code is open source, and nowadays lots
of machine learning models are trained on open source repositories.
With this small change we contribute to training more "fair" models, and
teaching models that "employee" or "user" != "he".
This also affects some text visible by the user, hence making it more
inclusive for Odoo users.
Task-2853046
closesodoo/odoo#91292
Related: odoo/enterprise#27302
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Set the survey in fullscreen (without the ribbon) and fixes the 404 page when
refreshing the survey management end page.
The end page has also been slightly modified by:
- hiding the header because it only contains relevant information when the
survey is running (link to join, number of person having answered the current
question, ...)
- hiding previous arrow which were not working (as the session is closed)
- hiding the next arrow which is not relevant and wasn't working
Task-2791044
closesodoo/odoo#90225
X-original-commit: dd6b007e174c19aeb45c1530aff987c393e36f70
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Install auth_signup, go to /web/login, 500 Internal Server Error.
auth_signup extends the /web/login template and in this extension calls
`keep_query()` which has been wrongly moved from base to http_routing in
commit 880954ebfc. Here, we restored `keep_query()` in the base module
but moved in ir_qweb.
closesodoo/odoo#87491
Related: odoo/enterprise#25754
Signed-off-by: Julien Castiaux <juc@odoo.com>
There were inconsistencies in the calls to `_render`.
* the view context could contain information that misled developers.
Indeed, the context and value of the view are not supposed to be found
in the rendering. Thus by calling `ir.qweb` with the name of the
template, we ensure that there is no unwanted information and in
addition the cache key is that of the name of the template which saves
a query.
* the context used for rendering was modified by a method on
`ir.ui.view`, except this is not information used by this model. There
is now a `_prepare_environment` method residing on `ir.qweb`. This
method allows to modify the value dictionary as well as the context in
which the rendering will be done. This preparation of the data as well
as my security check is done only once per rendering. This also saves
some queries
* Freeze options for rendering were inconsistent. It could be that
options on which rendering depends were not part of the cache key. Thus,
depending on the user who generated the generation of the rendering
function, there was or was not information in the template. For example
for automatic branding. This is no longer possible, because it is the
context that is used. The options serving as a cache key are only
recorded for information (for the profiling system for example). A
simplification of the `ir.qweb.field` models could be made.
The report rendering and call `ir.qweb` instead of `ir.ui.view`.
Part-of: odoo/odoo#85110
Reproduction:
1. Create a survey or use an existing one
2. Share it via mail
3. Try to open a link provided in the mail
Reason: the conditions for public users in _check_validity() are not
refined enough. The link in the email has answer_token, while the
general Survey URL is a direct link to the survey. However, the
condition ”request.env.user._is_public() ” is true for both cases. This
leads to redirection to the homepage for survey links in the email.
Tested locally that sending two different recipients same survey by
email will assign two different answer tokens
Fix: add the answer_token to the condition. If there is an answer_token
part, it means this link is specific for a partner, and no user check is
needed. Because ideally, only this partner received the link. If there’s
a leakage, it’s probably his/her problem
Original commit: 3c71f66bb541fcf31f31e75b60f7825d26109bc4
First fix: cffc732e58c14541abcf06bb0d58add224396b7c
opw-2795134
closesodoo/odoo#87258
X-original-commit: 5599995d80d1cefaa7ddcb91a201756acc8cbf02
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
3c71f66bb541fcf31f31e75b60f7825d26109bc4 fixed the fact sometimes the answer of another user than the one we wanted could be loaded when restarting a survey. With this fix, we introduced a check on the partner having created the answer the user was trying to access. It became impossible for a user to access an answer which wasn't his.
While correct in the case we were fixing, this introduced an issue with the /survey/print/ route, which allows any user with the right tokens to visualize the answers of another. We fix this by making sure we don't check the partner when accessing this route, to restore its former behavior.
closesodoo/odoo#86189
X-original-commit: cffc732e58c14541abcf06bb0d58add224396b7c
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Olivier Colson <oco@odoo.com>
To reproduce:
1) Create a survey and open it with a portal user with its /survey/start/*** link
2) In a private window, connect as the admin and remove the answer in 'Not started yet' state that step 1 created.
3) Go back to your portal user window and re-enter the same /survey/start/*** URL.
==> The portal user is brought back to the home page. He has no way to access the survey anymore, the link will always redirect him there.
This is because of cookies. The first time the user opens the survey, it creates a cookie in his browser allowing him to reload the answer he was working on. In our example, this answer has been deleted for some reason (maybe some cleaning of too old 'not started' or 'in progress' stuff); so the token stored in the cookie does not correspond to anything anymore. Instead of crashing and redirecting to home page, this commit makes it so that we now ignore the cookie in that case, so that the user directly has access to the survey to build a new answer.
Task-2729738
closesodoo/odoo#84390
X-original-commit: c642be8e1bc682af2919c1cfadfdc267f005272e
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Olivier Colson <oco@odoo.com>
To reproduce the issue:
1) Create a survey requiring user login, with multiple pages
2) Create portal user A and B
3) With user A, go to URL /survey/start/****, where **** is the access token of your test survey. Fill in the first pages of the survey, but don't finish your submission (so: the answer has to stay 'in progress').
4) Logout from user A.
5) From the same browser window (or without cleaning cookies, at least), directly login with user B, and go to the same /survey/start/**** link
====> The 'in progress' answer from A is loaded, even though we are connected with B and should hence not have access to it. Instead, we should have created a new blank answer for B.
This is due to our cookie management. When a cookie is kept in the browser with the token of a previously entered answer, we reload it without checking its owner.
Task-2729738
X-original-commit: 0be94b7f0bcb370bb8e8dea5febbc1c4a0b0cf86
Part-of: odoo/odoo#84390
PURPOSE
Various improvements of the results' statistics were required, mainly regarding
* the filtering features that were not clear and impractical
* the way answer scores was reported
* the vertical space taken by questions never answered
Among other smaller changes, the layout of `datetime`-answers questions is
harmonized with the other answer-types (grouped by value), considering that
the "time" part is important and that the "seconds" part bof that time would
only be changed if it is relevant to the question.
SPECIFICATIONS
**Filters**
It is now more convenient to filter surveys based on:
- Whether they are fully completed
- Whether they are passed
- Whether they are failed (last 2 are mutually exclusive, and only available
for scored tests)
A badge is added to show the number of surveys that match each filter option
if chosen. Note that this simple implementation does not allow to show the
number of surveys which would be displayed if the filter was removed, or
replaced, so the badges are not shown once a filter is selected.
The question/answer filters can now be removed individually.
The i.fa-filter elements used to activate them are now always visible, and are
only available for answers that have been selected at least once.
**Scoring**
Scores are added in tables next to the answers instead of as additional lines
below the question caption.
Right answers are now marked in the Graph and Data tabs instead of being simply
listed under the question.
**Unanswered questions**
To make this special case more clear to the user, a discrete alert is added
below the question. The Graph and Table tabs are removed in this case, as they
contain no information. For Multiple choice and Matrix questions, the Table tab
stays visible to show the possible answers available.
*Misc*
To follow common representation, numbers which are equal to integer values will
show as integers in answers and scores (e.g., 30.0 will show as 30), using a
sub-template.
Distinguishing the questions and results from the previous/next ones was
difficult, hence the added margins and discrete lines.
Similarly to other fields, datetime results now display one line per answer
value, with its occurrence.
Stylesheets are cleaned up.
LINKS
Task-2618399
closesodoo/odoo#77522
Related: odoo/upgrade#3168
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
A portal user couldn't download a survey certificate
Steps to reproduce:
1. Install the Survey app and open it
2. Create a survey with a scoring and a certificate and copy the link
3. In an incognito tab, connect as portal and go to the survey
4. After completing the survey, try to download the certificate
Solution:
Change the call 'sudo()' to 'with_user(SUPERUSER_ID)'
OPW-2687625
closesodoo/odoo#81957
X-original-commit: 962919ec878b4e93b4dd8f01f029ce1366976d9b
Signed-off-by: Grazioso Andrea (agr) <agr@odoo.com>
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>
PURPOSE
This commit globally improves the backend survey module usability, notably by
renaming labels, moving menu items around and cleaning unused features.
SPECIFICATIONS
These changes include (non-exhaustive list):
On questions
- Changing labels, action helpers and modules description to be clearer;
- Re-organizing the survey.question form view, notably to clearly distinguish
fields related to answers and validation options;
- Removing the "Clean test answers" server action as it can be done through
a search + unlink;
- Removing the allow_value_image field as we now always display the
image field. Users simply choose to let it blank;
On surveys
- Re-organizing the survey.survey form view fields to get a clear view of
the various options;
- automatically update scoring type when checking certification: if not one
linked to scoring, update to scoring without answers;
- set create as create_multi to speedup batch creation;
- Changes ACL rights for user_input_line. Now, only Survey Managers can
change answers. Survey users keep only a read access on answers, meaning
changing what customers / people answered is now limited to managers;
Globally
- Moving menu items and make them visible outside debug mode;
- Answer recap on print frontend page is now visible whenever a scoring is
applied, not only for certification, as if scoring is activated seeing
answers is probably wanted;
Task-2600241
closesodoo/odoo#79813
Related: odoo/upgrade#3033
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit adds the background per section feature.
If the section to display has a background image configured, the background
will be refreshed using that section background image.
If the section has no background, the survey background is used.
The background is refreshed at the same time that the next question is loaded.
To ease technical maintenance and to keep it simple, the background is always
faded out/in at each page change only if there are some sections on the
survey that has a specific background image. If no background image are set on
the survey sections, the background will never be faded out.
Note: The next section to display depends on free text (section with
description) configuration and on conditional questions.
The next section to display can be the next question's section or directly
the next question itself (if the question is a section).
This section's background image implementation works both for the regular
survey form as well as the "live session" mode of the survey module.
Task-2225393
closesodoo/odoo#79156
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
When going back, after this commit, the last displayed page is saved in order to
reload the survey exactly where the user left it, instead of loading the survey
at the latest question of the survey displayed to the user.
Typically, if the user goes back and leave the survey on question 4, after
reaching the question 7, instead of reloading the survey on question 7,
the survey will be reloaded on question 4, where the user left the survey.
Task-2225393
Part-of: odoo/odoo#79156
* = auth_signup, calendar, im_livechat, snailmail_account, survey, test_mail,
web_editor, website_crm_iap_reveal, website_livechat
The aim of this PR is to improve/fix various flaws and limitation of the current
API, to make it easier to use and more efficient.
Notification are now defined with 3 distinct parts:
- the channel determines which client(s) should receive it
- the type determines how it should be handled
- the payload determines any extra information helpful for handling it
Channel
=======
Business code
-------------
- Record channel is introduced for ease of subscribing to and sending
notifications to specific partners, channels, documents, ...
- String channel is still supported (but it is converted internally to the tuple
channel).
- Tuple channel is still supported without any change (but should be avoided
whenever possible due to its complex syntax).
The channel is no longer sent to the client. When the channel was used for
business purpose, the information it contained has been moved into either the
new type, or the payload itself.
Technical note
--------------
All channels are now internally converted to the tuple (db, ...) channel, which
is necessary for the platform code (saas/sh).
Internally, the bus.bus table is not changed, type and payload are grouped
together into what was (and still is) called message.
Type
====
Type is introduced to uniformize the way notifications are sent and handled.
All existing notifications already had some kind of manually-built type in them.
This is now officially supported at the bus API.
In client code this will allow (to be done in future commits) to register one
handler per specific type, instead of having to iterate and to filter all
received notifications on every handler.
Payload
=======
Payload (ex message) did not change, it can still be anything depending on
business needs.
Few adaptations:
- When the type was included on the payload, the type has been moved to the new
type parameter.
- When the channel was used in business code, its data has been copied into the
payload.
task-1891151
closesodoo/odoo#79201
X-original-commit: 543af27c7d6836ffac9e80ff8490b6ddbd849221
Related: odoo/enterprise#21998
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Before this commit:
Let's consider the following two scenarios while answering time limited survey:
1) attendee's system clock is de-synchronized compared to the real time
2) Odoo server clock is de-synchronized compared to the real time
In any/both of the above cases, it will lead to a wrong timer display, and will
confuse the user and/or make him fail the test because he will think he still has
more time to submit when he does not.
With this commit:
To fix this, we simply get the offset of server UTC time and moment time, and apply
the offset while calculating the time remaining.
Task-2612972
closesodoo/odoo#77419
X-original-commit: 9e9cd045b2899abc5c8e4a92c43ed6eb2eea158a
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
* = crm_livechat, hr, hr_holidays, im_livechat, mail_bot, purchase, sms,
snailmail, survey, test_discuss_full, test_mail, web_editor, website,
website_livechat
- Create new model `mail.guest` for guests.
- Rewrite some RPCs to target routes rather than model methods so that
guests are able to use them.
- Patch JS and python models to support guests.
- Create a stand-alone page and boot the channel in it.
task-2494829
closesodoo/odoo#75496
Related: odoo/enterprise#20417
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Multi-Application Management and UX improvements.
Improve in Recruitment app Job Positions Kanban view;
It is more intuitive if list is applications default view; improve the applications form;
Task - 2404610
closesodoo/odoo#63946
Related: odoo/enterprise#15750
Signed-off-by: Kevin Baptiste <kba@odoo.com>
This branch adds request.redirect on all requests.
In case of a front end request, we do an url_for to the location.
We removed redirect_with_hash that was only for retro compatibility
local_redirect has been renamed to redirect_query, and param keep_hash has been
removed and moved.
Default code for redirect is 303 now instead of 302.
Now redirect and redirect_query make local redirect by default, you need to
pass local=False to make external redirect.
All werkeug.utils.redirect has been replaced by request.redirect.
Http.redirect now use an http.Response type, and it become easy to add an
override like 'set_cookies' e.g.
Dispatch of a website.page return an http.response too, so we first need to
check if it is a cached version before to check if it is an Odoo Response.
Migrate your code:
http.redirect -> request.redirect(location, code, local)
http.local_redirect -> request.redirect_query(location, query, code, local)
http.redirect_with_hash -> request.redirect
Courtesy of odony for help and review ;)
closesodoo/odoo#72599
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Steps:
- Go to Surveys
- Create an new survey:
- Questions:
1. First section
2. First question:
- Multiple choice: only one answer
- Answers:
1. First answer
- Choice: Yes
- Is a correct answer: Checked
- Score for this choice: 1
2. Second answer
- Choice: No
3. Second question:
- Multiple choice: only one answer
- Answers:
1. First answer
- Choice: Yes
- Is a correct answer: Checked
- Score for this choice: 1
2. Second answer
- Choice: No
- Options tab:
- Conditional display: Checked
- Triggering question: (First question)
- Triggering answer: (First question, First answer)
- Options tab:
- Layout: One page per section
- Scoring: Scoring with answers at the end
- Click Test
- Select the two correct answers
- Submit
Bug:
The score is 50% instead of 100%.
Explanation:
Since multiple questions are submitted at the same time, we cannot know
before saving the question whether the following is still going to be
active.
This commit re-evaluates, for each question, which are the ones that are
still active.
opw:2537713
closesodoo/odoo#72126
X-original-commit: ec836acdc7bf10212f14a8bc98eac4cfa2f12e26
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: backspac <backspac@users.noreply.github.com>
This commit adds a new chart at the end of a scored survey.
Previously, you could see your "Overall Performance", meaning what was your
percentage of correct/partially correct/incorrect/skipped answers for all
the survey scored questions.
Now, we added a new chart new to it that shows the percentage of
correct/partially correct/incorrect/skipped answers but for each section of the
survey.
This allows the user to see in which section(s) he did the most mistakes.
Task-2484885
PURPOSE
=======
For now, the host can't go back to the previous screen on a live session.
Why would he want to go back? Misclick, want to display again the result, other
SPECIFICATION
=============
On a live session, let the host go back to the previous screen.
Do not "restart" the questions but display the graph with the results.
This back capability is independant of the "back button" survey option.
Even if the back button is disabled on the survey configuration, the host must
still be able to go back during a session.
Task ID: 2351759
closesodoo/odoo#59659
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
PURPOSE
Before this commit, the survey host had no indication that his survey
has no questions. After this commit, he will be displayed with that
indication.
Before this commit, someone who took the survey had a message implying
him to modify the survey to add questions. After this commit the message
will say 'No question yet, come back later'.
LINKS
Task ID : 2456372
PR : odoo/odoo#68231
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Right now while previewing the certification template, the proper title is not
displayed on the tab of browsers.
This commit improves the behavior by adding name of the certification in title
so that use can see the proper string on browser tab. For doing so, we create
a new wrapper template that sets the title for the page, and use an iframe
to loads the pdf file from existing controlloer (which returns response for the
preview pdf).
Task ID-2341847
COM PR odoo/odoo#66028
Steps to follow to reproduce the bug:
-Go to survey
-Choose any survey with at least one "single text box" question
-In the survey form
-Click on the button test
-Complete the survey, but in a "single text box" question, write the word "comment"
-Validate the survey
-An error is triggered.
Problem :
In the function which extracts comments from answers, it doesn't check the type in which the answer is stored.
When there is a comment, it is stored in a dict under the key: "comment".
To find the comment, the function checks if "comment"(key) is in the answer.
But in the case of "single text box" question, the answer is stored in a string.
If the word "comment" is present in the answer, the function looking for the key "comment" will return True and try to extract the comment.
Solution :
Add a check to ensure that we are looking for the key "comment" in dict type.
opw-2446194
closesodoo/odoo#67002
X-original-commit: 7064d46a804ab86d1bc50d003b8ae63490a1ef9c
Signed-off-by: Anh Thao PHAM <kitan191@users.noreply.github.com>
Signed-off-by: Djamel Touati <DjamelTouati@users.noreply.github.com>
The goal of the draft state on survey is to have the survey under edition
mode before before sending it to participants. Under this mode:
- the responsible can test it (can be done with "In Progress" mode)
- the survey can't be answered (same as the state closed)
The risk that the survey can be leaked before being ready is really
limited. If it's a live survey, participants will have to guess the
4 digits access code and wait for the host to go to the next question.
Else, participant will have to guess the token.
Considering these facts, the use of the draft state is very limited so
'draft' state can be dropped. If we do so, we are left with only two
stages that are 'open' and 'closed'. But whether to consider survey
open or closed can be simply achieved with active field we already
have (if active=False, survey is closed, otherwise it's considered
as open).
So with this commit, we remove the state field from survey and thus
simplify the flow. It means that we no longer require 'Start Survey'
button, and so that button is also removed, and for the closed surveys,
instead of the button 'Set to draft', now we have a 'Reopen' button
which will activate the survey. And instead of displaying few buttons
after saving a record, we now display all the buttons from beginning.
Task ID-2389434
COM PR odoo/odoo#62712
ENT PR odoo/enterprise#15217
UPG PR odoo/upgrade#2006
steps to reproduce:
- start a certification with time limit
- close it and go to it back after time limit +10 seconds is passed
=> an "There was an error during the validation of the survey." appear
that prevent to finish the survey or do it a second time until the
ongoing survey.user_input of the user is deleted.
This was done to prevent people from cheating by answering after the
time limit end. With this changeset, when we go back to the survey after
its end, we will finish it without saving the answers.
opw-2390623
closes#62752closesodoo/odoo#62770
X-original-commit: 4d088ad719b456e73b7586087084a6d0b59ff455
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Co-authored-by: David Beguin <dbe@odoo.com>
This commit improves the UX of the page responsible for joining live
quiz session. Few of the improvements are
- Increase size of the input tag related to code
- Display proper error message based on type of error
- Move the error message below the code input
- Improve few strings
Along with that, this commit also interchanges the position of
'Add a question' and 'Add a section' options question tabs
of the survey form view.
Task ID-2345907
closes#59060
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Before this commit, when sharing a survey 'Login required' to a non logged in
user, the redirection was made to the home page.
The reason is: when the survey is not started yet, no user input is already
created for this survey and this user. So if no user_input has been created,
yet, that means that the user has never started the survey before and user
need first to login before continuing.
After this commit, we redirect to the loggin page.
Task ID: 2246430
closesodoo/odoo#58965
X-original-commit: a309d889ddf6e03a6701e921258cfa9338800fbb
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: David Beguin <dbeguin@users.noreply.github.com>
In order to avoid making it possible to follow the same survey multiple times
at the same time, a survey cookie is added with the survey token and answer
token.
When starting the survey, if the cookie contains a valid answer token for that
survey token, the survey session is reloaded where the participant left it.
When the user finished the survey, the cookie is deleted to allow to retake the
survey later, if possible.
Note: A participant can still open multiple tabs with the same survey, but it
will be linked to the same survey answer. So if the user tries to submit another
answer, the late answer will overwrite the previous one.
Task ID: 2345468
closesodoo/odoo#58728
X-original-commit: c97c266313aff864f8c397fb1b42f792f9650e5e
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit fixes a bunch of small issues on the session manager.
- Put the progress bar below survey link to optimise available room for title.
- Ensure attendees count is also updated when refreshing the results
and progress bar.
- Ensure the graph is correctly setup when there is no attendee yet.
- Update y axis in chart when new attendee join the survey in the middle of
a session.
- Set padding top to chart to avoid top bar label to disapear from chart if bar
is near 100%.
Task ID: 2343508
closesodoo/odoo#58291
X-original-commit: 018a07dc7bba85f5afdd41f8610098a3c493c82a
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Steps to reproduce the bug:
- Let's consider a survey S
- Set the scoring option of S to Scoring without answers at the end
- print S
Bug:
A 403 error was raised.
opw:2307495
closesodoo/odoo#55556
X-original-commit: bb627bf8c182905adcf2bf9d9820c6e91dd44d26
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Purpose
=======
This commit intends to improve the animations on the leaderboard during survey
sessions. We now show both the ranking of each attendee before and after taking
into account the current question scores.
It allows attendees to see their position in the leaderboard shifting up / down
depending on how well they answered, and adds a bit more interactivity during
the session.
Specs
=====
The code changes to make this happen implied having multiple layers of
animations running one after the other.
The use of async/await in the JS allowed for a much smoother and less indented
code, simplifying the reading.
We now have 2 different "bars" to handle:
The bar that shows the previous leaderboard position.
The bar that shows the current question score.
This means we handle both jQuery items and modify their size & transition
properties depending on our animation.
Unfortunately, all these animations required a lot of testing to find fitting
timings, which means using quite a few setTimeout with "magic" delays.
These were just the most good looking ones and it feels like naming them with
a constant would not really help.
We also slightly improved the graphic font size / styling to make it easier to
read for potentially far away attendees.
Task 2235815
closesodoo/odoo#50991
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Unanswered questions or sections are now hidden in the survey review mode.
Only the question answered by the user will be visible.
If the survey was done during a session, the users will see their own answers,
even if the theme they selected was not the most voted one (in case of
conditional questions).
To get the questions to display :
- questions that have been answered
- + the ones that should have been answered = active questions
In session, active questions are based on most voted answers)
This commit also fixes the randomized questions handling in most voted answers,
as copied predefined questions where <NewIds> and those was not usable in
some templates.
Task ID: 2230980
X-original-commit: 8ca79727d5a93b91746c1e63d59d08550417906c
render, render_template, load, activity_schedule_with_view,
get_website_pages should all be private:
It should not be possible to render an aribtrary template only with
its name or id
Still need to render some qweb views from js so the method
render_template is kept public.
This explains why the website editor still need read access on
ir.ui.view as we want to allow any snippet to be rendered.
Purpose
=======
Speed up survey completion.
Specifications
==============
This commit apply an auto commit when user select a choice on a simple choice
question or on a matrix question with simple choice.
The auto commit happens following those conditions:
- Only on simple choice and matrix with simple choice questions
- For matrix, only when last subquestion is answered
- Only when Back mode is active
- If this is not the last question
Link
====
PR #46768
Task 2208574
This commit slightly changes the way users navigate through the survey form:
- The back button was moved to the bottom-right of the screen.
- The "Continue" button stays at the center but there is also a "next" button
at the bottom-right of the screen (same behavior -> submits the form)
- Arrow keys (left + right) navigation is now supported
Technical note: As the survey navigation is now outside of the survey content,
that was re-rendered on every submit, we have to manually refresh the
navigation with a second template render on the controller side.
LINKS
PR #46768
Task 2208574
This commit slightly improves the survey form by adding a few cosmetic changes,
notably:
- Add/reduce some margins/paddings
- Adjust colors/font-weight
- Adjust heights
- Change some icons by more fitting replacements
- Center matrix choices
- Move survey progression to bottom-right
- Remove ugly jumbotrons
- Hide survey title in page_per_question layout
- When there are 5 or less option for simple_choice or multiple_choice
questions, display the options vertically.
- Only show the textarea for the "comment answer" if the user clicks on the
related option.
One of the biggest design change is the introduction of a "minimized layout"
that reduces the width of some question types on bigger screen.
This gives a cleaner look to the survey form.
Impacted question types:
- Numeric
- Date
- Datetime
- Simple / Multiple choices
Technical note: As the survey progression is now outside of the survey content,
that was re-rendered on every submit, we have to manually refresh the
progression with a second template render on the controller side.
Small fix addition:
We also fix the matrix key selection feature in case the matrix had a total of
more than 25 options, which would raise an error.
Indeed, they "use key selection" condition only checked the number of rows,
and not the rows * columns (total number of options count).
LINKS
PR #46768
Task 2208574
PURPOSE
Improve the various sessions flow to make it easier for attendees to reach the
session and to allow better interactions between the host and his audience.
This comes with small usability improvements as well as increased
"beautifulness" by using custom layouts & animations.
SPECS
This commit changes the survey sessions fade in/out delay for both the host
and the attendees.
When going from one question to another, the total delay is now 1 second
(instead of 2 previously), with 500 ms for fade out and 500 ms for fade in.
The previous delay gave an impression of "slowness".
The delays and "server lag reduction" on the attendees side were adapted
accordingly.
LINKS
PR #46768
Task 2208574
PURPOSE
Improve the various sessions flow to make it easier for attendees to reach the
session and to allow better interactions between the host and his audience.
This comes with small usability improvements as well as increased
"beautifulness" by using custom layouts & animations.
SPECS
- For live session only:
Currently, the "short link" feature is good but it still needs to be improved
with the following points:
- Make the default "code" shorter (4) and digit only.
- Allow to customize the "code"
- Check for potential collisions
Added at the same time:
- input element is focused when you land on the '/s' page.
LINKS
PR #46768
Task 2208574
This commit remove unecessary array around triggered_questions_by_answer values
that is used at the client side to find inactive questions.
Before this fix, when looping through every elements of
triggered_questions_by_answer, we got an array, instead of each question id
separately.
PR #48442
Task ID 2208574
We now have a way to display "free text sections" during the survey flow.
(Since 5b74f54396 )
However, the behavior during survey sessions was not optimal:
- Attendees could click on "submit" and it would raise an error
- The section description was not displayed on the host screen
- The section description was never the "current question" of the session of it
was the first item of the question_and_page_ids
This commit fixes all those points to have a nice session flow.
While the host is explaining the section description to the attendees, they get
a waiting message on their screen.
In addition, we fixed the display to avoid showing pages that lack a
description, and we reworked the '_get_pages_or_questions' method to have more
meaningful and readable cases for every layouts.
LINKS
PR #48442
Task 2208574
Purpose
=======
This commit makes the live session mode work with conditional question.
The point is to determine which question to display next. As multiple users
are 'voting' for answers of the same questions, the way to determine the
next question to display is to keep only the most voted answer.
The most voted answer will be the only one to trigger the linked conditional
question.
E.g.: considering
- following survey configuration:
- Q1: A1, A2
- Q2: triggered by Q1-A1
- Q3: triggered by Q1-A2
- following user inputs:
- U1: A1 selected
- U2: A2 selected
- U3: A2 selected
The next question displayed to ALL users will be Q3.
Note: If U4 had selected A1, the next question would have been Q2 as
when there is an equality, we select the first one.
Link
====
Task ID: 23509
PR #44950
Purpose
=======
This commit adds a new survey mode : conditional questions. A conditional
question is a question that will be displayed to the user only if the user
selects a specific answer from another previous question i.e. question B is
displayed if user answers 'Choice 1' at question A.
Specifications
==============
There are 2 different ways to handle conditional questions.
* For one_page and page_per_section survey layout: conditional management is
done mainly at frontend side. The idea is to be able to load all the
questions of the section, hide the conditional questions and display them
dynamically on answer check.
E.g.: If user checks answer 'Choice 1' from question A, question B is
displayed immediately.
If question B is on section 2 and survey layout is set to section per page,
question B will be displayed immediately on next page template load.
Indeed, on each page load, server sends all the selected answers and the
template displays the conditional question depending on the already
elected answers;
* For page_per_question survey layout: conditional management is done mainly
at backend side. The idea is to find on each page the next question to
display depending on:
* navigation direction (next - previous)
* already selected answers and conditional question dependance
* survey questions sequence
E.g.: If questions survey are Question A, B and C and question B must be
displayed if answer 'Choice 1' from question A is selected.
At Question A, if user select 'Choice 1' and goes next: display B
At Question B, no matter the answer, if user goes next: display C
At Question B, no matter the answer, if user goes prev: display A
At Question A, if user select 'Choice 2' and goes next: display C
At Question C, no matter the answer, if user goes next: End survey
At Question C, if user has selected 'Choice 1' at question A and goes prev -> B
At Question C, if user has selected 'Choice 2' at question A and goes prev -> A
In both modes answers on questions that should not have been displayed to the
user depending on the previous selected answers are cleared.
E.g. : User checks 'choice 1' from question A, then complete question B.
Then user unchecks 'choice 1' -> answer on question B is cleared.
Ignore conditional configuration :
* during survey session, to avoid having different users answering different
questions on the same session. That would be confusing for users to see
questions on presenter screen that they didn't have the opportunity to
answer;
* if survey questions selection is random, because it will not display
conditional questions if they are not kept by randomization. To avoid
confusion, conditional configuration is simply ignored, not unset, so the
user can still reactivate it without having to reconfigure everything.
Remove questions that should not have been displayed to the user (depending of
the made choices) in scoring computation and print layout.
--> Inactives questions are removed from predefined questions when user finish
the survey.
E.g.: If the user selects first path on 2, he will never see second path.
If the user answers correctly to all question of first path, he should have
100%, instead of 50%, even if questions of path 2 are mandatory and scored.
Link
====
Task ID: 23509
PR #44950