-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsurvey.qmd
More file actions
247 lines (209 loc) · 5.44 KB
/
survey.qmd
File metadata and controls
247 lines (209 loc) · 5.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
---
# The YAML header specifies several settings for the survey but is not required.
# A full list of settings can be found under _survey/settings.yml directory.
theme-settings:
theme: default
barposition: top
footer-left: "Made with [surveydown](https://surveydown.org)"
footer-right: '[<i class="bi bi-github"></i> Source Code](https://github.com/surveydown-dev/template_option_shuffling)'
survey-settings:
show-previous: false
use-cookies: false
auto-scroll: false
rate-survey: false
system-language: en
highlight-unanswered: true
highlight-color: blue
capture-metadata: true
all-shuffled: false
shuffled:
- fruit_mc
- fruit_mc_buttons
- fruit_mc_multiple
- fruit_mc_multiple_buttons
- fruit_mc_buttons_1: [1-4]
- fruit_mc_buttons_2: [4-7]
- fruit_mc_buttons_3: [1, 3, 7]
---
```{r}
library(surveydown)
```
--- welcome
# Template - Option Shuffling
Hi! This is a showcase of option shuffling that can be applied to multiple choice questions in `{surveydown}`.
The supported question types include:
- `mc`
- `mc_buttons`
- `mc_multiple`
- `mc_multiple_buttons`
--- education
# Usage
To define option shuffling for all questions, set `all-shuffled: true` in the `survey-settings` section of the YAML header, like this:
```yaml
survey-settings:
...
all-shuffled: true
```
To specify option shuffling for selected questions only, set `shuffled` in the `survey-settings` section of the YAML header, like this:
```yaml
survey-settings:
...
shuffled:
- question_id_1
- question_id_2
```
Option shuffling can be precisely defined to selected indices, like this:
```yaml
survey-settings:
...
shuffled:
- question_id_1: [1, 2, 4, 7]
- question_id_2: [1-5, 8-10]
```
In the above example, `question_id_1` will have options at indices 1, 2, 4, and 7 shuffled, while `question_id_2` will have options at indices 1 to 5 and 8 to 10 shuffled. If no indices are specified, all options will be shuffled.
--- question_types
This page demonstrates option shuffling in all 4 multiple choice question types.
#### Option shuffling in `type = 'mc'`:
```{r}
sd_question(
id = 'fruit_mc',
type = 'mc',
label = "Which fruit do you prefer most from this list?",
option = c(
"Apple" = "apple",
"Banana" = "banana",
"Pear" = "pear",
"Strawberry" = "strawberry",
"Grape" = "grape",
"Mango" = "mango",
"Watermelon" = "watermelon"
)
)
```
#### Option shuffling in `type = 'mc_buttons'`:
```{r}
sd_question(
id = 'fruit_mc_buttons',
type = 'mc_buttons',
label = "Which fruit do you prefer most from this list?",
option = c(
"Apple" = "apple",
"Banana" = "banana",
"Pear" = "pear",
"Strawberry" = "strawberry",
"Grape" = "grape",
"Mango" = "mango",
"Watermelon" = "watermelon"
)
)
```
#### Option shuffling in `type = 'mc_multiple'`:
```{r}
sd_question(
id = 'fruit_mc_multiple',
type = 'mc_multiple',
label = "Pick all your favorite fruits from this list:",
option = c(
"Apple" = "apple",
"Banana" = "banana",
"Pear" = "pear",
"Strawberry" = "strawberry",
"Grape" = "grape",
"Mango" = "mango",
"Watermelon" = "watermelon"
)
)
```
#### Option shuffling in `type = 'mc_multiple_buttons'`:
```{r}
sd_question(
id = 'fruit_mc_multiple_buttons',
type = 'mc_multiple_buttons',
label = "Pick all your favorite fruits from this list:",
option = c(
"Apple" = "apple",
"Banana" = "banana",
"Pear" = "pear",
"Strawberry" = "strawberry",
"Grape" = "grape",
"Mango" = "mango",
"Watermelon" = "watermelon"
)
)
```
--- indices
# Shuffling with Specified Indices
This page demonstrates option shuffling with specified indices using the `mc_buttons` question type.
#### No options shuffled:
```{r}
sd_question(
id = 'fruit_mc_buttons_0',
type = 'mc_buttons',
label = "Which fruit do you prefer most from this list?",
option = c(
"Apple" = "apple",
"Banana" = "banana",
"Pear" = "pear",
"Strawberry" = "strawberry",
"Grape" = "grape",
"Mango" = "mango",
"Watermelon" = "watermelon"
)
)
```
#### Options 1-4 shuffled:
```{r}
sd_question(
id = 'fruit_mc_buttons_1',
type = 'mc_buttons',
label = "Which fruit do you prefer most from this list?",
option = c(
"Apple" = "apple",
"Banana" = "banana",
"Pear" = "pear",
"Strawberry" = "strawberry",
"Grape" = "grape",
"Mango" = "mango",
"Watermelon" = "watermelon"
)
)
```
#### Options 4-7 shuffled:
```{r}
sd_question(
id = 'fruit_mc_buttons_2',
type = 'mc_buttons',
label = "Which fruit do you prefer most from this list?",
option = c(
"Apple" = "apple",
"Banana" = "banana",
"Pear" = "pear",
"Strawberry" = "strawberry",
"Grape" = "grape",
"Mango" = "mango",
"Watermelon" = "watermelon"
)
)
```
#### Options 1, 3, 7 shuffled:
```{r}
sd_question(
id = 'fruit_mc_buttons_3',
type = 'mc_buttons',
label = "Which fruit do you prefer most from this list?",
option = c(
"Apple" = "apple",
"Banana" = "banana",
"Pear" = "pear",
"Strawberry" = "strawberry",
"Grape" = "grape",
"Mango" = "mango",
"Watermelon" = "watermelon"
)
)
```
--- end
## Thanks for taking our survey!
```{r}
sd_close()
```