construct_displaylogic: Construct a controller for display logic

Description Usage Arguments Details See Also Examples

View source: R/construct_displaylogic.R

Description

Helper function to construct conditions when a question is displayed.

Usage

1

Arguments

...

key-value tuple (see below)

Details

Each condition comes as a tuple. The first condition takes the key "0" and all subsequent conditions are numbered. The value is a named list with the following elements: qid (QuestionID), operator ("Selected", "NotSelected"), choice_id. If there is more than one condition, all tuples other than that with key="0" must also include the parameter conjuction with the value "OR" or "AND".

See Also

update_question

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
data(svy_qsf)

# Display question "born" only 
# when respondent selected 1 or 2 
# for the first question 

qsf_mod <- update_question(svy_qsf, 
 id_name='SecondaryAttribute', 
 id='born', 
 DisplayLogic=construct_displaylogic( 
    `0`=list(qid="Q1", operator="Selected", choice_id="1"), 
    `1`=list(qid="Q1", operator="Selected", choice_id="2", conjuction='Or'))
 )

sumtxt/qsf documentation built on Nov. 22, 2021, 9:31 p.m.