Skip to content

Study variables tutorial#21

Merged
phev8 merged 9 commits intocase-framework:mainfrom
kschneider84:study-variables
Oct 17, 2025
Merged

Study variables tutorial#21
phev8 merged 9 commits intocase-framework:mainfrom
kschneider84:study-variables

Conversation

@kschneider84
Copy link
Copy Markdown
Contributor

@kschneider84 kschneider84 commented Oct 17, 2025

Summary by CodeRabbit

  • Documentation
    • Clarified and reformatted the Study Variables guide: improved wording, emphasis on UI labels/buttons, standardized steps, and clearer server/client guidance.
    • Expanded Study Rules Editor docs with study-variable operations for boolean, string, integer, float, and date types; added templates, advanced examples, update actions, and in-page anchors for linking.
    • Added Study Variable sections to Survey Editor for participant-condition checks (string equals, key exists, boolean retrieval).

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Oct 17, 2025

Walkthrough

Updated and expanded documentation: wording and formatting edits on the Study Variables page, plus added study-variable get/update entries (boolean, string, integer, float, date) and anchors across Study Rules and Survey Editor conditions pages. No code or behavior changes.

Changes

Cohort / File(s) Summary
Study Variables content
content/docs/study-configurator/study-variables.mdx
Textual and formatting revisions: simplified phrasing, consistent bolding for keys/values/UI labels, clarified step and button guidance, and minor heading/punctuation tweaks.
Study Rules additions
content/docs/study-rules-editor/basics/study-rules.mdx
Added "Study variables" anchors and sections; new get/update operations for boolean, string, integer, float, and date (POSIX) types; added template/advanced entries and anchor IDs for in-page linking; formatting improvements.
Survey Editor conditions
content/docs/survey-editor/basics/conditions.mdx
Inserted study-variable condition entries under Participant flags (string equals, key exists, get-as-boolean), duplicated a later Study variables subsection, and made a minor example formatting tweak.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐇 I hopped through docs with tidy paws,

Bolded keys and clearer laws.
Booleans, strings and dates align,
Integers and floats look fine.
A happy hop — the docs now shine!

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "Study variables tutorial" is partially related to the changeset, which adds and updates documentation for study variables across three documentation files (study configurator, study rules editor, and survey editor). The title clearly references study variables, which is a central aspect of the changes, and conveys that the PR involves documentation or instructional content. While the title is somewhat broad and doesn't specify all the contexts affected (e.g., boolean, string, integer types, various editors) or the specific nature of the changes, it does communicate the general area of change in a way that a teammate scanning history would understand.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ad233fb and aa23302.

📒 Files selected for processing (1)
  • content/docs/study-configurator/study-variables.mdx (5 hunks)
🧰 Additional context used
🪛 LanguageTool
content/docs/study-configurator/study-variables.mdx

[grammar] ~21-~21: There might be a mistake here.
Context: ...hange the study rules or questionnaires. While "participant flags" provide a way ...

(QB_NEW_EN)


[grammar] ~24-~24: There might be a mistake here.
Context: ...tudy), a value and a value type. The value type can be one of the followi...

(QB_NEW_EN)


[grammar] ~127-~127: There might be a mistake here.
Context: ...ch, a datepicker or a text/number input. - To edit the "configuration" of a study v...

(QB_NEW_EN)

🔇 Additional comments (4)
content/docs/study-configurator/study-variables.mdx (4)

21-28: Documentation clarifications improve terminology and emphasis.

The refined wording distinguishes study variables from participant flags more clearly, and bold emphasis on key terms (reference key, value, value type) helps readers identify core concepts. The enumerated type list is concise and informative.


72-72: Step descriptions now emphasize UI elements and purposes clearly.

Bold formatting on UI components (Next, Configuration, Label, Description, Create/Save) and clearer purpose statements ("for improved readability," "for even more context") make the creation wizard easier to follow. The expanded description of type-specific configuration (line 115) with concrete examples is helpful for users unfamiliar with the options.

Also applies to: 92-92, 96-96, 100-100, 111-111, 115-115, 119-119


127-129: Clear separation of editing and deletion workflows.

The refined instructions distinguish between editing values (directly in-list), editing configuration (via menu), and deletion, making the user journey explicit. The three-dot menu reference is concrete and actionable.


138-144: All anchor links verified—no issues found.

The anchor links referenced in study-variables.mdx are correctly implemented in their target files:

  • study-rules.mdx contains all 4 anchors (#study-bool-study-variables, #study-int-study-variables, #study-string-study-variables, #study-update-study-variables)
  • conditions.mdx contains both anchors (#survey-bool-study-variables, #survey-num-study-variables)

The documentation changes are complete and properly coordinated.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
content/docs/study-configurator/study-variables.mdx (1)

22-22: Use a hyphen in "study-specific" for consistency.

Line 22 uses "study specific" without a hyphen; this compound adjective should be hyphenated as "study-specific" for grammatical correctness. This improves consistency with other compound descriptors in the documentation.

Apply this diff to fix the hyphenation:

- While "participant flags" provide a way for individualized logic, study variables provide a simple way to control dynamic "global" (study specific) behavior.
+ While "participant flags" provide a way for individualized logic, study variables provide a simple way to control dynamic "global" (study-specific) behavior.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1767493 and c7b1808.

📒 Files selected for processing (3)
  • content/docs/study-configurator/study-variables.mdx (5 hunks)
  • content/docs/study-rules-editor/basics/study-rules.mdx (5 hunks)
  • content/docs/survey-editor/basics/conditions.mdx (3 hunks)
🧰 Additional context used
🪛 LanguageTool
content/docs/survey-editor/basics/conditions.mdx

[grammar] ~140-~140: There might be a mistake here.
Context: ...ges only if a variable has been defined. Dis...

(QB_NEW_EN)


[grammar] ~330-~330: There might be a mistake here.
Context: ...e value of a study variable as a string. * Use Case: Use to compare or display te...

(QB_NEW_EN)


[grammar] ~341-~341: There might be a mistake here.
Context: ...ogic based on study-level configuration. Dis...

(QB_NEW_EN)


[grammar] ~351-~351: There might be a mistake here.
Context: ... or thresholds involving decimal values. Dis...

(QB_NEW_EN)

content/docs/study-rules-editor/basics/study-rules.mdx

[grammar] ~83-~83: There might be a mistake here.
Context: ... eligibility, or activating study flows. * How it works: Provide the variable key...

(QB_NEW_EN)


[grammar] ~88-~88: There might be a mistake here.
Context: ...dy phases, or other string-based values. * How it works: Provide the variable key...

(QB_NEW_EN)


[grammar] ~95-~95: There might be a mistake here.
Context: ...de has been assigned to the participant. * Use case: Use when actions should only...

(QB_NEW_EN)


[grammar] ~103-~103: There might be a mistake here.
Context: ...dy phases, or other string-based values. * How it works: Provide the variable key...

(QB_NEW_EN)


[grammar] ~109-~109: There might be a mistake here.
Context: ...onse includes one of the specified keys. * Use case: Use when multiple acceptable...

(QB_NEW_EN)


[grammar] ~116-~116: There might be a mistake here.
Context: ... certain answers should be filtered out. * How it works: Provide the item key and...

(QB_NEW_EN)


[grammar] ~128-~128: There might be a mistake here.
Context: ...ecise matching of responses is required. * How it works: Provide the item and slo...

(QB_NEW_EN)


[grammar] ~133-~133: There might be a mistake here.
Context: ...er surveys meet the specified condition. * Use case: Use when rules should evalua...

(QB_NEW_EN)


[grammar] ~134-~134: There might be a mistake here.
Context: ...for example to detect repeated patterns. * How it works: The condition checks sto...

(QB_NEW_EN)


[grammar] ~139-~139: There might be a mistake here.
Context: ...if the participant has provided consent. * Use case: Use when study actions must ...

(QB_NEW_EN)


[grammar] ~280-~280: There might be a mistake here.
Context: ...it counts, thresholds, or scoring logic. * How it works: Provide the variable key...

(QB_NEW_EN)


[grammar] ~285-~285: There might be a mistake here.
Context: ... such as weight, dosage, or percentages. * How it works: Provide the variable key...

(QB_NEW_EN)


[grammar] ~446-~446: There might be a mistake here.
Context: ...tudy flow, or other string-based values. * How it works: Provide the variable key...

(QB_NEW_EN)


[grammar] ~584-~584: There might be a mistake here.
Context: ...hold of maximal participants is reached. * How it works: Select the variable key ...

(QB_NEW_EN)


[grammar] ~589-~589: There might be a mistake here.
Context: ... a threshold of participants is reached. * How it works: Select the variable key ...

(QB_NEW_EN)


[grammar] ~594-~594: There might be a mistake here.
Context: ...holds for triggering study-wide actions. * How it works: Select the variable key ...

(QB_NEW_EN)


[grammar] ~598-~598: There might be a mistake here.
Context: ... a study variable with a decimal number. * Use Case: Use to track study-wide calc...

(QB_NEW_EN)


[grammar] ~604-~604: There might be a mistake here.
Context: ...efined participant threshold is reached. * How it works: Select the variable key ...

(QB_NEW_EN)

content/docs/study-configurator/study-variables.mdx

[grammar] ~21-~21: There might be a mistake here.
Context: ...hange the study rules or questionnaires. While "participant flags" provide a way ...

(QB_NEW_EN)


[grammar] ~22-~22: Use a hyphen to join words.
Context: ...e way to control dynamic “global” (study specific) behavior. A study variable ha...

(QB_NEW_EN_HYPHEN)


[grammar] ~24-~24: There might be a mistake here.
Context: ...tudy), a value and a value type. The value type can be one of the followi...

(QB_NEW_EN)


[grammar] ~127-~127: There might be a mistake here.
Context: ...ch, a datepicker or a text/number input. - To edit the "configuration" of a study v...

(QB_NEW_EN)

🔇 Additional comments (7)
content/docs/survey-editor/basics/conditions.mdx (2)

122-155: Study variables section in boolean/key checks is well-structured.

The new "Study variables" section (lines 122–155) introduces three conditions: Study variable string equals, Study variable key exists, and Get study variable as boolean. The structure, examples, and descriptions are clear and consistent with surrounding sections.


325-365: Anchor naming is consistent and intentional—no action needed.

The script results confirm that anchor naming follows a deliberate, consistent pattern:

  • survey-editor/basics/conditions.mdx uses survey-*-study-variables prefix for all anchors
  • study-rules-editor/basics/study-rules.mdx uses study-*-study-variables prefix for all anchors

The distinction aligns with the documentation's purpose: survey-prefixed anchors document client-side survey conditions, while study-prefixed anchors document server-side study rules configuration. No naming conflicts or inconsistencies exist between the two files.

content/docs/study-rules-editor/basics/study-rules.mdx (4)

78-90: New study variables section in Logical Expressions is well-positioned.

The addition of the "Study variables" section with Get study variable as boolean and Study variable string equals is appropriately placed after "Event Properties" and before "Advanced." The structure and descriptions are clear and follow the established documentation pattern.


275-291: Study variables section for numeric/date types is comprehensive.

The addition of three subsections—Get study variable as integer, Get study variable as float, and Get study variable as date (POSIX seconds)—provides complete coverage of numeric and temporal study variable operations. Each entry follows the established pattern with clear use cases and implementation guidance.


441-447: New string study variables section is consistent with numeric/date sections.

The introduction of Get study variable as string (lines 441–447) completes the type coverage (boolean, integer, float, date, string) for study variable operations. The structure and description align with previous sections and maintain consistent formatting.


581-605: Update study variables section comprehensively covers all types.

The new "General Study Actions" subsection (lines 581–605) introduces five Update study variable actions for boolean, string, integer, float, and date types. This provides complete coverage for modifying study variables of any supported type. The descriptions, use cases, and implementation guidance are clear and follow established patterns.

content/docs/study-configurator/study-variables.mdx (1)

140-141: All anchor links are properly defined.

The four anchor IDs referenced in lines 140–141 of study-variables.mdx are correctly defined in study-rules.mdx:

  • #study-bool-study-variables (line 78)
  • #study-int-study-variables (line 275)
  • #study-string-study-variables (line 441)
  • #study-update-study-variables (line 581)

No issues found. The documentation links are valid.

Comment thread content/docs/study-rules-editor/basics/study-rules.mdx Outdated
@phev8 phev8 merged commit 02b82dd into case-framework:main Oct 17, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants