Skip to content

Commit cd88a3b

Browse files
committed
change options for slider
1 parent 513f887 commit cd88a3b

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

reproschema/redcap2reproschema.py

+10-3
Original file line numberDiff line numberDiff line change
@@ -308,9 +308,16 @@ def process_row(
308308
and value
309309
and input_type in ["radio", "select", "slider"]
310310
):
311-
choices, choices_val_type_l = process_choices(
312-
value, field_name=field["Variable / Field Name"]
313-
)
311+
if input_type == "slider":
312+
# Create a list of 101 choices (0 to 100)
313+
choices = [
314+
{"name": {"en": " "}, "value": i} for i in range(101)
315+
]
316+
choices_val_type_l = ["xsd:integer"]
317+
else:
318+
choices, choices_val_type_l = process_choices(
319+
value, field_name=field["Variable / Field Name"]
320+
)
314321
rowData["responseOptions"].update(
315322
{
316323
"choices": choices,

0 commit comments

Comments
 (0)