Skip to content

Commit 9e4c068

Browse files
authored
Merge pull request #29 from ReproNim/test/conditional
Add a nested conditional test
2 parents 660717b + 50d2ca4 commit 9e4c068

File tree

4 files changed

+100
-1
lines changed

4 files changed

+100
-1
lines changed

DemoProtocol/DemoProtocol_schema

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@
4545
{"isAbout": "../activities/voiceActivity/voiceActivity_schema",
4646
"variableName": "voiceActivity_schema",
4747
"prefLabel": {"en": "Voice Activity" }
48+
},
49+
{"isAbout": "../activities/responsesReferenceActivity/responsesReferenceActivity_schema",
50+
"variableName": "responsesReferenceActivity_schema",
51+
"prefLabel": {"en": "Global Responses Reference Activity" }
4852
}
4953
],
5054
"order": [
@@ -53,7 +57,8 @@
5357
"../activities/Activity3/Activity3_schema",
5458
"../activities/selectActivity/selectActivity_schema",
5559
"../activities/voiceActivity/voiceActivity_schema",
56-
"../activities/Activity4/Activity4_schema"
60+
"../activities/Activity4/Activity4_schema",
61+
"../activities/responsesReferenceActivity/responsesReferenceActivity_schema"
5762
],
5863
"shuffle": false,
5964
"allow": [
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0/contexts/reproschema",
3+
"@type": "reproschema:Activity",
4+
"@id": "conditionalRefereeActivity_schema",
5+
"prefLabel": "Single Radio Button Activity",
6+
"description": "Contains a single radio button item.",
7+
"preamble": "Respond to this activity so that the conditional referer activity has a non-null value to reference.",
8+
"schemaVersion": "1.0.0",
9+
"version": "0.0.1",
10+
"ui": {
11+
"addProperties": [
12+
{"isAbout": "../../selectActivity/items/radio_item",
13+
"variableName": "radio_item",
14+
"isVis": true
15+
}
16+
],
17+
"order": [
18+
"../../selectActivity/items/radio_item"
19+
],
20+
"shuffle": false,
21+
"allow": [
22+
"reproschema:AutoAdvance",
23+
"reproschema:AllowExport"
24+
]
25+
}
26+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0/contexts/reproschema",
3+
"@type": "reproschema:Activity",
4+
"@id": "conditionalRefererActivity_schema",
5+
"prefLabel": "Sibling Reference Activity",
6+
"description": "Demos conditional visibility by referring to the global responses variable that stores all responses.",
7+
"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.",
8+
"schemaVersion": "1.0.0",
9+
"version": "0.0.1",
10+
"ui": {
11+
"addProperties": [
12+
{"isAbout": "../../Activity3/items/email_item",
13+
"variableName": "email_item",
14+
"isVis": "[0].includes(referee.radio_item)",
15+
"allow": [
16+
"reproschema:Skipped"
17+
]
18+
},
19+
{"isAbout": "../../Activity3/items/text_item",
20+
"variableName": "text_item",
21+
"isVis": "[1, 2].includes(referee.radio_item)",
22+
"allow": [
23+
"reproschema:Skipped"
24+
]
25+
}
26+
],
27+
"order": [
28+
"../../Activity3/items/email_item",
29+
"../../Activity3/items/text_item"
30+
],
31+
"shuffle": false,
32+
"allow": [
33+
"reproschema:AutoAdvance",
34+
"reproschema:AllowExport"
35+
]
36+
}
37+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0/contexts/reproschema",
3+
"@type": "reproschema:Activity",
4+
"@id": "responseReferenceActivity_schema",
5+
"prefLabel": "Global Responses Reference Activity",
6+
"description": "Demonstrates conditional visibility by referring to the global responses variable that stores all responses.",
7+
"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.",
8+
"schemaVersion": "1.0.0",
9+
"version": "0.0.1",
10+
"ui": {
11+
"addProperties": [
12+
{"isAbout": "activities/conditionalRefereeActivity_schema",
13+
"variableName": "referee",
14+
"isVis": true
15+
},
16+
{"isAbout": "activities/conditionalRefererActivity_schema",
17+
"variableName": "referer",
18+
"isVis": true
19+
}
20+
],
21+
"order": [
22+
"activities/conditionalRefereeActivity_schema",
23+
"activities/conditionalRefererActivity_schema"
24+
],
25+
"shuffle": false,
26+
"allow": [
27+
"reproschema:AutoAdvance",
28+
"reproschema:AllowExport"
29+
]
30+
}
31+
}

0 commit comments

Comments
 (0)