Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FW][FIX] survey: ignore extra questions of random surveys #48371

Closed

Conversation

@fw-bot
Copy link
Contributor

fw-bot commented Mar 25, 2020

When a random survey does not use all the questions available in a page because of the random_questions_count field, _get_answers_correctness was still including them in the skipped category.

This commit ensures that those questions are not included in the result, and adds a test that checks it.

Forward-Port-Of: #47841
Forward-Port-Of: #47362

@fw-bot

This comment has been minimized.

Copy link
Contributor Author

fw-bot commented Mar 25, 2020

Ping @madprog, @tde-banana-odoo
This PR targets master and is the last of the forward-port chain.

To merge the full chain, say

@fw-bot r+

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@tde-banana-odoo

This comment has been minimized.

Copy link
Contributor

tde-banana-odoo commented Mar 25, 2020

@fw-bot r+

@robodoo robodoo added the r+ 👌 label Mar 25, 2020
@C3POdoo C3POdoo added the RD label Mar 25, 2020
@tde-banana-odoo tde-banana-odoo force-pushed the odoo-dev:master-13.0-fix_survey_chart-pmo-AijC-fw branch from e7fe337 to 485980f Mar 30, 2020
@robodoo robodoo removed the r+ 👌 label Mar 30, 2020
@fw-bot

This comment has been minimized.

Copy link
Contributor Author

fw-bot commented Mar 30, 2020

This PR was modified / updated and has become a normal PR. It should be merged the normal way (via @robodoo)

@tde-banana-odoo tde-banana-odoo force-pushed the odoo-dev:master-13.0-fix_survey_chart-pmo-AijC-fw branch from 485980f to a88ca00 Mar 30, 2020
@tde-banana-odoo

This comment has been minimized.

Copy link
Contributor

tde-banana-odoo commented Mar 30, 2020

@robodoo r+ rebase-ff

@robodoo robodoo added the r+ 👌 label Mar 30, 2020
@robodoo

This comment has been minimized.

Copy link
Contributor

robodoo commented Mar 30, 2020

Merge method set to rebase and fast-forward

@madprog

This comment has been minimized.

Copy link
Contributor

madprog commented Mar 30, 2020

@robodoo retry

@robodoo

This comment has been minimized.

Copy link
Contributor

robodoo commented Mar 30, 2020

I'm sorry, @madprog. Retry makes no sense when the PR is not in error.

@tde-banana-odoo tde-banana-odoo force-pushed the odoo-dev:master-13.0-fix_survey_chart-pmo-AijC-fw branch from a88ca00 to 3a069ba Mar 31, 2020
@robodoo robodoo removed the r+ 👌 label Mar 31, 2020
@tde-banana-odoo

This comment has been minimized.

Copy link
Contributor

tde-banana-odoo commented Mar 31, 2020

@robodoo r+ rebase-ff

It was a real issue @madprog I tool the opportunity of adding a small fix to the test to remove some unnecessary context manager (old code) :)

@robodoo robodoo added the r+ 👌 label Mar 31, 2020
@robodoo

This comment has been minimized.

Copy link
Contributor

robodoo commented Mar 31, 2020

Merge method set to rebase and fast-forward

@robodoo robodoo added CI 🤖 and removed CI 🤖 r+ 👌 labels Mar 31, 2020
madprog and others added 3 commits Mar 11, 2020
When a random survey does not use all the questions available in a page
because of the random_questions_count field, _get_answers_correctness
was still including them in the skipped category.

This commit ensures that those questions are not included in the result,
and adds a test that checks it.

closes #47362

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
X-original-commit: 4df4347
Notably

  * have tools and helpers in a SurveyCase and let SurveyCommon bet the
    one with data;
  * remove unnecessary with_user, replaced by standard one;
  * move all tools in SurveyCase to help reusing them;
== Fix results scored question display ==

This commit fixes the display for scored choice question.
The text "Right answer" was displayed twice.

== Add default values to avoid constraints inconsistencies ==

This commit adds a 0 default values to some of our validation fields on survey
questions.

Without a default value, the ORM would store "NULL" in the fields and then
allow users to define a "min" without a "max", that would result in an error
while trying to validate the answers to that question.
Furthermore, when creating a question from the frontend, the web framework will
always send 0 for all field values anyway.

The code change adds consistency and avoids potential errors on that issue.

LINKS

Task 2208574
@tde-banana-odoo tde-banana-odoo force-pushed the odoo-dev:master-13.0-fix_survey_chart-pmo-AijC-fw branch from 6a4bbf3 to 473b2ce Mar 31, 2020
@tde-banana-odoo

This comment has been minimized.

Copy link
Contributor

tde-banana-odoo commented Mar 31, 2020

@robodoo r+ rebase-ff

@robodoo

This comment has been minimized.

Copy link
Contributor

robodoo commented Mar 31, 2020

Merge method set to rebase and fast-forward

robodoo pushed a commit that referenced this pull request Mar 31, 2020
== Fix results scored question display ==

This commit fixes the display for scored choice question.
The text "Right answer" was displayed twice.

== Add default values to avoid constraints inconsistencies ==

This commit adds a 0 default values to some of our validation fields on survey
questions.

Without a default value, the ORM would store "NULL" in the fields and then
allow users to define a "min" without a "max", that would result in an error
while trying to validate the answers to that question.
Furthermore, when creating a question from the frontend, the web framework will
always send 0 for all field values anyway.

The code change adds consistency and avoids potential errors on that issue.

LINKS

Task 2208574

closes #48371

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
@robodoo robodoo closed this Mar 31, 2020
@robodoo robodoo deployed to merge Mar 31, 2020 Active
@madprog madprog deleted the odoo-dev:master-13.0-fix_survey_chart-pmo-AijC-fw branch Apr 1, 2020
edi-odoo added a commit to odoo-dev/odoo that referenced this pull request Apr 1, 2020
== Fix results scored question display ==

This commit fixes the display for scored choice question.
The text "Right answer" was displayed twice.

== Add default values to avoid constraints inconsistencies ==

This commit adds a 0 default values to some of our validation fields on survey
questions.

Without a default value, the ORM would store "NULL" in the fields and then
allow users to define a "min" without a "max", that would result in an error
while trying to validate the answers to that question.
Furthermore, when creating a question from the frontend, the web framework will
always send 0 for all field values anyway.

The code change adds consistency and avoids potential errors on that issue.

LINKS

Task 2208574

closes odoo#48371

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants
You can’t perform that action at this time.