Skip to content

Commit 3acff4d

Browse files
authored
Merge pull request #24 from surveydown-dev/v1.1.0
V1.1.0
2 parents 064751c + b2573ef commit 3acff4d

14 files changed

Lines changed: 582 additions & 98 deletions

_quarto.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ website:
8585

8686
- section: "Interactivity"
8787
contents:
88+
- text: "Accessing Question Values"
89+
href: docs/accessing-values.qmd
8890
- text: "Conditional Logic"
8991
href: docs/conditional-logic.qmd
9092
- text: "Reactivity"
@@ -152,6 +154,8 @@ website:
152154
href: templates/random_options.qmd
153155
- text: "Random Options Predefined"
154156
href: templates/random_options_predefined.qmd
157+
- text: "Option Shuffling"
158+
href: templates/option_shuffling.qmd
155159

156160
- section: "Reactivity"
157161
contents:

blog/2025-11-21-announcing-surveydown-version-1/index.qmd

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@ survey-settings:
6666
use-cookies: no
6767
auto-scroll: no
6868
rate-survey: no
69-
all-questions-required: no
69+
all-required: no
7070
start-page: your_first_page
7171
system-language: en
7272
highlight-unanswered: yes
7373
highlight-color: gray
7474
capture-metadata: yes
75-
required-questions: []
75+
required: []
7676

7777
system-messages:
7878
cancel: Cancel
@@ -245,6 +245,10 @@ In this case, the value stored in the data will be automatically converted to sn
245245
| Dark Green | `dark_green` |
246246
| Bright Red | `bright_red` |
247247

248+
::: {.callout-caution}
249+
This snake case conversion is **removed** after `v1.1.0`, in which if you provide a single vector of labels, the values stored in the database will be exactly the same as the labels shown to respondents.
250+
:::
251+
248252
## What's Next?
249253

250254
This `v1.0.0` release marks a major milestone for `surveydown`, but we're not stopping here. We have exciting features planned for future releases. Stay tuned!

chunks/sdvalue.qmd

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
::: {.callout-note}
2+
3+
The `sd_value()` function returns the chosen value or values for one or more questions. It is a reactive function and can only be used inside the `server()` function in your **app.R** file.
4+
5+
See the [Accessing Question Values](accessing-values.qmd) page for details on how to use `sd_value()`.
6+
7+
:::

chunks/skip-if.qmd

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
While basic page navigation is handled using `sd_nav()`, you can override this static navigation in your server function with the `sd_skip_if()` function to send the respondent to a forward page based on some condition.
1+
While basic page navigation is handled automatically (or with the `sd_nav()` function for more fine-tuned control), you can override this static navigation in your server function with the `sd_skip_if()` function to send the respondent to a forward page based on some condition.
22

33
A common example is the need to **screen out** people based on their response(s) to a question. Let's say you need to screen out people who do not own a vehicle. To do this, you would first define a question in your **survey.qmd** file about their vehicle ownership, e.g.:
44

@@ -26,17 +26,11 @@ Sorry, but you are not qualified to take our survey.
2626

2727
Then in the server function in the **app.R** file, you can use the `sd_skip_if()` function to define the condition under which the respondent will be sent to the target `screenout` page, like this:
2828

29-
::: {.callout-note}
30-
31-
The `input` object is a Shiny object that stores each question `id` defined by `sd_question()` in your **survey.qmd** file, so whenever referring to a question in a condition, you must use the format `input$question_id`.
32-
33-
:::
34-
3529
```{r}
3630
server <- function(input, output, session) {
3731
3832
sd_skip_if(
39-
input$vehicle_ownership == "no" ~ "screenout"
33+
sd_value("vehicle_ownership") == "no" ~ "screenout"
4034
)
4135
4236
# ...other server code...
@@ -48,6 +42,6 @@ You can provide multiple conditions to the `sd_skip_if()` function, each separat
4842

4943
> `<condition> ~ "target_page_id"`
5044
51-
In the example above, `input$vehicle_ownership == "no"` is the condition, and `"screenout"` is the target page that the respondent will be sent to if the condition is met.
45+
In the example above, `sd_value("vehicle_ownership") == "no"` is the condition, and `"screenout"` is the target page that the respondent will be sent to if the condition is met.
5246

5347
Take a look at the [Common Conditions](conditional-logic.html#common-conditions) section for examples of other types of supported conditions you can use to conditionally control the survey flow.

0 commit comments

Comments
 (0)