Skip to content

Commit

Permalink
get unique order
Browse files Browse the repository at this point in the history
  • Loading branch information
yibeichan committed Jan 19, 2024
1 parent 37853b2 commit 1533f11
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion reproschema/redcap2reproschema.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,10 @@ def create_form_schema(
matrix_list,
scores_list,
):

# Use a set to track unique items and preserve order
unique_order = list(dict.fromkeys(order.get(form_name, [])))

# Construct the JSON-LD structure
json_ld = {
"@context": schema_context_url,
Expand All @@ -258,7 +262,7 @@ def create_form_schema(
"schemaVersion": "1.0.0-rc4",
"version": "0.0.1",
"ui": {
"order": order.get(form_name, []),
"order": unique_order,
"addProperties": bl_list,
"shuffle": False,
},
Expand Down

0 comments on commit 1533f11

Please sign in to comment.