Indeed shinyjs looks particularly interesting! Thanks a lot @nirgrahamuk.
Here is a small reprex that should run smoothly. It doesn't contain the slow creation of the last 4 questions as it requires an adapative set to be created, and for the sake of simplicity I did not do so, but the core of the app is created through this piece of code.
if(!require(tidyverse)) install.packages("tidyverse", repos = "http://cran.us.r-project.org")
if(!require(idefix)) install.packages("idefix", repos = "http://cran.us.r-project.org")
if(!require(shinyjs)) install.packages("shinyjs", repos = "http://cran.us.r-project.org")
library(tidyverse)
library(idefix)
library(shinyjs)
n.sets <- 8
alternatives <- c("Alternative A", "Alternative B")
p.mean <- c(0,0,0)
p.var <- diag(length(p.mean))
levels <- c(3,3,3)
cand <- example_design
attributes <- c("time", "price", "comfort")
lvls <- list(c("2h", "5h", "10h"), c("15$", "8$", "1$"), c("Low", "Med", "High"))
itext <- c("Welcome to this reprex survey")
btext <- c("Please choose the alternative you prefer")
etext <- c("Thank you for taking the survey! Don't hesitate to share it with your friends and families, as it would be infinitely helpful for us.")
SurveyApp(des = example_design,
n.total = n.sets,
alts = alternatives,
atts = attributes,
lvl.names = lvls,
coding = c("D", "D", "D"),
buttons.text = btext,
intro.text = itext,
end.text = etext,
prior.mean = p.mean,
prior.covar = p.var,
cand.set = cand,
n.draws = 100
)