Skip to content

Commit

Permalink
Merge pull request #29 from ReproNim/test/conditional
Browse files Browse the repository at this point in the history
Add a nested conditional test
  • Loading branch information
satra authored Aug 31, 2024
2 parents 660717b + 50d2ca4 commit 9e4c068
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 1 deletion.
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"
]
}
}

0 comments on commit 9e4c068

Please sign in to comment.