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
I will be following along closely. I have some thoughts here. Do you have an idea for infrastructure or JavaScript libraries, templates, schema? Look forward to this project.
Don't wait too eagerly; I have several other things I have to tend to before I'll start working on this :p This repo is like a strong TODO to force and remind me to work on this later.
Feel free to share all your thoughts!
I don't think I'll need to use any javascript. I still haven't decided on infrastructure, I haven't even settled on what the interaction should be like/what the exact functionality will be.
The main gist as you imagine would involve the user supplying a list such as
questions <- list(
list(id = "name", type = "text", title = "Name",
text = "What'd your momma give ya?", mandatory = TRUE),
list(id = ..., type = ..., ...)
)
And then the package would take this list of questions, build the UI and also set up all the server-side logic. I might take advantage of some templating engine, do you have one in mind that works well with R?
A few different options that I see for the main package functionality:
expose a function "createForm()" that creates a shiny app FILE (ie. literally it will write a app.R file) and the user can then go and edit that file or run it
expose a "runForm()" which will do exactly what the previous function did, but also run the app after creating the file (they can be the same function with just a parameter specifying whether to run the app after creating it or not)
as a very different approach, the user can create their own shiny app and have to call "createFormUI()" in the UI and "createFormServer()" in the server. Unless there's a better way to do this, to somehow make one call that will add code to both the UI and the server.
A few initial issues that will need to be addressed:
storage: the user will need to specify where to store the responses, probably by passing some parameters to the main function
admin view: hopefully it will support specifying who's an admin and letting that user see all responses
make sure it's simple enough so that someone who doesn't know shiny can use it, but also make sure that people who know shiny can use this to create the skeleton of their survey but they can still edit the app extensively if they want
need to support both lazy and nonlazy evaluation of the content of questions. For example, I could have a question that reads paste0("As of right now ", Sys.time(), " are you hungry?") and in this case I would want Sys.time() to be evaluated when the shiny app actually runs. But in other cases I might want the call to be evaluated right away at the creation of the form
This was just a dump of my very preemptive thoughts, feel free to chip in!
My thoughts are to use a save_form() function to save the arguments to a table/dataframe. Then use a open_form() function to read the values in the table and return various htmlwidget outputs. Then a save_results() to save inputs to table/dataframe.
@daattali glad you are back at it. I'll post a separate issue to discuss my very preliminary thoughts to see if they mesh or supplement yours. I'll follow closely and try to get caught up.
Activity
daattali commentedon Sep 8, 2015
Don't wait too eagerly; I have several other things I have to tend to before I'll start working on this :p This repo is like a strong TODO to force and remind me to work on this later.
Feel free to share all your thoughts!
I don't think I'll need to use any javascript. I still haven't decided on infrastructure, I haven't even settled on what the interaction should be like/what the exact functionality will be.
The main gist as you imagine would involve the user supplying a list such as
And then the package would take this list of questions, build the UI and also set up all the server-side logic. I might take advantage of some templating engine, do you have one in mind that works well with R?
A few different options that I see for the main package functionality:
A few initial issues that will need to be addressed:
paste0("As of right now ", Sys.time(), " are you hungry?")and in this case I would want Sys.time() to be evaluated when the shiny app actually runs. But in other cases I might want the call to be evaluated right away at the creation of the formThis was just a dump of my very preemptive thoughts, feel free to chip in!
daattali commentedon Sep 8, 2015
Notes to self: two potential templating packages: whisker, infuser
fozy81 commentedon Nov 20, 2015
My thoughts are to use a save_form() function to save the arguments to a table/dataframe. Then use a open_form() function to read the values in the table and return various htmlwidget outputs. Then a save_results() to save inputs to table/dataframe.
Worth thinking about all the possible arguments a form may need. There's an interesting standard http://xlsform.org/ (XForms) supported by open data kit. Be interesting if a form template could be based on an open standard.
Good luck.
daattali commentedon Apr 2, 2016
@timelyportfolio @fozy81 I just spent a few hours on this today and got a basic minimalistic version working. See what you think
daattali commentedon Apr 3, 2016
closing this since I now have a working (very simple) package. Will open several issues for stuff that should be implemented
timelyportfolio commentedon Apr 5, 2016
@daattali glad you are back at it. I'll post a separate issue to discuss my very preliminary thoughts to see if they mesh or supplement yours. I'll follow closely and try to get caught up.