You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Questions within a repeater group have an underscore-row-number attached to their identifier indicating the level of repetition (e.g. q_485 becomes q_485_0 for the first row). When a dependency is attached to a question within a repeater group, satisfaction of the dependency takes the question identifier from the "hide" set in the put request, to the "show" set, but the question identifier does not have the appended row level, so the question does not show.
It looks to me like dependency evaluation doesn't take response_group into account. It seems like we'll need to handle two situations:
When the dependent question is inside the same repeating group as the deciding question, dependencies should be evaluated within the scope of the same response group only.
When the dependent question is inside a repeating group but the deciding question is not, the dependencies should be evaluated for all response groups.
(For the third and fourth possibilities — a deciding question inside a repeating group with the dependent question outside or in a different repeater — I don't know what the proper behavior would be, so I'm in favor of leaving it undefined.)
q_CIG_NOW_NUM "On days that you smoke, how many cigarettes do you smoke per day? If you smoke 1 cigarette or
less each day, please enter \"1.\"",
:pick => :one
a_number "NUMBER PER DAY", :integer
a_neg_1 "REFUSED"
a_neg_2 "DON’T KNOW"
repeater "Tell us about the cars you own" do
dependency :rule => "A"
condition_A :q_CIG_NOW_NUM, ">", {:integer_value => "60"}
q "Make", :pick => :one, :display_type => :dropdown
a "Toyota"
a "Ford"
a "GMChevy"
a "Ferrari"
a "Tesla"
a "Honda"
a "Other weak brand"
q_model "Model",
:pick => :one
a_1 "Small"
a_2 "Medium"
a_3 "Large"
q "Year"
dependency :rule => "A"
condition_A :q_model, "==", :a_2
a :string
end
Questions within a repeater group have an underscore-row-number attached to their identifier indicating the level of repetition (e.g. q_485 becomes q_485_0 for the first row). When a dependency is attached to a question within a repeater group, satisfaction of the dependency takes the question identifier from the "hide" set in the put request, to the "show" set, but the question identifier does not have the appended row level, so the question does not show.
For example:
SURVEYOR CODE:
repeater do
q_initial_question "Independent question",
:pick => :one
a_1 "Yes"
a_2 "No"
a_5 "Other"
q_following_question "dependent question",
:pick => ::one
a_1 "Yes"
a_2 "No"
dependency :rule => "A"
condition_A :q_initial_question, "==", :a_5
end
BROWSER:
q_initial_question ID = q_485_0
q_following_question ID = q_486_0
Action:
Select "a_1" from "q_initial_question"
Console => PUT - {"show":["q_485"],"hide":["q_486"]}
STATUS - q_following_question is appropriately hidden
Select "a_5" from "q_initial_question"
Console => PUT - {"show":["q_485", "q_486"],"hide":[]}
STATUS - q_following_question is still hidden, even though dependency is satisfied
The text was updated successfully, but these errors were encountered: