philchalmers / mirtCAT

Computerized Adaptive Testing with Multidimensional Item Response Theory
http://philchalmers.github.io/mirtCAT/
89 stars 28 forks source link

Can't change ShinyGUI #4

Closed whiteplastic closed 8 years ago

whiteplastic commented 8 years ago

Following the "Customize GUI" demo, I tried to define my own ShinyGUI list to override the defaults, but they won't change. Is there anything I'm missing?

philchalmers commented 8 years ago

Could you provide some simple reproducible code?

whiteplastic commented 8 years ago
library("mirtCAT")
options(stringsAsFactors = FALSE)
## Potential options for each item
title<-"Personalisierter Fragebogen"
author<-""
instructions<-c("Anleitung:","beantworten Sie die Fragen und klicken Sie dann auf","Weiter")
firstpage<-list(h2("Personalisierter Fragebogen"),"Test","Test")
lastpage <-list(h2("Ende"),"Dies ist das Ende des heutigen Fragebogens")

df <- data.frame(Question = questions, Option = options, Type = "radio_inline")

[redacted]

## Run the mirtCAT web interface and store results
results <- mirtCAT(df = df, ShinyGUI=guiList)
philchalmers commented 8 years ago

The line

results <- mirtCAT(df = df, ShinyGUI=guiList)

should be

results <- mirtCAT(df = df, shinyGUI=guiList)

Though it appears that providing empty strings is not valid. I'll fix that and then close this issue. Thanks.

philchalmers commented 8 years ago

Actually, I don't see any bugs here. author should be authors and lastpage should be a function rather than a list (in previous version is was a list, but this was changed in case person estimates should be printed instead).

whiteplastic commented 8 years ago

Yep, I got all the error messages concerning that after changing to shinyGUI. Supplying an empty string to authors works.

philchalmers commented 8 years ago

Great. I'll update the wiki example to reflect that lastpage should now be a function instead as well. Sorry for the trouble.

Maiate commented 1 year ago

I tried to include a firstpage with instructions. I followed "Customize GUI" demo but when I run the code the first page justdoesn´t appear (no problem with lastpage).

css <- readLines('bootstrap.css') title <- "REDiC" authors <- "Aprendemos Todos" firstpage<- list(h2("Bienvenido"), h5("Trata de responder a cada ejercicio.\n Buena suerte!"))

lastpage <- function(person){ list(h1("Gracias por tu respuesta")) }

shinyGUI_list <- list(title = title, authors = authors, demographics = demographics, demographics_inputIDs = c('ID','Fecha','name','edad','gender'), firstpage = firstpage, lastpage = lastpage, css = css)

results <- mirtCAT(df=df, shinyGUI = shinyGUI_list)