Skip to content

Conditional questions: branches on short and long text - #3838

Closed
AndyScherzinger wants to merge 1 commit into
feat/conditional-questions-5-scale-colorfrom
feat/conditional-questions-6-text
Closed

AndyScherzinger wants to merge 1 commit into
feat/conditional-questions-5-scale-colorfrom
feat/conditional-questions-6-text

Conversation

@AndyScherzinger

@AndyScherzinger AndyScherzinger commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

Part 6 of the conditional questions stack from #3123 (by Micke Nordin, with fixes by TimedIn and the review fixes). Based on #3837; the "Files changed" tab shows only this part.

Stack

  1. Conditional questions: base with radio and dropdown questions #3833 Conditional questions: base with radio and dropdown questions
  2. Conditional questions: branches on checkboxes #3834 Conditional questions: branches on checkboxes
  3. Conditional questions: branches on date and time #3835 Conditional questions: branches on date and time
  4. Conditional questions: branches on file upload #3836 Conditional questions: branches on file upload
  5. Conditional questions: branches on linear scale and color #3837 Conditional questions: branches on linear scale and color
  6. Conditional questions: branches on short and long text #3838 Conditional questions: branches on short and long text ← this PR

This PR

A text question shows a branch when the answer equals (short text only) or contains a text, or matches a regular expression.

  • regular expressions use the same /pattern/modifiers format as validationRegex, are checked when saving, and an invalid one is not saved by the editor;
  • matching is limited in subject length and backtracking, on the server and in the browser;
  • docs and tests.

Tests

  • Unit tests: 652, all passing except the 15 IUserFolder errors main has as well.
  • php-cs-fixer, psalm, eslint, vue-tsc (no new errors) and the build are clean.

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@codecov

codecov Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 64.51613% with 11 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
lib/Service/SubmissionService.php 62.06% 11 Missing ⚠️

📢 Thoughts on this report? Let us know!

@AndyScherzinger
AndyScherzinger force-pushed the feat/conditional-questions-5-scale-color branch from 624a98f to 5734f04 Compare November 4, 2026 14:07
@AndyScherzinger
AndyScherzinger force-pushed the feat/conditional-questions-6-text branch from b122f6a to 448bc3a Compare November 4, 2026 14:07
@AndyScherzinger
AndyScherzinger force-pushed the feat/conditional-questions-5-scale-color branch from 5734f04 to 6e7c64d Compare November 4, 2026 14:20
@AndyScherzinger
AndyScherzinger force-pushed the feat/conditional-questions-6-text branch from 448bc3a to 429d1d7 Compare November 4, 2026 14:20
@AndyScherzinger
AndyScherzinger force-pushed the feat/conditional-questions-5-scale-color branch from 6e7c64d to 7124f48 Compare November 4, 2026 16:51
@AndyScherzinger
AndyScherzinger force-pushed the feat/conditional-questions-6-text branch from 429d1d7 to ecbc30e Compare November 4, 2026 16:51
@AndyScherzinger
AndyScherzinger force-pushed the feat/conditional-questions-5-scale-color branch from 7124f48 to bdd436e Compare November 5, 2026 11:10
@AndyScherzinger
AndyScherzinger force-pushed the feat/conditional-questions-6-text branch 2 times, most recently from 7ca8511 to de1d635 Compare November 7, 2026 15:29
@AndyScherzinger
AndyScherzinger force-pushed the feat/conditional-questions-5-scale-color branch from bdd436e to 8e890c3 Compare November 7, 2026 15:29
@AndyScherzinger AndyScherzinger changed the title Conditional questions: short and long text as trigger Conditional questions: branches on short and long text Nov 7, 2026
@AndyScherzinger
AndyScherzinger force-pushed the feat/conditional-questions-5-scale-color branch from 8e890c3 to 97c9416 Compare November 7, 2026 15:41
@AndyScherzinger
AndyScherzinger force-pushed the feat/conditional-questions-6-text branch 2 times, most recently from 6788601 to 5ac82c2 Compare November 7, 2026 17:59
@AndyScherzinger
AndyScherzinger force-pushed the feat/conditional-questions-5-scale-color branch 2 times, most recently from d00994a to b64e46f Compare November 8, 2026 18:03
@AndyScherzinger
AndyScherzinger force-pushed the feat/conditional-questions-6-text branch from 5ac82c2 to 01fd965 Compare November 8, 2026 18:03
A text question opens a branch when the answer equals (short text only)
or contains a text, or matches a regular expression. Regular
expressions use the same /pattern/modifiers format as validationRegex,
are checked when saving, and an invalid one is not saved by the
editor. Matching is limited in subject length and backtracking.

The code comes from the original pull request #3123 by Micke Nordin
and TimedIn, with the review fixes applied.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
@AndyScherzinger
AndyScherzinger force-pushed the feat/conditional-questions-6-text branch from 01fd965 to c02d29e Compare November 9, 2026 11:40
@AndyScherzinger
AndyScherzinger force-pushed the feat/conditional-questions-5-scale-color branch from b64e46f to 6122c00 Compare November 9, 2026 11:40
@AndyScherzinger
AndyScherzinger marked this pull request as draft November 9, 2026 21:38
@AndyScherzinger AndyScherzinger added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Nov 9, 2026
@AndyScherzinger

Copy link
Copy Markdown
Member Author

Closing this one: follow-up questions triggered by short and long text answers (equals, contains, regex) are dropped from the stack, see #3833 (comment) for the reasons. Text questions still work as follow-up questions.

Text conditions are planned to come back later for "show only if" rules on later questions, where they fit better than inline. The branch feat/conditional-questions-6-text stays for reference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2. developing Work in progress enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant