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

CARDS-2571: Reference Questions do not work inside Conditional Sections #1802

Open
wants to merge 2 commits into
base: CARDS-2509
Choose a base branch
from

Conversation

acrowthe
Copy link
Contributor

  • Update reference question initialization code to check for unlinked reference questions any time a form is edited, not just when a form is created
    • Search for any reference questions on the form that do not have an answer
    • Check if the missing questions have an existing answer section. If so, generate an answer
    • Try to find a source answer for any existing or newly created unanswered reference answers
      • Prioritize pulling source answers from forms that are already referenced by other reference answers in this form for consistency
  • Add test case in ReferenceTestCopied form

To test:

  1. Launch with test forms
  2. Generate a couple instances of ReferenceTestUser forms with the last form having unique text answers
  3. Generate a ReferenceTestCopied form.
    a. Make sure the referenced text answers are from the most recent User form
    b. Do not fill out the Should the conditional section be satisfied answer
  4. Generate at least 1 more instance of ReferenceTestUser forms with different text answers
  5. Edit the existing ReferenceTestCopied form and set Should the conditional section be satisfied to true
  6. Save and close the form
  7. Open the Copied form in view mode. Ensure the last section is present and contains the unique text answer from step 2.

Previous (incorrect) behaviour:

  • In step 7 the last section would be present but would never contain an answer

- Update reference question initialization code to check for unlinked reference questions
  any time a form is edited, not just when a form is created
  - Search for any reference questions on the form that do not have an answer
  - Check if the missing questions have an existing answer section. If so, generate an answer
  - Try to find a source answer for any existing or newly created unanswered reference answers
    - Prioritize pulling source answers from forms that are already referenced by other
      reference answers in this form for consistency
- Add test case in ReferenceTestCopied form
@sashaandjic sashaandjic added the testing... Testing in progress label Aug 28, 2024
@sashaandjic sashaandjic added bug Something isn't working and removed testing... Testing in progress labels Sep 4, 2024
@sashaandjic
Copy link
Contributor

sashaandjic commented Sep 4, 2024

in the step #7, the section does not contain text answer from step #2. It shows the text answer from the step #4.

Fix issue with logic to prioritize sourcing answers from existing forms
@acrowthe
Copy link
Contributor Author

Improved testing steps to check that the right text answer is being copied:

  1. Launch with test forms and bin/browser enabled
  2. Generate a single ReferenceTestUser form with unique text answers.
    a. Take note of this original user form's node name in bin/browser
    image
  3. Generate a ReferenceTestCopied form
    a. Make sure the referenced text answers are from the most recent User form
    b. Do not fill out the Should the conditional section be satisfied answer
    c. Take note of the newly created form's node name. This copied form should be ignored in step 4
    image
  4. Generate at more instance of ReferenceTestUser forms with different text answers until one of the new nodes appears above the original user form in bin/browser. This may take many new forms as the position of new forms is random
    image
  5. Edit the existing ReferenceTestCopied form and set Should the conditional section be satisfied to true
  6. Save and close the form
  7. Open the Copied form in view mode. Ensure the last section is present and contains the unique text answer from step 2.

@acrowthe acrowthe added Test me! Ready for testing and removed bug Something isn't working labels Sep 11, 2024
@sashaandjic sashaandjic added testing... Testing in progress bug Something isn't working and removed Test me! Ready for testing testing... Testing in progress labels Sep 17, 2024
@sashaandjic
Copy link
Contributor

Bug on step 6:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants