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
This commit improves the answers count in the context of survey sessions as
well as displayed answers to narrow them down to the "current session".
We simply use a custom domain to consider all user_inputs and user_input_lines
that have a create_date after the start of the session.
It will help users to be able to re-use the same survey multiple times and run
different sessions without having to duplicate the survey every time.
LINKS
PR #45111
Task 2191924
PURPOSE
Improve layouts and usability for the host screens when using survey sessions.
We focus on the "host" screens, as the attendee screen is based on regular
survey flows/design.
SPECS
In short: copy mentimeter "wow effect".
Main points:
- Remove the "question" container (keep only "Results/Ranking")
- Remove the tabs concept, views are displayed in full screen
- Purpose is to have a "clean view"
- The display must be "full screen" with only relevant info
- Enable a easy keyboard navigation with left/right keyboard arrows
and spacebar
- Switching from results to ranking to next question is always linear
(next/previous instead of tabs)
- Improve charts
- Remove the pie chart : make bar charts instead for simple / multiple
choices
- Show the chart results "as people answer to it"
Only if question is not scored, otherwise show when all answers are
received / when user goes to "next"
- For free text/date/datetime: show small bubbles with attendees answers
- Add resize, fade in/out, ... animations for "wow effect"
LINKS
PR #45111
Upgrade PR odoo/upgrade#774
Task 2191924
Before this commit, while retaking a survey with 'Retry' button, the test
mode was not retained leading to unexpected behavior. This commit fixes the
issue by populating required parameters while retrying the survey that ensures
proper behavior for both test and non-test entries.
Task ID 2170720
Closes#43806closesodoo/odoo#44187
X-original-commit: 65d77b7101acf63fb4316187b5fd94b050b945c3
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit cleans some useless .decode('utf-8') calls when we return rendered
templates results in the survey controllers.
The http module is capable of handling that type of results and the calls were
not necessary / added complexity.
Task '2187328'
closesodoo/odoo#44540
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
PURPOSE
Add a "live session" mode for survey that allows the host to interact with its
audience.
He controls the pace of the survey and the audience answers questions one at a
time.
Results for each question can be displayed by the host to adapt his speech in
real time.
A gamification component even allows to give points to the attendees, based on
the quickness of their answer, and create ranking to keep everyone's attention.
SPECIFICATIONS
This whole feature is deeply integrated with survey.
It adds a layer of "survey session" on top if it that gathers attendees and
answers during the lifespan of the session.
The attendee identity is filled in by a special question that is marked as
"Save as user nickname".
If the host has not configured that question or if the user doesn't answer,
they are marked as "Anonymous" in the rankings.
The answer score computation is also altered during the session to take the
speed of the answer into account.
To ease the access to the survey to attendees, we have introduced two new
routes in the survey main controller:
- '/s/123456'
That uses the 6 first characters of the token to give quick access to the
survey and allow typing the URL manually somewhat conveniently.
- '/s' that renders a view that asks the attendee to enter the survey 'code',
which then redirects to the previous route.
This commit also fixes a few bugs:
- A bugged use case with the "enter key" listener.
When the survey is done, we display a "result template" that shows the user
his score and allows him to retry if possible.
When this template is displayed, we don't want to listen to the "enter" key
that allows to submit the survey form.
- We now correctly remove the timer and initialize the result
widget when the user presses 'enter' on the last page / question.
SURVEY SESSION FLOW
HOST point of view:
- On the Survey Form, the host configures:
- "Reward quick answers" that gives more points to attendees if they answer
quickly
- Question Time Limit, on each question, that defines the time limit for
that specific question, allowing to have different (or no) timer for each
question.
- From the Survey Form, the host can start a "live session"
Only one session per survey can be running at a time.
- When he starts the session, the session_state is marked as 'ready', meaning
all attendees landing on the survey page will be part of the session.
- The host will land on a page showing the current number of attendees as well
as the link for the attendees to join that session.
- The host starts the session, activating the first question of this session.
We keep an active reference to the "current_question_id" and use the bus to
trigger an event that will refresh the survey page for all attendees, showing
them the question and allowing them to answer.
- The host gets a "question management screen", from which he can:
- See the current question text & suggested answers
- See the current question timer
- See the number of answers received for the question
- Display the answers of the question (same view as the survey "results"
page, but only for the question)
- Display the ranking of attendees (if "competitive mode" is enabled)
- The host controls the pace of the survey by moving to the next question until
it's the last one of the survey, then ends the current session.
When the session is closed, we mark the answers of the attendees as "done".
- The host lands on a screen where he sees the survey results and the ranking
of all attendees.
ATTENDEE point of view:
- He reaches the survey when a session and open, and gets a screen asking him
to wait until the host decides to start the session.
- When the sessions starts, he's automatically redirected to the first question
(see above).
- If the session is already started when he reaches the link, he lands on the
current question (and NOT on the first one)
- If the host has configured a time limit, the attendee sees the countdown
while he's answering.
- When the attendee answers the question, the screen tells him the answer is
registered and he has to wait for the host to go to the next question, which
will happen automatically.
- If the timer reaches 0 and he has not submitted his answer, it's too late and
he waits for the next one.
- It continues like that until the end of the session.
- At the end of the session, the attendee gets a screen with his global results
(same as a regular scored survey).
PR #43568
Task 1972640
Co-authored-by: David Beguin <dbe@odoo.com>
As well as background, suggested answers images are not available for public
users as they don't have access rights on that model. This commit adds a route
called by survey template that render the suggested answers image in sudo mode.
closesodoo/odoo#44351
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Since recent refactoring, filter data have 'question' and 'answers' as
filter_data keys, instead of 'question_text' and 'labels'. This commit fixes
the naming in template using filter_data.
Also, comment that does not count as answer is not linked to a suggested
answer. So that filtering on those comment does nothing because we cannot
find an answer_id in that case. As it makes no real sens anyway to filter
on those kind of comment, filtering have been disabled on those comments.
Triggered by task ID 1972640 (live sessions on survey)
PR #44205
In this commit, all the questions type have been redesigned to look more fancy.
(impacted question types : radio and checkboxes, text boxes (textarea and text
inputs, date and datetime inputs and matrix)
For radio and checkboxes, both design have been aligned to work the same way
(except checkboxes can still have more than one selected option).
Selection by key have been applied on those two question types if the number of
option is under 26 (to use all the alphabeat character for selection). This
selection by key is only available on page per question layout.
Tests have been adapted accordingly to the redesign (typically for choice and
matrix inputs)
* Progress Bar
This commit adds a progress bar to the survey to inform the user
where he is in the survey filling process.
There are two progress modes:
- Number : will display the number of the current page on the total number
of pages (or questions if layout mode is question_per_page)
- Percentage : will display the percentage of page or question already done
So this leads to, on last page:
- in Number mode :
the progress bar div is 100% filled 3 / 3 pages [===]
- in percentage mode :
the progress bar is aligned to percentage 66% completed [== ]
* Print Widget
A widget is added for survey print mode in order to resize all textarea to fit
their content, instead of showing a scroll bar. This can be usefull if user
wants to print the results. He will get the entire content of the 'textarea
answers' instead of only the two first lines.
* Misc
This commit also :
- adds background image to survey.
- redo quizz correction and add some data to illustrate non scored
questions rendering in print template
- review breadcrumb style
Note : readonly data option on survey form widget is not set anywhere yet but
the usage is done in prevention of the future work on presenter view for survey
session mode.
Task ID: '2150291'
PR #43237
PURPOSE
To have a better UX, the transition between questions in a survey should not
be done by loading another page, but by loading next questions in AJAX.
This will allow to fade out / fade in the next question and improve the user
experience, as well as prepare the work for the complete survey redesign.
SPECIFICATIONS
General
=======
This commit refactors the way the questions are loaded.
To go to next question(s), instead of redirecting to a new page containing
the next question(s), the submit process is loading the next question(s)
using ajax. The template of the question is prepared at server side and is
given in html string to the client that display the next question in a smooth
transition (fade in / fade out).
This commit includes also the start and the end screen of the survey inside
the survey form in order to perform smooth transition between start screen
and first question(s) and between last question(s) and end screen.
Only one master template (survey form) is now used to display every part of
the survey : start + questions + end screens.
The answer_done error is now handled by the _prepare_survey_data itself.
If the user wants to display an already_done survey, the returned template
is the end screen.
This commit handles page transition for the survey results. When submitting
survey, the survey result widget is initialized and attached to the survey
result section.
A new route has been added : /survey/begin/.
If the user arrives on start screen, the state is 'New'. Once the user clicks
on Start button, an rpc call is made to survey/begin that will call the
survey_prepare_data to render the first question page and set the state to
in_progress and the start_datetime of the answer.
Validation
==========
Add the validation of all types of questions directly in the frontend.
This allows to reduce the latency before the survey is validated and was
necessary to go along with our new fade out / fade in mechanism.
The client does not need to wait the validation answer from the server to
display validation error messages.
The current questions are only faded out if the frontend validation has passed.
The server still makes this validation before submitting answers and loading
next question(s) to avoid direct rpc calls that would mess up the answers.
Error messages are now displayed with a slide down transition, for a wonderful
wow effect !
Timer
=====
As the survey form works with ajax to display start screen, question(s) and
end page, the timer has to be started only after the start screen.
This commit display and start the timer only after start survey button is
clicked.
Breadcrumb
==========
As the survey form now works in ajax to display in same page start screen,
question(s) and end page screen, the breadcrumb has to be controlled not only
on page loading but also manually between transition from a screen to another.
To ease the breadcrumb management, breadcrumb is now a widget that will reload
a js template, mainly depending of the current page id.
The js form initialize or update this widget giving this new page id.
On breadcrumb item click, the widget triggers a onclick caught by the form
that calls the submit with the given target.
This commit handles page transition for the breadcrumb. When going forward or
backward (next or previous page), the breadcrumb activates, deactivates and
links elements are reinitialized depending of the target page.
LINKS
Task ID: 2152223
PR #41453
Co-authored-by: Aurélien Warnon <awa@odoo.com>
Purpose
=======
If the timer goes to 00:00, the form is automatically submitted but the answers
are not saved. The form should be submitted, validation should filter out
invalid answers to avoid showing validation errors on the form, and save
answers.
If the answer is not in the correct format : skip the question
If the answer is required but there is no answer : skip the question
This way, we can still compute score.
Specifications
==============
This commit removes the invalid answers from the question to save, only if the
timer is not over, to be able to compute score on not finished survey.
In order to avoid being able to submit answers when the survey is marked as
done, a check was added to return an error for that use case.
Also, to avoid frontend timer hacking, an extra buffer of 10 seconds has been
added. If the time limit is reached and the submit occurs 10 seconds after the
maximum stop time (start time + time limit), no answer can be submitted.
Task ID: 2152223
PR #41453
PURPOSE
As new features are about to land in survey, notably live interactions [1]
and new survey building [2] performing a pre cleaning is necessary. In this
PR we clean survey models by: removing unnecessary fields, cleaning some code
and finally renaming models.
SPECIFICATIONS
Purpose of this commit is to globally rewrite the way statistics are
pre computed and used in results page of surveys. Indeed current code is
very complex, having a lot of calls to the same methods while taking only
part of its results. It also have a mix of model and controller methods,
data is computed several times a bit differently, ...
In this commit we rewrite that part. Including
* a simpler code flow;
* a simpler data structure;
* use a better naming for methods instead of "prepare_results" called
randomly within the code and re-using part of its returned content;
* use record sets / records instead of giving sub-elements of a record
like question.title, label.value, ...
Data structure
* simply give a question_and_page_ids to the template that will iterate
on pages / questions;
* have a graph_data, table_data dictionaries available for graph and
table display with simple entries;
* graph_data: holding all necessary but minimalist data for graph display
if question allows it;
* table_data: holding all necessary but minimalist data for table / summary
display;
* hold record sets of done / failed answers and answer lines;
In this commit we also simplify and clean pagination in survey graph results
* remove page_range helper tool that can be inlined in the templates
directly, doing a simple range;
* fix and improve pagination code;
LINKS
[0] Related to Task ID 2061901 (survey models cleaning and preparation)
[1] Task ID 1972640 (live interactions)
[2] Task ID 2119587 (new frontend for building surveys)
PR #40765
PURPOSE
As new features are about to land in survey, notably live interactions [1]
and new survey building [2] performing a pre cleaning is necessary. In this
PR we clean survey models by: removing unnecessary fields, cleaning some code
and finally renaming models.
SPECIFICATIONS
This commit lints JS files located in survey as some typos and mistakes
were recently introduced. Code related to routes is also slightly reorganized
to better understand file main sections.
LINKS
[0] Related to Task ID 2061901 (survey models cleaning and preparation)
[1] Task ID 1972640 (live interactions)
[2] Task ID 2119587 (new frontend for building surveys)
PR #40765
PURPOSE
As new features are about to land in survey, notably live interactions [1]
and new survey building [2] performing a pre cleaning is necessary. In this
PR we clean survey models by: removing unnecessary fields, cleaning some code
and finally renaming models.
SPECIFICATIONS
In survey.user_input.line, clean code about constraints. Purpose is to make
it easier to read and understand.
Code creating user input lines is moved from survey.user_input.line model to
survey.user_input. Indeed it is now based on a user_input record, and create
answer line related to a question, based on values coming from controllers
(and therefore frontend). It makes more sense to delegate that code to the
user_input model itself that creates its lines. Code is also rewritten to
be cleaner and easier to read.
Code computing statistics on user input records is moved from survey model
to user_input model, where it belongs. Missing translation marks are added
because translations matter.
LINKS
[0] Related to Task ID 2061901 (survey models cleaning and preparation)
[1] Task ID 1972640 (live interactions)
[2] Task ID 2119587 (new frontend for building surveys)
PR #40765