library(surveyDesigner)

r6_referential

The filtering of the referential should take in account the order/sequence of questions and modules.

A specific method is implemented to separate our file with begin and end group

ref <- Referential$new(
  path = system.file("SurveyDesigner_Referential.xlsx", package = "surveyDesigner") 
)
#> New names:
#> result is store in `by_groups` sub-element
#>  `` -> `...14`

head(ref$data$survey)
#> # A tibble: 6 × 33
#>   referential_id   type   name  label hint  required required_message constraint
#>   <chr>            <chr>  <chr> <chr> <chr> <chr>    <lgl>            <chr>     
#> 1 household_survey start  start NA    NA    NA       NA               NA        
#> 2 household_survey end    end   NA    NA    NA       NA               NA        
#> 3 household_survey calcu… star… NA    NA    NA       NA               NA        
#> 4 household_survey calcu… end_t NA    NA    NA       NA               NA        
#> 5 household_survey calcu… time… Time… NA    NA       NA               NA        
#> 6 household_survey calcu… time… Time… NA    NA       NA               NA        
#> # ℹ 25 more variables: constraint_message <chr>, relevant <chr>,
#> #   appearance <chr>, calculation <chr>, trigger <lgl>, parameters <lgl>,
#> #   repeat_count <chr>, default <lgl>, read_only <lgl>, choice_filter <chr>,
#> #   `media::image` <lgl>, `$given_name` <chr>, contextualize <lgl>,
#> #   contextualize_instruction <lgl>, block <lgl>, block_sequence <lgl>,
#> #   sequence <lgl>, mode <chr>, check <lgl>, accuracy <lgl>, chapter <lgl>,
#> #   subchapter <lgl>, labelReport <lgl>, hintReport <lgl>, keyword <lgl>

# Example by groups
ref$by_groups$group_intro
#> $data
#> # A tibble: 6 × 33
#>   referential_id   type   name  label hint  required required_message constraint
#>   <chr>            <chr>  <chr> <chr> <chr> <chr>    <lgl>            <chr>     
#> 1 household_survey date   inte… Plea… NA    false    NA               NA        
#> 2 household_survey selec… Bure… Plea… Read… true     NA               NA        
#> 3 household_survey selec… Coun… Plea… Read… true     NA               NA        
#> 4 household_survey calcu… coun… NA    NA    false    NA               NA        
#> 5 household_survey geopo… geop… Reco… NA    false    NA               NA        
#> 6 household_survey selec… pop_… Plea… Read… true     NA               NA        
#> # ℹ 25 more variables: constraint_message <chr>, relevant <chr>,
#> #   appearance <chr>, calculation <chr>, trigger <lgl>, parameters <lgl>,
#> #   repeat_count <chr>, default <lgl>, read_only <lgl>, choice_filter <chr>,
#> #   `media::image` <lgl>, `$given_name` <chr>, contextualize <lgl>,
#> #   contextualize_instruction <lgl>, block <lgl>, block_sequence <lgl>,
#> #   sequence <lgl>, mode <chr>, check <lgl>, accuracy <lgl>, chapter <lgl>,
#> #   subchapter <lgl>, labelReport <lgl>, hintReport <lgl>, keyword <lgl>
#> 
#> $information
#> # A tibble: 2 × 33
#>   referential_id   type   name  label hint  required required_message constraint
#>   <chr>            <chr>  <chr> <chr> <chr> <chr>    <lgl>            <chr>     
#> 1 household_survey begin… grou… Inte… NA    false    NA               NA        
#> 2 household_survey end_g… NA    NA    NA    NA       NA               NA        
#> # ℹ 25 more variables: constraint_message <chr>, relevant <chr>,
#> #   appearance <chr>, calculation <chr>, trigger <lgl>, parameters <lgl>,
#> #   repeat_count <chr>, default <lgl>, read_only <lgl>, choice_filter <chr>,
#> #   `media::image` <lgl>, `$given_name` <chr>, contextualize <lgl>,
#> #   contextualize_instruction <lgl>, block <lgl>, block_sequence <lgl>,
#> #   sequence <lgl>, mode <chr>, check <lgl>, accuracy <lgl>, chapter <lgl>,
#> #   subchapter <lgl>, labelReport <lgl>, hintReport <lgl>, keyword <lgl>

Utils for referential manipulation