Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a nested conditional test #29

Merged
merged 5 commits into from
Aug 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion DemoProtocol/DemoProtocol_schema
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@
{"isAbout": "../activities/voiceActivity/voiceActivity_schema",
"variableName": "voiceActivity_schema",
"prefLabel": {"en": "Voice Activity" }
},
{"isAbout": "../activities/responsesReferenceActivity/responsesReferenceActivity_schema",
"variableName": "responsesReferenceActivity_schema",
"prefLabel": {"en": "Global Responses Reference Activity" }
}
],
"order": [
Expand All @@ -53,7 +57,8 @@
"../activities/Activity3/Activity3_schema",
"../activities/selectActivity/selectActivity_schema",
"../activities/voiceActivity/voiceActivity_schema",
"../activities/Activity4/Activity4_schema"
"../activities/Activity4/Activity4_schema",
"../activities/responsesReferenceActivity/responsesReferenceActivity_schema"
],
"shuffle": false,
"allow": [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0/contexts/reproschema",
"@type": "reproschema:Activity",
"@id": "conditionalRefereeActivity_schema",
"prefLabel": "Single Radio Button Activity",
"description": "Contains a single radio button item.",
"preamble": "Respond to this activity so that the conditional referer activity has a non-null value to reference.",
"schemaVersion": "1.0.0",
"version": "0.0.1",
"ui": {
"addProperties": [
{"isAbout": "../../selectActivity/items/radio_item",
"variableName": "radio_item",
"isVis": true
}
],
"order": [
"../../selectActivity/items/radio_item"
],
"shuffle": false,
"allow": [
"reproschema:AutoAdvance",
"reproschema:AllowExport"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0/contexts/reproschema",
"@type": "reproschema:Activity",
"@id": "conditionalRefererActivity_schema",
"prefLabel": "Sibling Reference Activity",
"description": "Demos conditional visibility by referring to the global responses variable that stores all responses.",
"preamble": "If you selected Response option 1 in the first question, you should see an email question. Otherwise, you should see a text entry question. If you see both or neither, something is broken.",
"schemaVersion": "1.0.0",
"version": "0.0.1",
"ui": {
"addProperties": [
{"isAbout": "../../Activity3/items/email_item",
"variableName": "email_item",
"isVis": "[0].includes(referee.radio_item)",
"allow": [
"reproschema:Skipped"
]
},
{"isAbout": "../../Activity3/items/text_item",
"variableName": "text_item",
"isVis": "[1, 2].includes(referee.radio_item)",
"allow": [
"reproschema:Skipped"
]
}
],
"order": [
"../../Activity3/items/email_item",
"../../Activity3/items/text_item"
],
"shuffle": false,
"allow": [
"reproschema:AutoAdvance",
"reproschema:AllowExport"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0/contexts/reproschema",
"@type": "reproschema:Activity",
"@id": "responseReferenceActivity_schema",
"prefLabel": "Global Responses Reference Activity",
"description": "Demonstrates conditional visibility by referring to the global responses variable that stores all responses.",
"preamble": "Demonstrates conditional visibility by referring to the global responses variable that stores all responses. After answering the first question, the second question will be determined by referring to your first answer in the global responses object.",
"schemaVersion": "1.0.0",
"version": "0.0.1",
"ui": {
"addProperties": [
{"isAbout": "activities/conditionalRefereeActivity_schema",
"variableName": "referee",
"isVis": true
},
{"isAbout": "activities/conditionalRefererActivity_schema",
"variableName": "referer",
"isVis": true
}
],
"order": [
"activities/conditionalRefereeActivity_schema",
"activities/conditionalRefererActivity_schema"
],
"shuffle": false,
"allow": [
"reproschema:AutoAdvance",
"reproschema:AllowExport"
]
}
}