surveydown::sd_version()
-#> surveydown (local): 0.5.1
-#> surveydown (latest): 0.5.1
+#> surveydown (local): 0.5.2
+#> surveydown (latest): 0.5.2#>#> surveydown is up to date.
diff --git a/search.json b/search.json
index 463b5b2..8d5582d 100644
--- a/search.json
+++ b/search.json
@@ -1 +1 @@
-[{"path":[]},{"path":"https://pkg.surveydown.org/CODE_OF_CONDUCT.html","id":"our-pledge","dir":"","previous_headings":"","what":"Our Pledge","title":"Contributor Covenant Code of Conduct","text":"members, contributors, leaders pledge make participation community harassment-free experience everyone, regardless age, body size, visible invisible disability, ethnicity, sex characteristics, gender identity expression, level experience, education, socio-economic status, nationality, personal appearance, race, religion, sexual identity orientation. pledge act interact ways contribute open, welcoming, diverse, inclusive, healthy community.","code":""},{"path":"https://pkg.surveydown.org/CODE_OF_CONDUCT.html","id":"our-standards","dir":"","previous_headings":"","what":"Our Standards","title":"Contributor Covenant Code of Conduct","text":"Examples behavior contributes positive environment community include: Demonstrating empathy kindness toward people respectful differing opinions, viewpoints, experiences Giving gracefully accepting constructive feedback Accepting responsibility apologizing affected mistakes, learning experience Focusing best just us individuals, overall community Examples unacceptable behavior include: use sexualized language imagery, sexual attention advances kind Trolling, insulting derogatory comments, personal political attacks Public private harassment Publishing others’ private information, physical email address, without explicit permission conduct reasonably considered inappropriate professional setting Providing bad information copying output AI assistants without verifying validity","code":""},{"path":"https://pkg.surveydown.org/CODE_OF_CONDUCT.html","id":"enforcement-responsibilities","dir":"","previous_headings":"","what":"Enforcement Responsibilities","title":"Contributor Covenant Code of Conduct","text":"Community leaders responsible clarifying enforcing standards acceptable behavior take appropriate fair corrective action response behavior deem inappropriate, threatening, offensive, harmful. Community leaders right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct, communicate reasons moderation decisions appropriate.","code":""},{"path":"https://pkg.surveydown.org/CODE_OF_CONDUCT.html","id":"scope","dir":"","previous_headings":"","what":"Scope","title":"Contributor Covenant Code of Conduct","text":"Code Conduct applies within community spaces, also applies individual officially representing community public spaces. Examples representing community include using official e-mail address, posting via official social media account, acting appointed representative online offline event.","code":""},{"path":"https://pkg.surveydown.org/CODE_OF_CONDUCT.html","id":"enforcement","dir":"","previous_headings":"","what":"Enforcement","title":"Contributor Covenant Code of Conduct","text":"Instances abusive, harassing, otherwise unacceptable behavior may reported community leaders responsible enforcement codeofconduct@rstudio.com. complaints reviewed investigated promptly fairly. community leaders obligated respect privacy security reporter incident.","code":""},{"path":"https://pkg.surveydown.org/CODE_OF_CONDUCT.html","id":"enforcement-guidelines","dir":"","previous_headings":"","what":"Enforcement Guidelines","title":"Contributor Covenant Code of Conduct","text":"Community leaders follow Community Impact Guidelines determining consequences action deem violation Code Conduct:","code":""},{"path":"https://pkg.surveydown.org/CODE_OF_CONDUCT.html","id":"id_1-correction","dir":"","previous_headings":"Enforcement Guidelines","what":"1. Correction","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Use inappropriate language behavior deemed unprofessional unwelcome community. Consequence: private, written warning community leaders, providing clarity around nature violation explanation behavior inappropriate. public apology may requested.","code":""},{"path":"https://pkg.surveydown.org/CODE_OF_CONDUCT.html","id":"id_2-warning","dir":"","previous_headings":"Enforcement Guidelines","what":"2. Warning","title":"Contributor Covenant Code of Conduct","text":"Community Impact: violation single incident series actions. Consequence: warning consequences continued behavior. interaction people involved, including unsolicited interaction enforcing Code Conduct, specified period time. includes avoiding interactions community spaces well external channels like social media. Violating terms may lead temporary permanent ban.","code":""},{"path":"https://pkg.surveydown.org/CODE_OF_CONDUCT.html","id":"id_3-temporary-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"3. Temporary Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: serious violation community standards, including sustained inappropriate behavior. Consequence: temporary ban sort interaction public communication community specified period time. public private interaction people involved, including unsolicited interaction enforcing Code Conduct, allowed period. Violating terms may lead permanent ban.","code":""},{"path":"https://pkg.surveydown.org/CODE_OF_CONDUCT.html","id":"id_4-permanent-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"4. Permanent Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Demonstrating pattern violation community standards, including sustained inappropriate behavior, harassment individual, aggression toward disparagement classes individuals. Consequence: permanent ban sort public interaction within community.","code":""},{"path":"https://pkg.surveydown.org/CODE_OF_CONDUCT.html","id":"attribution","dir":"","previous_headings":"","what":"Attribution","title":"Contributor Covenant Code of Conduct","text":"Code Conduct adapted Contributor Covenant, version 2.0, available https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. Community Impact Guidelines inspired Mozilla’s code conduct enforcement ladder. answers common questions code conduct, see FAQ https://www.contributor-covenant.org/faq. Translations available https://www.contributor-covenant.org/translations.","code":""},{"path":"https://pkg.surveydown.org/CONTRIBUTING.html","id":null,"dir":"","previous_headings":"","what":"Contributing to Surveydown","title":"Contributing to Surveydown","text":"welcome contributions Surveydown! can contribute many ways: opening issues provide feedback share ideas. fixing typos documentation submitting Pull Request (PR) fix opened issues submitting Pull Request (PR) suggest new features (considered good practice open issue discussion working pull request new feature).","code":""},{"path":"https://pkg.surveydown.org/CONTRIBUTING.html","id":"to-submit-a-contribution-using-a-pull-request","dir":"","previous_headings":"","what":"To submit a contribution using a Pull Request","title":"Contributing to Surveydown","text":"Fork repository, clone locally, make changes new branch specific PR. example: Submit pull request. ok submit draft still working like feedback us. always good share open working . ’ll try responsive possible reviewing accepting pull requests. much appreciate contributions!","code":"# clone your fork $ git clone https://github.com//surveydown # configure for your platform (./configure.sh for linux/mac or ./configure.cmd for Windows) $ cd quarto-cli $ ./configure.sh # checkout a new branch $ git checkout -b bugfix/myfix"},{"path":"https://pkg.surveydown.org/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2024 John Paul Helveston, Pingfan Hu, Bogdan Bunea Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://pkg.surveydown.org/articles/surveydown.html","id":"main-documentation","dir":"Articles","previous_headings":"","what":"Main Documentation","title":"Introduction to surveydown","text":"main documentation surveydown https://surveydown.org/. recommend navigating detailed documentation R package use build dynamic surveys.","code":""},{"path":"https://pkg.surveydown.org/articles/surveydown.html","id":"overview","dir":"Articles","previous_headings":"Main Documentation","what":"Overview","title":"Introduction to surveydown","text":"Every surveydown survey composed survey app, defined two separate files: survey.qmd: Quarto document contains survey content (pages, questions, etc), renders HTML file. app.R: R script defining Shiny app contains global settings (libraries, database configuration, etc.) server configuration options (e.g., conditional skipping / display, etc.). files must named survey.qmd app.R. {surveydown} R package provides set functions defining survey content configuration options. function starts sd_ make easy identify. platform based basic principles: Add content survey.qmd file using markdown text (RStudio use visual editor). Define survey questions R code chunks sd_question() function. Define pages using fences (:::), navigation buttons handled using sd_next() function. Add rich functionality survey using variety server options conditional control logic server() function app.R file. Store respondent data database (see Store Data). approach ensures flexible survey platform fully reproducible easy customize. remaining steps page guide process creating surveydown survey.","code":""},{"path":[]},{"path":"https://pkg.surveydown.org/articles/surveydown.html","id":"install-r-quarto","dir":"Articles","previous_headings":"Main Documentation > 1. Installation","what":"Install R & Quarto","title":"Introduction to surveydown","text":"R Quarto also recommend working IDE good support R, Quarto, Shiny. RStudio great, also like VSCode Positron.","code":""},{"path":"https://pkg.surveydown.org/articles/surveydown.html","id":"install-the-surveydown-r-package","dir":"Articles","previous_headings":"Main Documentation > 1. Installation","what":"Install the {surveydown} R package","title":"Introduction to surveydown","text":"can install {surveydown} CRAN R console: can install development version GitHub: Load package : can also check version installed:","code":"install.packages(\"surveydown\") # install.packages(\"pak\") pak::pak('surveydown-dev/surveydown') library(surveydown) surveydown::sd_version()"},{"path":"https://pkg.surveydown.org/articles/surveydown.html","id":"start-with-a-template","dir":"Articles","previous_headings":"Main Documentation","what":"2. Start with a template","title":"Introduction to surveydown","text":"See Template page.","code":""},{"path":"https://pkg.surveydown.org/articles/surveydown.html","id":"add-survey-content-in-your-survey-qmd-file","dir":"Articles","previous_headings":"Main Documentation","what":"3. Add survey content in your survey.qmd file","title":"Introduction to surveydown","text":"See Survey Components page details main components surveydown survey. quick overview, ’s add pages questions: Add pages fences, like : Add questions sd_question() function code chunks (see Question Types page types questions supported). example, ’s multiple choice question:","code":"::: {#page1 .sd-page} Page 1 content here ::: sd_question( type = 'mc', id = 'penguins', label = \"Which is your favorite type of penguin?\", option = c( 'Adélie' = 'adelie', 'Chinstrap' = 'chinstrap', 'Gentoo' = 'gentoo' ) )"},{"path":"https://pkg.surveydown.org/articles/surveydown.html","id":"add-control-options","dir":"Articles","previous_headings":"Main Documentation","what":"4. Add control options","title":"Introduction to surveydown","text":"server() function app.R file, add rich functionality survey using variety server options conditional control logic.","code":""},{"path":"https://pkg.surveydown.org/articles/surveydown.html","id":"setup-your-database","dir":"Articles","previous_headings":"Main Documentation","what":"5. Setup your database","title":"Introduction to surveydown","text":"global settings top app.R file, setup database sd_database() function. can also leave blank preview / edit survey without database connected, set ignore = TRUE run survey without storing data. See Store Data page details.","code":""},{"path":"https://pkg.surveydown.org/articles/surveydown.html","id":"locally-preview","dir":"Articles","previous_headings":"Main Documentation","what":"6. Locally preview","title":"Introduction to surveydown","text":"Preview survey clicking “Run App” button RStudio R console running runApp() command.","code":""},{"path":"https://pkg.surveydown.org/articles/surveydown.html","id":"deploy","dir":"Articles","previous_headings":"Main Documentation","what":"7. Deploy","title":"Introduction to surveydown","text":"Deploy survey hosting favorite server, like {{< var shinyapps >}}, {{< var huggingface >}}, Posit Connect Cloud, Heroku, etc. See Deployment page details.","code":""},{"path":"https://pkg.surveydown.org/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"John Paul Helveston. Author, maintainer, copyright holder. Pingfan Hu. Author, copyright holder. Bogdan Bunea. Author, copyright holder. Stefan Munnes. Contributor.","code":""},{"path":"https://pkg.surveydown.org/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Helveston J, Hu P, Bunea B (2024). surveydown: Markdown-Based Surveys Using Quarto Shiny. R package, https://surveydown.org/.","code":"@Manual{, title = {surveydown: Markdown-Based Surveys Using Quarto And Shiny}, author = {John Paul Helveston and Pingfan Hu and Bogdan Bunea}, year = {2024}, note = {R package}, url = {https://surveydown.org/}, }"},{"path":"https://pkg.surveydown.org/index.html","id":"surveydown","dir":"","previous_headings":"","what":"Build markdown-based surveys with quarto shiny documents","title":"Build markdown-based surveys with quarto shiny documents","text":"Note: site documents {surveydown} R package - visit main site surveydown.org information! surveydown flexible, open-source platform making surveys R, Quarto, Shiny, Supabase. basic concept : Design survey Quarto document using markdown R code. Convert survey Shiny app can hosted online sent respondents. Store survey responses Supabase database (Postgres database). {surveydown} R package provides functions bring together. See documentation get started making surveydown survey!","code":""},{"path":[]},{"path":"https://pkg.surveydown.org/index.html","id":"install-r--quarto","dir":"","previous_headings":"","what":"Install R & Quarto","title":"Build markdown-based surveys with quarto shiny documents","text":"R Quarto also recommend working IDE good support R, Quarto, Shiny. RStudio great, also like VSCode Positron.","code":""},{"path":"https://pkg.surveydown.org/index.html","id":"install-the-surveydown-r-package","dir":"","previous_headings":"","what":"Install the {surveydown} R package","title":"Build markdown-based surveys with quarto shiny documents","text":"can install {surveydown} CRAN R console: can install development version GitHub: Load package : can also check version installed:","code":"install.packages(\"surveydown\") # install.packages(\"pak\") pak::pak('surveydown-dev/surveydown') library(surveydown) surveydown::sd_version()"},{"path":"https://pkg.surveydown.org/index.html","id":"background--motivation","dir":"","previous_headings":"","what":"Background & Motivation","title":"Build markdown-based surveys with quarto shiny documents","text":"survey platforms (e.g., Google forms, Qualtrics, etc.) use drag--drop interfaces design surveys, making version control collaboration others difficult. ’re also reproducible (others easily reproduce survey made platforms), many require paid subscription license use. surveydown package designed address problems. open-source, markdown-based platform, survey content defined plain text (markdown R code) survey.qmd file app.R file renders survey Shiny app can hosted online. makes survey easy reproduce, share, version control common tools like Git. survey data collected also owned survey designer separate Postgres database (recommend Supabase free open-source database provider). ’re curious whole idea came , check blog post, outlines general idea motivation . post now outdated terms overall package design, provides something origin story motivation developing project.","code":""},{"path":"https://pkg.surveydown.org/index.html","id":"todo-list","dir":"","previous_headings":"","what":"TODO List","title":"Build markdown-based surveys with quarto shiny documents","text":"running list things ’re working / already added project: show_if (conditionally display question) skip_if (conditionally skip page) Set defaults questions choices selected launch. Ability embed markdown inside choice options (like mc buttons formr) Option ignore = TRUE setting (database connection ignored) Automatically include timestamps page question interaction data Option start designated page, e.g. start_page = 'page_name' show_all_pages = TRUE argument show pages hidden questions launched (e.g. able print entire survey text). also sd_print_survey() function print pdf. Set SCSS compatible Quarto-supported bootstrap themes. Include optional progress bar. Include input checks skip_if show_if (question_id exists, data frame names correct) Required questions: post popup question required allowing next button. Add sd_get_data() function survey designer can obtain current survey results inside app: https://shinysurveys.jdtrat.com/articles/get-survey-data.html Ability pass url parameters, e.g. tracking users. Ability redirect users another url. Leverage cookies users close browser can start back left . Admin page w/password preview / download data (see https://github.com/daattali/shinyforms) Form validation: Make sure user inputs correct type depending question type. (see https://shiny.posit.co/r/reference/shiny/0.14/validate.html) Multiple choice (single choice) Multiple choice (multiple choices) Select Text Numeric Multiple choice (button…like formr mc_button) Text area Date Slider Matrix Best worst Resources / related examples: shinysurveys shinyforms","code":""},{"path":[]},{"path":"https://pkg.surveydown.org/index.html","id":"citation-information","dir":"","previous_headings":"","what":"Citation Information","title":"Build markdown-based surveys with quarto shiny documents","text":"use package publication, please cite ! can get citation typing citation(\"surveydown\") R:","code":"citation(\"surveydown\")"},{"path":"https://pkg.surveydown.org/reference/sd_add_page.html","id":null,"dir":"Reference","previous_headings":"","what":"Add a Page Template to the Current Document — sd_add_page","title":"Add a Page Template to the Current Document — sd_add_page","text":"function inserts template surveydown page current cursor position active RStudio document. provides basic structure new page, including title, content area, next button. function call exists document, removed inserting template.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_add_page.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add a Page Template to the Current Document — sd_add_page","text":"","code":"sd_add_page()"},{"path":"https://pkg.surveydown.org/reference/sd_add_page.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add a Page Template to the Current Document — sd_add_page","text":"function return value. modifies active document side effect inserting text potentially removing function call.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_add_page.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add a Page Template to the Current Document — sd_add_page","text":"IMPORTANT: function run outside division R code chunk 'Quarto' document. Running inside division code chunk may result incorrect page structure. function performs following steps: Checks removes existing sd_add_page() function call document. Inserts template current cursor position. template includes: div class 'sd-page' placeholder page ID placeholder page title placeholder page contents R code chunk placeholder questions next button","code":""},{"path":"https://pkg.surveydown.org/reference/sd_add_page.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add a Page Template to the Current Document — sd_add_page","text":"","code":"if (interactive()) { library(surveydown) # Insert a new page template sd_add_page() }"},{"path":"https://pkg.surveydown.org/reference/sd_add_question.html","id":null,"dir":"Reference","previous_headings":"","what":"Add a Question Template to the Current Document — sd_add_question","title":"Add a Question Template to the Current Document — sd_add_question","text":"function inserts template surveydown question current cursor position active RStudio document. supports various question types automatically removes function call inserting template exists document.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_add_question.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add a Question Template to the Current Document — sd_add_question","text":"","code":"sd_add_question(type = \"mc\", chunk = FALSE)"},{"path":"https://pkg.surveydown.org/reference/sd_add_question.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add a Question Template to the Current Document — sd_add_question","text":"type character string specifying type question template insert. Default \"mc\" (multiple choice). Available options : \"mc\": Multiple choice (single selection) \"select\": Dropdown selection \"mc_multiple\": Multiple choice (multiple selections) \"mc_buttons\": Multiple choice button layout (single selection) \"mc_multiple_buttons\": Multiple choice button layout (multiple selections) \"text\": Short text input \"textarea\": Long text input \"numeric\": Numeric input \"slider\": Slider input \"date\": Date input \"daterange\": Date range input chunk Logical. TRUE, code generated R code chunk wrapper. Defaults FALSE.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_add_question.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add a Question Template to the Current Document — sd_add_question","text":"function return value. modifies active document side effect inserting text potentially removing function call.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_add_question.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add a Question Template to the Current Document — sd_add_question","text":"function performs following steps: Checks removes existing sd_add_question() function call document. Inserts appropriate question template current cursor position.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_add_question.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add a Question Template to the Current Document — sd_add_question","text":"","code":"if (interactive()) { library(surveydown) # Insert a default multiple choice question template sd_add_question() # Insert a text input question template sd_add_question(\"text\") # Insert a slider question template sd_add_question(\"slider\") }"},{"path":"https://pkg.surveydown.org/reference/sd_close.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a 'Close' Button to Exit the Survey — sd_close","title":"Create a 'Close' Button to Exit the Survey — sd_close","text":"function creates 'Close' button , clicked, trigger exit process survey. Depending server-side configuration, may show rating question simple confirmation dialog attempting close current browser tab window.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_close.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a 'Close' Button to Exit the Survey — sd_close","text":"","code":"sd_close(label = NULL)"},{"path":"https://pkg.surveydown.org/reference/sd_close.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a 'Close' Button to Exit the Survey — sd_close","text":"label Character string. label 'Close' button. Defaults NULL, case word \"Exit Survey\" used.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_close.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a 'Close' Button to Exit the Survey — sd_close","text":"'shiny' tagList containing 'Close' button UI element associated JavaScript exit process.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_close.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create a 'Close' Button to Exit the Survey — sd_close","text":"function generates 'shiny' action button , clicked, triggers 'show_exit_modal' event. server-side logic (controlled rate_survey parameter sd_server()) determines whether show rating question simple confirmation dialog. function also includes custom message handler closing window. necessary browsers may allow JavaScript close windows opened JavaScript. cases, user prompted close tab manually.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_close.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Create a 'Close' Button to Exit the Survey — sd_close","text":"actual behavior exit process (whether show rating question ) controlled rate_survey parameter sd_server() function, UI function.","code":""},{"path":[]},{"path":"https://pkg.surveydown.org/reference/sd_close.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a 'Close' Button to Exit the Survey — sd_close","text":"","code":"if (interactive()) { library(surveydown) # Get path to example survey file survey_path <- system.file(\"examples\", \"sd_close.qmd\", package = \"surveydown\") # Copy to a temporary directory temp_dir <- tempdir() file.copy(survey_path, file.path(temp_dir, \"survey.qmd\")) orig_dir <- getwd() setwd(temp_dir) # Define a minimal server server <- function(input, output, session) { sd_server() } # Run the app shiny::shinyApp(ui = sd_ui(), server = server) # Clean up setwd(orig_dir) }"},{"path":"https://pkg.surveydown.org/reference/sd_completion_code.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate a Random Completion Code — sd_completion_code","title":"Generate a Random Completion Code — sd_completion_code","text":"function generates random completion code specified number digits. code returned character string.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_completion_code.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate a Random Completion Code — sd_completion_code","text":"","code":"sd_completion_code(digits = 6)"},{"path":"https://pkg.surveydown.org/reference/sd_completion_code.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate a Random Completion Code — sd_completion_code","text":"digits integer specifying number digits completion code. Must positive integer. Default 6.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_completion_code.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate a Random Completion Code — sd_completion_code","text":"character string representing random completion code.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_completion_code.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generate a Random Completion Code — sd_completion_code","text":"","code":"library(surveydown) sd_completion_code() # generates a 6-digit code #> [1] \"545358\" sd_completion_code(digits = 8) # generates an 8-digit code #> [1] \"47164415\" sd_completion_code(digits = 4) # generates a 4-digit code #> [1] \"7285\" sd_completion_code(digits = 10) # generates a 10-digit code #> [1] \"6585941037\""},{"path":"https://pkg.surveydown.org/reference/sd_copy_value.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a copy of a value — sd_copy_value","title":"Create a copy of a value — sd_copy_value","text":"function creates copy input value makes available new output. new output can displayed using sd_output().","code":""},{"path":"https://pkg.surveydown.org/reference/sd_copy_value.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a copy of a value — sd_copy_value","text":"","code":"sd_copy_value(id, id_copy)"},{"path":"https://pkg.surveydown.org/reference/sd_copy_value.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a copy of a value — sd_copy_value","text":"id Character string. ID input value copy. id_copy Character string. ID new copy (must different id).","code":""},{"path":"https://pkg.surveydown.org/reference/sd_copy_value.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a copy of a value — sd_copy_value","text":"NULL invisibly. function called side effects.","code":""},{"path":[]},{"path":"https://pkg.surveydown.org/reference/sd_copy_value.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a copy of a value — sd_copy_value","text":"","code":"if (interactive()) { library(surveydown) # Get path to example survey file survey_path <- system.file(\"examples\", \"sd_ui.qmd\", package = \"surveydown\") # Copy to a temporary directory temp_dir <- tempdir() file.copy(survey_path, file.path(temp_dir, \"sd_copy_value.qmd\")) orig_dir <- getwd() setwd(temp_dir) # Define a minimal server server <- function(input, output, session) { # Make a copy of the \"name\" variable to call its value a second time sd_copy_value(id = \"name\", id_copy = \"name_copy\") sd_server() } # Run the app shiny::shinyApp(ui = sd_ui(), server = server) # Clean up setwd(orig_dir) }"},{"path":"https://pkg.surveydown.org/reference/sd_create_survey.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a new survey template — sd_create_survey","title":"Create a new survey template — sd_create_survey","text":"function creates new survey template copying files package's template directory specified path. handles file conflicts provides appropriate warnings feedback.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_create_survey.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a new survey template — sd_create_survey","text":"","code":"sd_create_survey(path = getwd(), structure = \"single\")"},{"path":"https://pkg.surveydown.org/reference/sd_create_survey.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a new survey template — sd_create_survey","text":"path character string specifying directory survey template created. Defaults current working directory. structure character string specifying template structure use. Must either \"single\" \"multi\". Defaults \"single\".","code":""},{"path":"https://pkg.surveydown.org/reference/sd_create_survey.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a new survey template — sd_create_survey","text":"Invisible NULL. function called side effects creating files providing user feedback.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_create_survey.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create a new survey template — sd_create_survey","text":"function performs following steps: specified path current working directory, asks user confirmation. Validates specified structure (\"single\" \"multi\"). Creates target directory exist. Copies files package's template directory (based specified structure) target path. Preserves directory structure template. Skips existing files provides warnings skipped file. Handles .Rproj files specially, skipping .Rproj file already exists target directory. Provides feedback whether files copied files already existed.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_create_survey.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a new survey template — sd_create_survey","text":"","code":"if (interactive()) { # Create a single-page survey template sd_create_survey(structure = \"single\") # Create a multi-page survey template sd_create_survey(structure = \"multi\") }"},{"path":"https://pkg.surveydown.org/reference/sd_create_translations.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a translations template file — sd_create_translations","title":"Create a translations template file — sd_create_translations","text":"function creates template translations.yml file project root directory users can customize modify system messages.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_create_translations.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a translations template file — sd_create_translations","text":"","code":"sd_create_translations(language = \"en\", path = getwd())"},{"path":"https://pkg.surveydown.org/reference/sd_create_translations.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a translations template file — sd_create_translations","text":"language Character string specifying language use. See https://shiny.posit.co/r/reference/shiny/1.7.0/dateinput supported languages. Also, \"en\", \"de\", \"es\", \"fr\", \"\" chosen, default messages langauges used, otherwise default English messages used. Defaults \"en\". path Character string specifying directory translations.yml file created. Defaults current working directory. file placed root project folder surveydown survey.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_create_translations.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a translations template file — sd_create_translations","text":"Invisible NULL.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_create_translations.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a translations template file — sd_create_translations","text":"","code":"if (interactive()) { # Create English template sd_create_translations() # Create German template sd_create_translations(language = \"de\") # Create Japanese template # Will use English messages but Japanese date picker - user can modify # the messages as desired sd_create_translations(language = \"ja\") }"},{"path":"https://pkg.surveydown.org/reference/sd_database.html","id":null,"dir":"Reference","previous_headings":"","what":"Connect to a 'PostgreSQL' Database with Automatic Cleanup — sd_database","title":"Connect to a 'PostgreSQL' Database with Automatic Cleanup — sd_database","text":"function establishes connection pool 'PostgreSQL' database (e.g. Supabase) sets automatic cleanup 'shiny' session ends.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_database.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Connect to a 'PostgreSQL' Database with Automatic Cleanup — sd_database","text":"","code":"sd_database( host = NULL, dbname = NULL, port = NULL, user = NULL, table = NULL, password = Sys.getenv(\"SURVEYDOWN_PASSWORD\"), gssencmode = \"prefer\", ignore = FALSE, min_size = 1, max_size = Inf )"},{"path":"https://pkg.surveydown.org/reference/sd_database.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Connect to a 'PostgreSQL' Database with Automatic Cleanup — sd_database","text":"host Character string. host address Supabase database. dbname Character string. name Supabase database. port Integer. port number Supabase database connection. user Character string. username Supabase database connection. table Character string. name table interact Supabase database. password Character string. password Supabase database connection. NOTE: can provide hard-coded password , recommend security purposes. Instead, establish password surveydown::sd_set_password(), create local .Renviron file stores password SURVEYDOWN_PASSWORD environment variable. password argument uses default value, set password properly surveydown::sd_set_password(), can safely ignore using password argument . gssencmode Character string. GSS encryption mode database connection. Defaults \"prefer\". NOTE: verified connection details correct still access database, consider setting \"disable\". can necessary secure connection, VPN. ignore Logical. TRUE, data saved local CSV file instead database. Defaults FALSE. min_size Integer. minimum number connections pool. Defaults 1. max_size Integer. maximum number connections pool. Defaults Inf.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_database.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Connect to a 'PostgreSQL' Database with Automatic Cleanup — sd_database","text":"list containing database connection pool (db) table name (table), NULL ignore mode error.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_database.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Connect to a 'PostgreSQL' Database with Automatic Cleanup — sd_database","text":"","code":"if (interactive()) { # Assuming SURVEYDOWN_PASSWORD is set in .Renviron db <- sd_database( host = \"aws-0-us-west-1.pooler.supabase.com\", dbname = \"postgres\", port = \"6---\", user = \"postgres.k----------i\", table = \"your-table-name\", ignore = FALSE ) # Print the structure of the connection str(db) # Close the connection pool when done if (!is.null(db)) { pool::poolClose(db$db) } }"},{"path":"https://pkg.surveydown.org/reference/sd_display_question.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a placeholder for a reactive survey question — sd_display_question","title":"Create a placeholder for a reactive survey question — sd_display_question","text":"function depreciated - use sd_output() instead.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_display_question.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a placeholder for a reactive survey question — sd_display_question","text":"","code":"sd_display_question(id)"},{"path":"https://pkg.surveydown.org/reference/sd_display_question.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a placeholder for a reactive survey question — sd_display_question","text":"id unique identifier question.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_display_question.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a placeholder for a reactive survey question — sd_display_question","text":"'shiny' UI element serves placeholder reactive question.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_display_value.html","id":null,"dir":"Reference","previous_headings":"","what":"Display the value of a survey question — sd_display_value","title":"Display the value of a survey question — sd_display_value","text":"function depreciated - use sd_output() instead.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_display_value.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display the value of a survey question — sd_display_value","text":"","code":"sd_display_value(id, display_type = \"inline\", wrapper = NULL, ...)"},{"path":"https://pkg.surveydown.org/reference/sd_display_value.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Display the value of a survey question — sd_display_value","text":"id ID question display display_type type display. Can \"inline\" (default), \"text\", \"verbatim\", \"ui\". wrapper function wrap output ... Additional arguments passed wrapper function","code":""},{"path":"https://pkg.surveydown.org/reference/sd_display_value.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Display the value of a survey question — sd_display_value","text":"'shiny' UI element displaying question's value","code":""},{"path":"https://pkg.surveydown.org/reference/sd_get_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Fetch data from a database table with automatic reactivity detection — sd_get_data","title":"Fetch data from a database table with automatic reactivity detection — sd_get_data","text":"function retrieves data specified table database. automatically detects whether used reactive context (e.g., within 'shiny' application) behaves accordingly. reactive context, returns reactive expression automatically refreshes data specified intervals.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_get_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fetch data from a database table with automatic reactivity detection — sd_get_data","text":"","code":"sd_get_data(db, refresh_interval = NULL)"},{"path":"https://pkg.surveydown.org/reference/sd_get_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fetch data from a database table with automatic reactivity detection — sd_get_data","text":"db list containing database connection details created using sd_database(). Must elements: db: DBI database connection object table: string specifying name table query refresh_interval Numeric. time interval (seconds) data refreshes reactive context. Default NULL, meaning data refresh.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_get_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Fetch data from a database table with automatic reactivity detection — sd_get_data","text":"non-reactive context, returns data frame containing rows columns specified table. reactive context, returns reactive expression , called, returns recent data specified database table.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_get_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Fetch data from a database table with automatic reactivity detection — sd_get_data","text":"","code":"# Non-reactive context example if (FALSE) { # \\dontrun{ library(surveydown) # Assuming you have a database connection called db created using # sd_database(), you can fetch data with: data <- sd_get_data(db) head(data) # Reactive context example (inside a surveydown app) server <- function(input, output, session) { data <- sd_get_data(db, refresh_interval = 10) output$data_table <- renderTable({ data() # Note the parentheses to retrieve the reactive value }) } } # }"},{"path":"https://pkg.surveydown.org/reference/sd_get_url_pars.html","id":null,"dir":"Reference","previous_headings":"","what":"Get URL Parameters in a 'shiny' Application — sd_get_url_pars","title":"Get URL Parameters in a 'shiny' Application — sd_get_url_pars","text":"function retrieves URL parameters current 'shiny' session. must called within 'shiny' reactive context.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_get_url_pars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get URL Parameters in a 'shiny' Application — sd_get_url_pars","text":"","code":"sd_get_url_pars(...)"},{"path":"https://pkg.surveydown.org/reference/sd_get_url_pars.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get URL Parameters in a 'shiny' Application — sd_get_url_pars","text":"... Optional. Names specific URL parameters retrieve. none specified, URL parameters returned.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_get_url_pars.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get URL Parameters in a 'shiny' Application — sd_get_url_pars","text":"reactive expression returns list URL parameters.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_get_url_pars.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get URL Parameters in a 'shiny' Application — sd_get_url_pars","text":"","code":"if (interactive()) { library(surveydown) # Get path to example survey file survey_path <- system.file(\"examples\", \"sd_redirect.qmd\", package = \"surveydown\") # Copy to a temporary directory temp_dir <- tempdir() file.copy(survey_path, file.path(temp_dir, \"survey.qmd\")) orig_dir <- getwd() setwd(temp_dir) # Define a minimal server server <- function(input, output, session) { # Reactive expression that generates a url with an id variable # parsed from the url url_redirect <- reactive({ params <- sd_get_url_pars() id <- params[\"id\"] return(paste0(\"https://www.google.com?id=\", id)) }) # Create the redirect button sd_redirect( id = \"redirect_url_pars\", url = url_redirect(), button = TRUE, label = \"Redirect\" ) sd_skip_if( input$screening_question == \"end_1\" ~ \"end_page_1\", input$screening_question == \"end_1\" ~ \"end_page_2\", ) sd_server() } # Run the app shiny::shinyApp(ui = sd_ui(), server = server) # Clean up setwd(orig_dir) }"},{"path":"https://pkg.surveydown.org/reference/sd_include_folder.html","id":null,"dir":"Reference","previous_headings":"","what":"Include a folder to the 'shiny' resource path — sd_include_folder","title":"Include a folder to the 'shiny' resource path — sd_include_folder","text":"function includes specified folder 'shiny' resource path, making accessible serving static files 'shiny' application. checks pre-existing resource paths avoid conflicts folders already included package.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_include_folder.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Include a folder to the 'shiny' resource path — sd_include_folder","text":"","code":"sd_include_folder(folder)"},{"path":"https://pkg.surveydown.org/reference/sd_include_folder.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Include a folder to the 'shiny' resource path — sd_include_folder","text":"folder character string specifying name folder include. folder exist root directory 'shiny' app.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_include_folder.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Include a folder to the 'shiny' resource path — sd_include_folder","text":"NULL invisibly. function called side effect adding resource path 'shiny'.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_include_folder.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Include a folder to the 'shiny' resource path — sd_include_folder","text":"","code":"if (interactive()) { library(shiny) # Create an \"images\" folder dir.create(\"images\") # Include the folder in the shiny resource path sd_include_folder(\"images\") }"},{"path":"https://pkg.surveydown.org/reference/sd_is_answered.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if a question is answered — sd_is_answered","title":"Check if a question is answered — sd_is_answered","text":"function checks given question answered user. matrix questions, checks sub-questions (rows) answered.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_is_answered.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if a question is answered — sd_is_answered","text":"","code":"sd_is_answered(question_id)"},{"path":"https://pkg.surveydown.org/reference/sd_is_answered.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if a question is answered — sd_is_answered","text":"question_id ID question check.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_is_answered.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if a question is answered — sd_is_answered","text":"logical value: TRUE question answered, FALSE otherwise.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_is_answered.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check if a question is answered — sd_is_answered","text":"","code":"if (interactive()) { library(surveydown) # Get path to example survey file survey_path <- system.file(\"examples\", \"sd_is_answered.qmd\", package = \"surveydown\") # Copy to a temporary directory temp_dir <- tempdir() file.copy(survey_path, file.path(temp_dir, \"survey.qmd\")) orig_dir <- getwd() setwd(temp_dir) # Define a minimal server server <- function(input, output, session) { sd_show_if( # If \"apple_text\" is answered, show the conditional question sd_is_answered(\"apple_text\") ~ \"other_fruit\" ) sd_server() } # Run the app shiny::shinyApp(ui = sd_ui(), server = server) # Clean up setwd(orig_dir) }"},{"path":"https://pkg.surveydown.org/reference/sd_next.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a 'Next' Button for Page Navigation — sd_next","title":"Create a 'Next' Button for Page Navigation — sd_next","text":"function creates 'Next' button navigating specified next page Surveydown survey. button can activated clicking pressing Enter key visible.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_next.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a 'Next' Button for Page Navigation — sd_next","text":"","code":"sd_next(next_page = NULL, label = NULL)"},{"path":"https://pkg.surveydown.org/reference/sd_next.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a 'Next' Button for Page Navigation — sd_next","text":"next_page Character string. ID next page navigate . parameter required. label Character string. label 'Next' button. Defaults NULL, case word \"Next\" used.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_next.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a 'Next' Button for Page Navigation — sd_next","text":"'shiny' tagList containing 'Next' button UI element.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_next.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create a 'Next' Button for Page Navigation — sd_next","text":"function generates 'shiny' action button , clicked Enter key pressed, sets input value specified next page ID, facilitating page navigation within Shiny application. button styled appear centered page includes class Enter key functionality.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_next.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a 'Next' Button for Page Navigation — sd_next","text":"","code":"if (interactive()) { library(surveydown) # Get path to example survey file survey_path <- system.file(\"examples\", \"sd_next.qmd\", package = \"surveydown\") # Copy to a temporary directory temp_dir <- tempdir() file.copy(survey_path, file.path(temp_dir, \"survey.qmd\")) orig_dir <- getwd() setwd(temp_dir) # Define a minimal server server <- function(input, output, session) { sd_server() } # Run the app shiny::shinyApp(ui = sd_ui(), server = server) # Clean up setwd(orig_dir) }"},{"path":"https://pkg.surveydown.org/reference/sd_output.html","id":null,"dir":"Reference","previous_headings":"","what":"Output Function for Displaying reactive objects and values — sd_output","title":"Output Function for Displaying reactive objects and values — sd_output","text":"Output Function Displaying reactive objects values","code":""},{"path":"https://pkg.surveydown.org/reference/sd_output.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Output Function for Displaying reactive objects and values — sd_output","text":"","code":"sd_output( id, type = NULL, width = \"100%\", display = \"text\", inline = TRUE, wrapper = NULL, ... )"},{"path":"https://pkg.surveydown.org/reference/sd_output.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Output Function for Displaying reactive objects and values — sd_output","text":"id Character string. unique identifier output element. type Character string. Specifies type output. Can \"question\", \"value\", NULL. NULL, function behaves like shiny::uiOutput(). width Character string. width UI element. Defaults \"100%\". display Character string. Specifies display type \"value\" outputs. Can \"text\", \"verbatim\", \"ui\". used type = \"value\". inline Logical. Whether render output inline. Defaults TRUE. wrapper Function. function wrap output. used type = \"value\". ... Additional arguments passed underlying 'shiny' functions wrapper function.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_output.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Output Function for Displaying reactive objects and values — sd_output","text":"'shiny' UI element, type depends input parameters.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_output.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Output Function for Displaying reactive objects and values — sd_output","text":"function behaves differently based type parameter: type NULL, acts like shiny::uiOutput(). type \"question\", creates placeholder reactive survey question. type \"value\", creates output display value survey question, display style determined display parameter.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_output.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Output Function for Displaying reactive objects and values — sd_output","text":"","code":"if (interactive()) { library(surveydown) # Get path to example survey file survey_path <- system.file(\"examples\", \"sd_output.qmd\", package = \"surveydown\") # Copy to a temporary directory temp_dir <- tempdir() file.copy(survey_path, file.path(temp_dir, \"survey.qmd\")) orig_dir <- getwd() setwd(temp_dir) # Define a minimal server server <- function(input, output, session) { sd_server() } # Run the app shiny::shinyApp(ui = sd_ui(), server = server) # Clean up setwd(orig_dir) }"},{"path":"https://pkg.surveydown.org/reference/sd_question.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a survey question — sd_question","title":"Create a survey question — sd_question","text":"function creates various types survey questions use Surveydown survey.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_question.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a survey question — sd_question","text":"","code":"sd_question( type, id, label, cols = \"80\", direction = \"horizontal\", status = \"default\", width = \"100%\", height = \"100px\", selected = NULL, label_select = \"Choose an option...\", grid = TRUE, individual = TRUE, justified = FALSE, force_edges = TRUE, option = NULL, placeholder = NULL, resize = NULL, row = NULL )"},{"path":"https://pkg.surveydown.org/reference/sd_question.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a survey question — sd_question","text":"type Specifies type question. Possible values \"select\", \"mc\", \"mc_multiple\", \"mc_buttons\", \"mc_multiple_buttons\", \"text\", \"textarea\", \"numeric\", \"slider\", \"date\", \"daterange\", \"matrix\". id unique identifier question, used variable name resulting survey data. label Character string. label UI element, can formatted markdown. cols Integer. Number columns textarea input. Defaults 80. direction Character string. direction button groups (\"horizontal\" \"vertical\"). Defaults \"horizontal\". status Character string. status button groups. Defaults \"default\". width Character string. width UI element. Defaults \"100%\". height Character string. height textarea input. Defaults \"100px\". selected Value. selected value(s) certain input elements. label_select Character string. label select input. Defaults \"Choose option...\". grid Logical. Whether show grid slider input. Defaults TRUE. individual Logical. Whether buttons group individually styled. Defaults TRUE. justified Logical. Whether buttons group fill width parent div. Defaults FALSE. force_edges Logical. Whether force edges slider input. Defaults TRUE. option List. Options select, radio, checkbox, slider inputs. placeholder Character string. Placeholder text text textarea inputs. resize Character string. Resize option textarea input. Defaults NULL. row List. Used \"matrix\" type questions. Contains row labels corresponding IDs.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_question.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a survey question — sd_question","text":"'shiny' UI element wrapped div data attribute question ID.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_question.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create a survey question — sd_question","text":"function supports various question types: \"select\": dropdown selection \"mc\": Multiple choice (single selection) \"mc_multiple\": Multiple choice (multiple selections allowed) \"mc_buttons\": Multiple choice button-style options (single selection) \"mc_multiple_buttons\": Multiple choice button-style options (multiple selections allowed) \"text\": Single-line text input \"textarea\": Multi-line text input \"numeric\": Numeric input \"slider\": Slider input \"date\": Date input \"daterange\": Date range input \"matrix\": Matrix-style question rows columns \"matrix\" type questions, use row parameter define rows matrix. element row list name (used row ID) value (used row label).","code":""},{"path":"https://pkg.surveydown.org/reference/sd_question.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a survey question — sd_question","text":"","code":"if (interactive()) { library(surveydown) # Get path to example survey file survey_path <- system.file(\"examples\", \"basic_survey.qmd\", package = \"surveydown\") # Copy to a temporary directory temp_dir <- tempdir() file.copy(survey_path, file.path(temp_dir, \"survey.qmd\")) orig_dir <- getwd() setwd(temp_dir) # Define a minimal server server <- function(input, output, session) { sd_server() } # Run the app shiny::shinyApp(ui = sd_ui(), server = server) # Clean up setwd(orig_dir) }"},{"path":"https://pkg.surveydown.org/reference/sd_redirect.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a Redirect Element for 'shiny' Applications — sd_redirect","title":"Create a Redirect Element for 'shiny' Applications — sd_redirect","text":"function creates UI element redirects user specified URL. can used reactive non-reactive contexts within 'shiny' applications.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_redirect.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a Redirect Element for 'shiny' Applications — sd_redirect","text":"","code":"sd_redirect( id, url, button = TRUE, label = \"Click here\", delay = NULL, newtab = FALSE )"},{"path":"https://pkg.surveydown.org/reference/sd_redirect.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a Redirect Element for 'shiny' Applications — sd_redirect","text":"id character string unique id used identify redirect button survey body. url character string specifying URL redirect . button logical value indicating whether create button (TRUE) text element (FALSE) redirect. Default TRUE. label character string button text label. Defaults NULL, case words \"Click \" used. delay optional numeric value specifying delay seconds automatic redirection. NULL (default), automatic redirection occurs. newtab logical value indicating whether open URL new tab (TRUE) current tab (FALSE). Default FALSE.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_redirect.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a Redirect Element for 'shiny' Applications — sd_redirect","text":"reactive context, returns function called, renders redirect element. non-reactive context, returns redirect element directly.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_redirect.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a Redirect Element for 'shiny' Applications — sd_redirect","text":"","code":"if (interactive()) { library(surveydown) # Get path to example survey file survey_path <- system.file(\"examples\", \"sd_redirect.qmd\", package = \"surveydown\") # Copy to a temporary directory temp_dir <- tempdir() file.copy(survey_path, file.path(temp_dir, \"survey.qmd\")) orig_dir <- getwd() setwd(temp_dir) # Define a minimal server server <- function(input, output, session) { # Reactive expression that generates a url with an id variable # parsed from the url url_redirect <- reactive({ params <- sd_get_url_pars() id <- params[\"id\"] return(paste0(\"https://www.google.com?id=\", id)) }) # Create the redirect button sd_redirect( id = \"redirect_url_pars\", url = url_redirect(), button = TRUE, label = \"Redirect\" ) sd_skip_if( input$screening_question == \"end_1\" ~ \"end_page_1\", input$screening_question == \"end_1\" ~ \"end_page_2\", ) sd_server() } # Run the app shiny::shinyApp(ui = sd_ui(), server = server) # Clean up setwd(orig_dir) }"},{"path":"https://pkg.surveydown.org/reference/sd_server.html","id":null,"dir":"Reference","previous_headings":"","what":"Server logic for a surveydown survey — sd_server","title":"Server logic for a surveydown survey — sd_server","text":"function defines server-side logic 'shiny' application used surveydown. handles various operations conditional display, progress tracking, page navigation, database updates survey responses, exit survey functionality.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_server.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Server logic for a surveydown survey — sd_server","text":"","code":"sd_server( db = NULL, required_questions = NULL, all_questions_required = FALSE, start_page = NULL, admin_page = FALSE, auto_scroll = FALSE, rate_survey = FALSE, language = \"en\" )"},{"path":"https://pkg.surveydown.org/reference/sd_server.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Server logic for a surveydown survey — sd_server","text":"db list containing database connection information created using sd_database() function. Defaults NULL. required_questions Vector character strings. IDs questions must answered. Defaults NULL. all_questions_required Logical. TRUE, questions survey required. Defaults FALSE. start_page Character string. ID page start . Defaults NULL. admin_page Logical. Whether include admin page viewing downloading survey data. Defaults FALSE. auto_scroll Logical. Whether enable auto-scrolling next question answering. Defaults FALSE. rate_survey Logical. TRUE, shows rating question exiting survey. FALSE, shows simple confirmation dialog. Defaults FALSE. language Set language survey system messages. Include translations.yml file, choose built one following list: English (\"en\"), German (\"de\"), Spanish (\"es\"), French (\"fr\"), Italian (\"\"). Simplified Chinese (\"zh-CN\"). Defaults \"en\".","code":""},{"path":"https://pkg.surveydown.org/reference/sd_server.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Server logic for a surveydown survey — sd_server","text":"function return value; sets server-side logic 'shiny' application.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_server.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Server logic for a surveydown survey — sd_server","text":"function performs following tasks: Initializes variables reactive values. Implements conditional display logic questions. Tracks answered questions updates progress bar. Handles page navigation skip logic. Manages required questions. Performs database operation. Sets admin functionality enabled admin_page argument. Controls auto-scrolling behavior based auto_scroll argument. Uses sweetalert warning messages required questions answered. Handles exit survey process based rate_survey argument.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_server.html","id":"progress-bar","dir":"Reference","previous_headings":"","what":"Progress Bar","title":"Server logic for a surveydown survey — sd_server","text":"progress bar updated based last answered question. jump percentage corresponding last answered question never decrease, even earlier questions answered later. progress calculated ratio last answered question's index total number questions.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_server.html","id":"database-operations","dir":"Reference","previous_headings":"","what":"Database Operations","title":"Server logic for a surveydown survey — sd_server","text":"db provided, function update database survey responses. db NULL (ignore mode), responses saved local CSV file.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_server.html","id":"auto-scrolling","dir":"Reference","previous_headings":"","what":"Auto-Scrolling","title":"Server logic for a surveydown survey — sd_server","text":"auto_scroll TRUE, survey automatically scroll next question current question answered. behavior can disabled setting auto_scroll = FALSE.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_server.html","id":"exit-survey","dir":"Reference","previous_headings":"","what":"Exit Survey","title":"Server logic for a surveydown survey — sd_server","text":"rate_survey = TRUE, function show rating question user attempts exit survey. FALSE, show simple confirmation dialog. rating, provided, saved survey data.","code":""},{"path":[]},{"path":"https://pkg.surveydown.org/reference/sd_server.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Server logic for a surveydown survey — sd_server","text":"","code":"if (interactive()) { library(surveydown) # Get path to example survey file survey_path <- system.file(\"examples\", \"basic_survey.qmd\", package = \"surveydown\") # Copy to a temporary directory temp_dir <- tempdir() file.copy(survey_path, file.path(temp_dir, \"survey.qmd\")) orig_dir <- getwd() setwd(temp_dir) # Define a minimal server server <- function(input, output, session) { # sd_server() accepts these following parameters sd_server( db = NULL, required_questions = NULL, all_questions_required = FALSE, start_page = NULL, admin_page = FALSE, auto_scroll = FALSE, rate_survey = FALSE, language = \"en\" ) } # Run the app shiny::shinyApp(ui = sd_ui(), server = server) # Clean up setwd(orig_dir) }"},{"path":"https://pkg.surveydown.org/reference/sd_set_password.html","id":null,"dir":"Reference","previous_headings":"","what":"Set password for surveydown survey — sd_set_password","title":"Set password for surveydown survey — sd_set_password","text":"function sets surveydown password, used access 'PostgreSQL' data (e.g. Supabase). password saved .Renviron file adds .Renviron .gitignore.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_set_password.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set password for surveydown survey — sd_set_password","text":"","code":"sd_set_password(password)"},{"path":"https://pkg.surveydown.org/reference/sd_set_password.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set password for surveydown survey — sd_set_password","text":"password Character string. password set database connection.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_set_password.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set password for surveydown survey — sd_set_password","text":"None. function called side effects.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_set_password.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Set password for surveydown survey — sd_set_password","text":"function performs following actions: Creates .Renviron file root directory exist. Adds updates SURVEYDOWN_PASSWORD entry .Renviron file. Adds .Renviron .gitignore already .","code":""},{"path":"https://pkg.surveydown.org/reference/sd_set_password.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Set password for surveydown survey — sd_set_password","text":"","code":"if (FALSE) { # \\dontrun{ # Set a temporary password for demonstration temp_password <- paste0(sample(letters, 10, replace = TRUE), collapse = \"\") # Set the password sd_set_password(temp_password) # After restarting R, verify the password was set cat(\"Password is :\", Sys.getenv('SURVEYDOWN_PASSWORD')) } # }"},{"path":"https://pkg.surveydown.org/reference/sd_setup.html","id":null,"dir":"Reference","previous_headings":"","what":"Required Set Up Function — sd_setup","title":"Required Set Up Function — sd_setup","text":"function depreciated longer needed.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_setup.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Required Set Up Function — sd_setup","text":"","code":"sd_setup()"},{"path":"https://pkg.surveydown.org/reference/sd_setup.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Required Set Up Function — sd_setup","text":"function return value. called side effects setting 'shiny' application.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_setup.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Required Set Up Function — sd_setup","text":"function configures 'shiny' application use Bootstrap 5 styling enables 'shinyjs' JavaScript functionalities within application.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_show_if.html","id":null,"dir":"Reference","previous_headings":"","what":"Define show conditions for survey questions — sd_show_if","title":"Define show conditions for survey questions — sd_show_if","text":"function used define conditions certain questions survey shown. takes one formulas left-hand side condition right-hand side target question ID. called arguments, return NULL set conditions.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_show_if.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Define show conditions for survey questions — sd_show_if","text":"","code":"sd_show_if(...)"},{"path":"https://pkg.surveydown.org/reference/sd_show_if.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Define show conditions for survey questions — sd_show_if","text":"... One formulas defining show conditions. left-hand side formula condition based input values, right-hand side ID question show condition met.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_show_if.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Define show conditions for survey questions — sd_show_if","text":"list parsed conditions, element contains condition target question ID. Returns NULL conditions provided.","code":""},{"path":[]},{"path":"https://pkg.surveydown.org/reference/sd_show_if.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Define show conditions for survey questions — sd_show_if","text":"","code":"if (interactive()) { library(surveydown) # Get path to example survey file survey_path <- system.file(\"examples\", \"sd_show_if.qmd\", package = \"surveydown\") # Copy to a temporary directory temp_dir <- tempdir() file.copy(survey_path, file.path(temp_dir, \"survey.qmd\")) orig_dir <- getwd() setwd(temp_dir) # Define a minimal server server <- function(input, output, session) { sd_show_if( # If \"Other\" is chosen, show the conditional question input$fav_fruit == \"other\" ~ \"fav_fruit_other\" ) sd_server() } # Run the app shiny::shinyApp(ui = sd_ui(), server = server) # Clean up setwd(orig_dir) }"},{"path":"https://pkg.surveydown.org/reference/sd_show_password.html","id":null,"dir":"Reference","previous_headings":"","what":"Show the Saved Survey Password — sd_show_password","title":"Show the Saved Survey Password — sd_show_password","text":"function displays password saved .Renviron file SURVEYDOWN_PASSWORD variable. includes confirmation step ensure user wants display password console. password found, suggests using sd_set_password() function define password.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_show_password.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Show the Saved Survey Password — sd_show_password","text":"","code":"sd_show_password()"},{"path":"https://pkg.surveydown.org/reference/sd_show_password.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Show the Saved Survey Password — sd_show_password","text":"character string containing password found confirmed, message password saved along suggestion set one.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_show_password.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Show the Saved Survey Password — sd_show_password","text":"","code":"if (FALSE) { # \\dontrun{ surveydown::sd_show_password() } # }"},{"path":"https://pkg.surveydown.org/reference/sd_skip_if.html","id":null,"dir":"Reference","previous_headings":"","what":"Define skip conditions for survey pages — sd_skip_if","title":"Define skip conditions for survey pages — sd_skip_if","text":"function used define conditions certain pages survey skipped. takes one formulas left-hand side condition right-hand side target page ID.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_skip_if.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Define skip conditions for survey pages — sd_skip_if","text":"","code":"sd_skip_if(...)"},{"path":"https://pkg.surveydown.org/reference/sd_skip_if.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Define skip conditions for survey pages — sd_skip_if","text":"... One formulas defining skip conditions. left-hand side formula condition based input values, right-hand side ID page skip condition met.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_skip_if.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Define skip conditions for survey pages — sd_skip_if","text":"list parsed conditions, element contains condition target page ID.","code":""},{"path":[]},{"path":"https://pkg.surveydown.org/reference/sd_skip_if.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Define skip conditions for survey pages — sd_skip_if","text":"","code":"if (interactive()) { library(surveydown) # Get path to example survey file survey_path <- system.file(\"examples\", \"sd_skip_if.qmd\", package = \"surveydown\") # Copy to a temporary directory temp_dir <- tempdir() file.copy(survey_path, file.path(temp_dir, \"survey.qmd\")) orig_dir <- getwd() setwd(temp_dir) # Define a minimal server server <- function(input, output, session) { # Skip to page based on input sd_skip_if( input$fav_fruit == \"orange\" ~ \"orange_page\", input$fav_fruit == \"other\" ~ \"other_page\" ) sd_server() } # Run the app shiny::shinyApp(ui = sd_ui(), server = server) # Clean up setwd(orig_dir) }"},{"path":"https://pkg.surveydown.org/reference/sd_store_value.html","id":null,"dir":"Reference","previous_headings":"","what":"Store a value in the survey data — sd_store_value","title":"Store a value in the survey data — sd_store_value","text":"function allows storing additional values included survey data, respondent IDs metadata.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_store_value.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Store a value in the survey data — sd_store_value","text":"","code":"sd_store_value(value, id = NULL)"},{"path":"https://pkg.surveydown.org/reference/sd_store_value.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Store a value in the survey data — sd_store_value","text":"value value stored. can R object can coerced character string. id (Optional) Character string. id (name) value data. provided, name value variable used.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_store_value.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Store a value in the survey data — sd_store_value","text":"NULL (invisibly)","code":""},{"path":"https://pkg.surveydown.org/reference/sd_store_value.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Store a value in the survey data — sd_store_value","text":"","code":"if (interactive()) { library(surveydown) # Get path to example survey file survey_path <- system.file(\"examples\", \"sd_ui.qmd\", package = \"surveydown\") # Copy to a temporary directory temp_dir <- tempdir() file.copy(survey_path, file.path(temp_dir, \"basic_survey.qmd\")) orig_dir <- getwd() setwd(temp_dir) # Define a minimal server server <- function(input, output, session) { # Create a respondent ID to store respondentID <- 42 # Store the respondentID sd_store_value(respondentID) # Store the respondentID as the variable \"respID\" sd_store_value(respondentID, \"respID\") sd_server() } # Run the app shiny::shinyApp(ui = sd_ui(), server = server) # Clean up setwd(orig_dir) }"},{"path":"https://pkg.surveydown.org/reference/sd_ui.html","id":null,"dir":"Reference","previous_headings":"","what":"Create the UI for a surveydown survey — sd_ui","title":"Create the UI for a surveydown survey — sd_ui","text":"function creates user interface surveydown survey, including necessary CSS JavaScript files, applies custom styling. retrieves theme progress bar settings survey.qmd file.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_ui.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create the UI for a surveydown survey — sd_ui","text":"","code":"sd_ui()"},{"path":"https://pkg.surveydown.org/reference/sd_ui.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create the UI for a surveydown survey — sd_ui","text":"'shiny' UI object","code":""},{"path":"https://pkg.surveydown.org/reference/sd_ui.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create the UI for a surveydown survey — sd_ui","text":"function reads following settings survey.qmd YAML header: theme: theme applied survey. barcolor: color progress bar (valid hex color). barposition: position progress bar ('top', 'bottom', 'none'). barcolor specified NULL, default theme color used. barposition specified, defaults 'top'.","code":""},{"path":[]},{"path":"https://pkg.surveydown.org/reference/sd_ui.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create the UI for a surveydown survey — sd_ui","text":"","code":"if (interactive()) { library(surveydown) # Get path to example survey file survey_path <- system.file(\"examples\", \"sd_ui.qmd\", package = \"surveydown\") # Copy to a temporary directory temp_dir <- tempdir() file.copy(survey_path, file.path(temp_dir, \"survey.qmd\")) orig_dir <- getwd() setwd(temp_dir) # Define a minimal server server <- function(input, output, session) { sd_server() } # Run the app shiny::shinyApp(ui = sd_ui(), server = server) # Clean up setwd(orig_dir) }"},{"path":"https://pkg.surveydown.org/reference/sd_version.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Surveydown Version — sd_version","title":"Check Surveydown Version — sd_version","text":"function checks local surveydown package --date latest online version. compares local version latest version available GitHub provides information whether update needed.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_version.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Surveydown Version — sd_version","text":"","code":"sd_version()"},{"path":"https://pkg.surveydown.org/reference/sd_version.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Surveydown Version — sd_version","text":"return value, called side effects (prints version information update status console).","code":""},{"path":"https://pkg.surveydown.org/reference/sd_version.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Surveydown Version — sd_version","text":"","code":"surveydown::sd_version() #> surveydown (local): 0.5.1 #> surveydown (latest): 0.5.1 #> #> surveydown is up to date."},{"path":[]},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-051","dir":"Changelog","previous_headings":"","what":"surveydown 0.5.1","title":"surveydown 0.5.1","text":"Revert mostly v0.4.2 completely remove cookies feature added v0.5.0. re-implement new approach later version. Fixed typo error message (data.csv -> preview_data.csv).","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-050","dir":"Changelog","previous_headings":"","what":"surveydown 0.5.0","title":"surveydown 0.5.0","text":"CRAN release: 2024-11-25 New cookies feature! Now sd_server() accepts new argument use_cookies, defaults TRUE. enables cookies reopening survey resume participant survey left. database trace original session_id continuous data update based user input. changed FALSE, survey start brand new session upon reopening. -line data storage upgrade. Now ignore mode , data stored project directory file name called preview_data.csv. file works exactly online database, compatible cookies functionality. Simplified Chinese supported sd_server(). can trigger : sd_server(language = \"zh-CN\"). Improvement: default language behavior UI functions cleaner separately rendering survey.qmd file. Bug fix: used bug multiple themes defined YAML. Now ’s solved.","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-042","dir":"Changelog","previous_headings":"","what":"surveydown 0.4.2","title":"surveydown 0.4.2","text":"New “translations” feature now supported (see PR #138). allows system messages date formats specified language using language argument sd_server(). Custom language messages can modified providing translations.yml file root project folder. Added new sd_create_translations() function generate template translations.yml file use edit system messages. Added Stefan Munnes contributor DESCRIPTION file (ctb) Bug fix: is_matrix metadata recorded matrix sub-questions exported _survey/questions.yml file, caused error matrix question required. now corrected obtaining question structure stored _survey/questions.yml file.","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-041","dir":"Changelog","previous_headings":"","what":"surveydown 0.4.1","title":"surveydown 0.4.1","text":"Modified survey rendering move rendered files “_survey” folder. Export survey question metadata “_survey/questions.yml” file (see #132). Survey content now extracted saved ’_survey/pages.rds’, ’_survey/head.rds’, ’_survey/questions.yml’ files faster loading. Survey load content stored files changes detected ‘survey.qmd’ ‘app.R’ files.","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-040","dir":"Changelog","previous_headings":"","what":"surveydown 0.4.0","title":"surveydown 0.4.0","text":"CRAN release: 2024-11-01 examples updated include run-able examples (possible). Added example survey.qmd files inst/examples (use function examples). roxygen documentation reviewed errors / typos. Removed sd_update() function. Removed sd_deploy() function. Installation instructions updated.","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-037","dir":"Changelog","previous_headings":"","what":"surveydown 0.3.7","title":"surveydown 0.3.7","text":"Updated sd_output() now able output chosen question values, chosen question option label(s), question label . Addresses feature request #128. Enhance: sd_update() now directly force update package without checking version difference anymore. New: sd_is_answered() function check question answered returns TRUE FALSE accordingly. \"matrix\" type, sub-questions answered marked TRUE.","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-036","dir":"Changelog","previous_headings":"","what":"surveydown 0.3.6","title":"surveydown 0.3.6","text":"Enhance: sd_add_question() now chunk argument, TRUE include outer chunk wrapper. Default FALSE. Enhance: matrix question type now root question id shown data sheet. id essential logic, example can used handle sd_show_if() logic. root id also removed all_question_required logic, since ’s handle doesn’t provide option answer. Enhance: Removed use_html argument sd_server(). Now survey.qmd file always rendered app runs one two conditions met: 1) survey.html file detected, 2) survey.html file outdated. Otherwise, use rendered survey.html file. Bug fix: auto_scroll now works better smoother. Bug fix: enter key trigger page turn working text, textarea, numeric, select, date, daterange. Enhance: Enter key can now used trigger “Submit Exit” button rating pop-modal.","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-035","dir":"Changelog","previous_headings":"","what":"surveydown 0.3.5","title":"surveydown 0.3.5","text":"Enhance: database updating simplified write database page turn survey closes. Bug fix: added new questions values survey creating initial database table, new values added table. Now added. Enhance: auto_scroll changed FALSE default.","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-034","dir":"Changelog","previous_headings":"","what":"surveydown 0.3.4","title":"surveydown 0.3.4","text":"Bug fix: reactive questions now work show_if conditions Bug fix: show_if conditions now work even target question different page. Bug fix: reactive question ids (defined server) considered check_skip_show() checks, ’d get error question id invalid. Enhance: sd_server() accepts new parameter called \"rate_survey\", default FALSE. TRUE, Exit button trigger rating question. FALSE, Exit button trigger double confirmation ensure user really wants exit. Enhance: Now survey check exists sd_close() function call. Enhance: Now survey check reserved question IDs used, including session_id, time_start, time_end, exit_survey_rating. future. Enhance: Now sd_output() function take care styling setting reactive questions. example, sd_output(id = \"some_question_id\", type = \"question\", width = \"80%\") define 80% reactive question. Enhance: Now sd_show_if() can take care cross-page conditional reactive questions.","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-033","dir":"Changelog","previous_headings":"","what":"surveydown 0.3.3","title":"surveydown 0.3.3","text":"Enhance: sd_server() now new parameter called auto_scroll. ’s default TRUE, enables auto scrolling tracks user’s input, can turned changing FALSE. Thanks contribution Zain Hoda. Enhance: sd_question() now \"matrix\" type. documentation page updated. Enhance: Asterisk, indication required questions, now moved top right corner question containers. Enhance: Replaced default shiny alert sweetalert.","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-032","dir":"Changelog","previous_headings":"","what":"surveydown 0.3.2","title":"surveydown 0.3.2","text":"New: Added sd_completion_code() function. Bug fix: make stored values accessible sd_output() type = 'value' argument. Previously question values displayed UI sd_output(). New: sd_add_question() instantly create question template. Defaults type \"mc\" also accepts types (\"text\", \"textarea\", \"numeric\", etc.). function call delete running. New: sd_add_page() instantly create page template. Make sure run function outside division code chunk. function call delete running.","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-031","dir":"Changelog","previous_headings":"","what":"surveydown 0.3.1","title":"surveydown 0.3.1","text":"Enhance: Improved efficiency database_uploading() changed fields get written, also writing happens checking show_if conditions (addresses #100). Enhance: Modified default rendering behavior delete rendered html file. Enhance: Modified refresh_interval argument sd_get_data() defaulting NULL, means data reactively fetched, regardless context used . data continuously refresh sd_get_data() called within reactive context refresh_interval > 0. Enhance: Modified messaging sd_set_password() print user’s password provide clearer instructions. New: sd_show_password() added show stored password. user prompted double confirm want show . password, user prompted , along message using sd_set_password() create password.","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-030","dir":"Changelog","previous_headings":"","what":"surveydown 0.3.0","title":"surveydown 0.3.0","text":"Introduced sd_ui() function set placeholders shiny app ui. Heavily revised skip_if show_if works, removing skip_if_custom show_if_custom. Now work similar case_when() function, provide formula condition ~ target condition either function. also provided globally inside server() function using sd_skip_if() sd_show_if(). Require survey file named \"survey.qmd\". Added sd_include_folder() function users can add folder shiny resource path. Automatically include images, js, css, www folders well folders quarto files shiny resource path package loads. Heavily modified sd_next() works improve page navigation ensure sd_next() button unique id based current page. Removed quarto extension. sd_create_survey() changed sourcing template directly package. Two parameters provided. first parameter path, defines relative path target. left blank, path current working directory. second parameter structure, defines structure template user wants choose, default \"single\" can changed \"multi\". sd_deploy() wrapper function rsconnect::deployApp() deploy survey. sd_update() replacement sd_update_surveydown() update package. sd_version() replacement sd_check_versions() check current version latest version. sd_close() function create close button survey.","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-024","dir":"Changelog","previous_headings":"","what":"surveydown 0.2.4","title":"surveydown 0.2.4","text":"need use Next button anymore. Next buttons can now chunk questions spacing added. Modified margins top bottom. Solved large gap created hidden questions. Fixed issue sd_store_value(). used problem value list multiple entries. Now collapsed commas due application format_question_value() value variable. Removed reactive argument sd_get_data(). Now functions compatible reactive (server) static (ui) conditions automatically match, without necessity explicitly specifying . sd_redirect() updated parameter called newtab, defaults FALSE. TRUE, redirection link opened new tab. used together delay, new tab might blocked browser count-, user click blocked. Improved database_uploading() function secure possible SQL injection attacks.","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-023","dir":"Changelog","previous_headings":"","what":"surveydown 0.2.3","title":"surveydown 0.2.3","text":"Solved speed problem database connections: refactored sd_server() efficiency; converted local data storage lists instead data frames. Assigned session_id leading column, removed respondent_id column.","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-022","dir":"Changelog","previous_headings":"","what":"surveydown 0.2.2","title":"surveydown 0.2.2","text":"sd_redirect() create redirection external links, either providing button, countdown, . function can called survey body server chunk. sd_get_url_pars() reactively get parameters URL. 3 functions work together retrieve redirect URL parameters surveydown compatible survey panels. Now sd_next() sd_redirect() support “Enter” key better user experience. Add automatic clean sd_database(). sd_output() function replaces original sd_display_question() (specifying type = \"question\") sd_display_value() (specifying type = \"value\"). original 2 functions depreciated removed future updates. sd_output() used \"id\" specified, works shiny::uiOutput().","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-021","dir":"Changelog","previous_headings":"","what":"surveydown 0.2.1","title":"surveydown 0.2.1","text":"sd_database(), now db_name changed dbname, table_name changed table, consistency Supabase, simplicity parameter names. Now error message sd_database() also prompt “verified connection details correct still access database, consider setting gssencmode parameter \"disable\" sd_database() function.” don’t encourage users disable gssencmode, since ’s secure , users encounter connection error, possible solution. Bug fix: bug introduced restructuring sd_server() function last update affected numeric questions determined answered , now fixed. Fixed issue #80: sd_display_value() used multiple times different question IDs, fetch last user input. Now ’s fixed. Renamed main lua file inst/quarto/filters surveydown.lua sd_main.lua updated extension v0.2.5 call via robust, cross-platform approach. (Extension) Renamed extension lua filter sd_wrapper.lua avoid naming conflict. Now extension used wrapper. sd_main.lua related CSS JS files R package.","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-020","dir":"Changelog","previous_headings":"","what":"surveydown 0.2.0","title":"surveydown 0.2.0","text":"Moved sd_store_value() sd_copy_value() server.R file (server operations). Added respondent_id variable tracks respondent based starting survey. Restructure server efficient. Now required questions can successfully bypass hidden required questions types.","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-012","dir":"Changelog","previous_headings":"","what":"surveydown 0.1.2","title":"surveydown 0.1.2","text":"Moved main surveydown.lua file package inst/quarto/filters. surveydown Quarto extension now just wrapper load file, extension won’t likely need update updates can made package lua file. Changed jhelvy surveydown-dev version control functions. Now duplicated page_id question_id, survey stop show error. Removed roxygen2 documentation non-exported functions.","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-011","dir":"Changelog","previous_headings":"","what":"surveydown 0.1.1","title":"surveydown 0.1.1","text":"Added sd_get_data() reactive argument enable reactive data fetching. sd_question() now reactive argument enable reactive questions, sd_question_reactive() removed. Made sd_admin_enable() internal, changed admin_enable(). Removed sd_admin_ui() sd_add_admin() package. Moved surveydown.css page_nav.js files R package Quarto extension. Added keep alive functionality survey. admin page password looking SUPABASE_PASSWORD environment variable, SURVEYDOWN_PASSWORD. data fetching working download data CSV file admin page, now uses sd_get_data() works. show_if_custom logic working multiple conditions, now . skip_if_custom logic error condition NULL (fixed isTRUE()). sd_config(), items assigned <- operator, causing deleted thing assigned NULL. Now changed =.","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-010","dir":"Changelog","previous_headings":"","what":"surveydown 0.1.0","title":"surveydown 0.1.0","text":"Added sd_display_value() displaying question value based question id. Added sd_copy_value() making copy question value, may needed need display something since can’t make one object id. Changed sd_reactive_output() sd_display_question(). Changed sd_store_value() works avoid global environment, changed arg name name id. Added sd_add_admin() function react admin_page condition, set true ‘Admin’ page created survey creators. Added sd_admin_ui() function create UI Admin page button. (extension) JS files removed extension R package. Now extension contains .lua file css styles.","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-009","dir":"Changelog","previous_headings":"","what":"surveydown 0.0.9","title":"surveydown 0.0.9","text":"Required questions now moved sd_config() separate required_questions argument, instead defined sd_question(). Two new functions supporting reactive questions: sd_question_reactive() sd_reactive_output(). sd_store_value() function store variables database. example, sd_store_value(respondentID, \"respID\") store value respondentID column named \"respID\". name provided, column named original variable name, case, respondentID. Enhanced robustness progress bar. Now progress bar update based user’s input. Added timestamp column beginning result dataframe. Now Mac PC problem connecting supabase. Updated roxygen2 documentation texts.","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-008","dir":"Changelog","previous_headings":"","what":"surveydown 0.0.8","title":"surveydown 0.0.8","text":"sd_database() function added pause argument default FALSE. pause = FALSE, database properly connected; pause = TRUE, local CSV generated survey results stored . sd_config() function preview removed due pause sd_database. pause = FALSE (aka default), warning messages shown missing incorrect password, prompt usage sd_set_password(). Initiation admin_page argument config.R.","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-007","dir":"Changelog","previous_headings":"","what":"surveydown 0.0.7","title":"surveydown 0.0.7","text":"sd_set_password() function set supabase password survey environment variable. function takes string, supabase password. recommend run R Console password appear .qmd file. (Continue) Upon running sd_set_password(), .Renviron file created survey project root directory. file, SUPABASE_PASSWORD=your_password created, your_password whatever input sd_set_password(). , .Renviron added .gitignore file avoid pushed GitHub. (Continue) already .Renviron file, SUPABASE_PASSWORD=your_password concatenated end. already definition SUPABASE_PASSWORD, overwritten. .gitignore file, created. already .Renviron .gitignore, won’t duplicated. (Continue) explanation means simply run sd_set_password() define supabase password survey project. takes care rest necessary operations, can rerun sd_set_password() change password, previous value safely overwritten.","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-006","dir":"Changelog","previous_headings":"","what":"surveydown 0.0.6","title":"surveydown 0.0.6","text":"sd_database, gssencmode argument added set “prefer” default. cases, local deployment may fail due network environments VPN settings. can solved setting gssencmode = \"disable\" survey qmd file. Now survey can updated even deployment. may add, delete, modify question. old question column time stamp, stay . new question column time stamp concatenated end table. (extension) Now example.qmd survey instructions supabase configuration shinyapps deployment. (extension) Now .gitignore file .Renviron included. file store supabase password essential shinyapps deployment. Eliminating file pushing GitHub ensure password saved locally.","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-005","dir":"Changelog","previous_headings":"","what":"surveydown 0.0.5","title":"surveydown 0.0.5","text":"create_survey() changed sd_create_survey() function name consistency. sd_update_extension() function update surveydown Quarto extension. sd_check_versions() function check version R package Quarto extension. don’t match latest version, suggestion run sd_update_surveydown() function. sd_update_surveydown() function update R package Quarto extension.","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-004","dir":"Changelog","previous_headings":"","what":"surveydown 0.0.4","title":"surveydown 0.0.4","text":"(extension) Raleway Font set default font survey pages. Can overwritten YAML header theme command using bootswatch themes custom scss file. (extension) Default page background set “#f2f6f9” (light blue color). Can overwritten YAML header backgroundcolor. (extension) Questions now encapsulated container distinguishes descriptive texts. (extension) Options mc_button mu_multiple_buttons types questions now centered. Now surveydown::create_survey() function download whole extension repo, containing extension, example survey, RStudio project.","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-003","dir":"Changelog","previous_headings":"","what":"surveydown 0.0.3","title":"surveydown 0.0.3","text":"Now show_if can applied multiple options question, allows users one option question triggers revealing hidden question. Now “required” question hidden, trigger page warning “questions answered”. (extension) Now users can page name ID header, regardless capitalization. example, users can now page ID “#educational”, header “#Educational”. sounds , previous versions, page hiding logic show bug page ID page header.","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-002","dir":"Changelog","previous_headings":"","what":"surveydown 0.0.2","title":"surveydown 0.0.2","text":"Support added required argument sd_question(), allows users force question required. answered, popup window blocks user continuing next page. supabase backend now connected documentation set database complete. Initial setup tests added","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-001","dir":"Changelog","previous_headings":"","what":"surveydown 0.0.1","title":"surveydown 0.0.1","text":"Initial version!","code":""}]
+[{"path":[]},{"path":"https://pkg.surveydown.org/CODE_OF_CONDUCT.html","id":"our-pledge","dir":"","previous_headings":"","what":"Our Pledge","title":"Contributor Covenant Code of Conduct","text":"members, contributors, leaders pledge make participation community harassment-free experience everyone, regardless age, body size, visible invisible disability, ethnicity, sex characteristics, gender identity expression, level experience, education, socio-economic status, nationality, personal appearance, race, religion, sexual identity orientation. pledge act interact ways contribute open, welcoming, diverse, inclusive, healthy community.","code":""},{"path":"https://pkg.surveydown.org/CODE_OF_CONDUCT.html","id":"our-standards","dir":"","previous_headings":"","what":"Our Standards","title":"Contributor Covenant Code of Conduct","text":"Examples behavior contributes positive environment community include: Demonstrating empathy kindness toward people respectful differing opinions, viewpoints, experiences Giving gracefully accepting constructive feedback Accepting responsibility apologizing affected mistakes, learning experience Focusing best just us individuals, overall community Examples unacceptable behavior include: use sexualized language imagery, sexual attention advances kind Trolling, insulting derogatory comments, personal political attacks Public private harassment Publishing others’ private information, physical email address, without explicit permission conduct reasonably considered inappropriate professional setting Providing bad information copying output AI assistants without verifying validity","code":""},{"path":"https://pkg.surveydown.org/CODE_OF_CONDUCT.html","id":"enforcement-responsibilities","dir":"","previous_headings":"","what":"Enforcement Responsibilities","title":"Contributor Covenant Code of Conduct","text":"Community leaders responsible clarifying enforcing standards acceptable behavior take appropriate fair corrective action response behavior deem inappropriate, threatening, offensive, harmful. Community leaders right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct, communicate reasons moderation decisions appropriate.","code":""},{"path":"https://pkg.surveydown.org/CODE_OF_CONDUCT.html","id":"scope","dir":"","previous_headings":"","what":"Scope","title":"Contributor Covenant Code of Conduct","text":"Code Conduct applies within community spaces, also applies individual officially representing community public spaces. Examples representing community include using official e-mail address, posting via official social media account, acting appointed representative online offline event.","code":""},{"path":"https://pkg.surveydown.org/CODE_OF_CONDUCT.html","id":"enforcement","dir":"","previous_headings":"","what":"Enforcement","title":"Contributor Covenant Code of Conduct","text":"Instances abusive, harassing, otherwise unacceptable behavior may reported community leaders responsible enforcement codeofconduct@rstudio.com. complaints reviewed investigated promptly fairly. community leaders obligated respect privacy security reporter incident.","code":""},{"path":"https://pkg.surveydown.org/CODE_OF_CONDUCT.html","id":"enforcement-guidelines","dir":"","previous_headings":"","what":"Enforcement Guidelines","title":"Contributor Covenant Code of Conduct","text":"Community leaders follow Community Impact Guidelines determining consequences action deem violation Code Conduct:","code":""},{"path":"https://pkg.surveydown.org/CODE_OF_CONDUCT.html","id":"id_1-correction","dir":"","previous_headings":"Enforcement Guidelines","what":"1. Correction","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Use inappropriate language behavior deemed unprofessional unwelcome community. Consequence: private, written warning community leaders, providing clarity around nature violation explanation behavior inappropriate. public apology may requested.","code":""},{"path":"https://pkg.surveydown.org/CODE_OF_CONDUCT.html","id":"id_2-warning","dir":"","previous_headings":"Enforcement Guidelines","what":"2. Warning","title":"Contributor Covenant Code of Conduct","text":"Community Impact: violation single incident series actions. Consequence: warning consequences continued behavior. interaction people involved, including unsolicited interaction enforcing Code Conduct, specified period time. includes avoiding interactions community spaces well external channels like social media. Violating terms may lead temporary permanent ban.","code":""},{"path":"https://pkg.surveydown.org/CODE_OF_CONDUCT.html","id":"id_3-temporary-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"3. Temporary Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: serious violation community standards, including sustained inappropriate behavior. Consequence: temporary ban sort interaction public communication community specified period time. public private interaction people involved, including unsolicited interaction enforcing Code Conduct, allowed period. Violating terms may lead permanent ban.","code":""},{"path":"https://pkg.surveydown.org/CODE_OF_CONDUCT.html","id":"id_4-permanent-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"4. Permanent Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Demonstrating pattern violation community standards, including sustained inappropriate behavior, harassment individual, aggression toward disparagement classes individuals. Consequence: permanent ban sort public interaction within community.","code":""},{"path":"https://pkg.surveydown.org/CODE_OF_CONDUCT.html","id":"attribution","dir":"","previous_headings":"","what":"Attribution","title":"Contributor Covenant Code of Conduct","text":"Code Conduct adapted Contributor Covenant, version 2.0, available https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. Community Impact Guidelines inspired Mozilla’s code conduct enforcement ladder. answers common questions code conduct, see FAQ https://www.contributor-covenant.org/faq. Translations available https://www.contributor-covenant.org/translations.","code":""},{"path":"https://pkg.surveydown.org/CONTRIBUTING.html","id":null,"dir":"","previous_headings":"","what":"Contributing to Surveydown","title":"Contributing to Surveydown","text":"welcome contributions Surveydown! can contribute many ways: opening issues provide feedback share ideas. fixing typos documentation submitting Pull Request (PR) fix opened issues submitting Pull Request (PR) suggest new features (considered good practice open issue discussion working pull request new feature).","code":""},{"path":"https://pkg.surveydown.org/CONTRIBUTING.html","id":"to-submit-a-contribution-using-a-pull-request","dir":"","previous_headings":"","what":"To submit a contribution using a Pull Request","title":"Contributing to Surveydown","text":"Fork repository, clone locally, make changes new branch specific PR. example: Submit pull request. ok submit draft still working like feedback us. always good share open working . ’ll try responsive possible reviewing accepting pull requests. much appreciate contributions!","code":"# clone your fork $ git clone https://github.com//surveydown # configure for your platform (./configure.sh for linux/mac or ./configure.cmd for Windows) $ cd quarto-cli $ ./configure.sh # checkout a new branch $ git checkout -b bugfix/myfix"},{"path":"https://pkg.surveydown.org/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2024 John Paul Helveston, Pingfan Hu, Bogdan Bunea Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://pkg.surveydown.org/articles/surveydown.html","id":"main-documentation","dir":"Articles","previous_headings":"","what":"Main Documentation","title":"Introduction to surveydown","text":"main documentation surveydown https://surveydown.org/. recommend navigating detailed documentation R package use build dynamic surveys.","code":""},{"path":"https://pkg.surveydown.org/articles/surveydown.html","id":"overview","dir":"Articles","previous_headings":"Main Documentation","what":"Overview","title":"Introduction to surveydown","text":"Every surveydown survey composed survey app, defined two separate files: survey.qmd: Quarto document contains survey content (pages, questions, etc), renders HTML file. app.R: R script defining Shiny app contains global settings (libraries, database configuration, etc.) server configuration options (e.g., conditional skipping / display, etc.). files must named survey.qmd app.R. {surveydown} R package provides set functions defining survey content configuration options. function starts sd_ make easy identify. platform based basic principles: Add content survey.qmd file using markdown text (RStudio use visual editor). Define survey questions R code chunks sd_question() function. Define pages using fences (:::), navigation buttons handled using sd_next() function. Add rich functionality survey using variety server options conditional control logic server() function app.R file. Store respondent data database (see Store Data). approach ensures flexible survey platform fully reproducible easy customize. remaining steps page guide process creating surveydown survey.","code":""},{"path":[]},{"path":"https://pkg.surveydown.org/articles/surveydown.html","id":"install-r-quarto","dir":"Articles","previous_headings":"Main Documentation > 1. Installation","what":"Install R & Quarto","title":"Introduction to surveydown","text":"R Quarto also recommend working IDE good support R, Quarto, Shiny. RStudio great, also like VSCode Positron.","code":""},{"path":"https://pkg.surveydown.org/articles/surveydown.html","id":"install-the-surveydown-r-package","dir":"Articles","previous_headings":"Main Documentation > 1. Installation","what":"Install the {surveydown} R package","title":"Introduction to surveydown","text":"can install {surveydown} CRAN R console: can install development version GitHub: Load package : can also check version installed:","code":"install.packages(\"surveydown\") # install.packages(\"pak\") pak::pak('surveydown-dev/surveydown') library(surveydown) surveydown::sd_version()"},{"path":"https://pkg.surveydown.org/articles/surveydown.html","id":"start-with-a-template","dir":"Articles","previous_headings":"Main Documentation","what":"2. Start with a template","title":"Introduction to surveydown","text":"See Template page.","code":""},{"path":"https://pkg.surveydown.org/articles/surveydown.html","id":"add-survey-content-in-your-survey-qmd-file","dir":"Articles","previous_headings":"Main Documentation","what":"3. Add survey content in your survey.qmd file","title":"Introduction to surveydown","text":"See Survey Components page details main components surveydown survey. quick overview, ’s add pages questions: Add pages fences, like : Add questions sd_question() function code chunks (see Question Types page types questions supported). example, ’s multiple choice question:","code":"::: {#page1 .sd-page} Page 1 content here ::: sd_question( type = 'mc', id = 'penguins', label = \"Which is your favorite type of penguin?\", option = c( 'Adélie' = 'adelie', 'Chinstrap' = 'chinstrap', 'Gentoo' = 'gentoo' ) )"},{"path":"https://pkg.surveydown.org/articles/surveydown.html","id":"add-control-options","dir":"Articles","previous_headings":"Main Documentation","what":"4. Add control options","title":"Introduction to surveydown","text":"server() function app.R file, add rich functionality survey using variety server options conditional control logic.","code":""},{"path":"https://pkg.surveydown.org/articles/surveydown.html","id":"setup-your-database","dir":"Articles","previous_headings":"Main Documentation","what":"5. Setup your database","title":"Introduction to surveydown","text":"global settings top app.R file, setup database sd_database() function. can also leave blank preview / edit survey without database connected, set ignore = TRUE run survey without storing data. See Store Data page details.","code":""},{"path":"https://pkg.surveydown.org/articles/surveydown.html","id":"locally-preview","dir":"Articles","previous_headings":"Main Documentation","what":"6. Locally preview","title":"Introduction to surveydown","text":"Preview survey clicking “Run App” button RStudio R console running runApp() command.","code":""},{"path":"https://pkg.surveydown.org/articles/surveydown.html","id":"deploy","dir":"Articles","previous_headings":"Main Documentation","what":"7. Deploy","title":"Introduction to surveydown","text":"Deploy survey hosting favorite server, like {{< var shinyapps >}}, {{< var huggingface >}}, Posit Connect Cloud, Heroku, etc. See Deployment page details.","code":""},{"path":"https://pkg.surveydown.org/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"John Paul Helveston. Author, maintainer, copyright holder. Pingfan Hu. Author, copyright holder. Bogdan Bunea. Author, copyright holder. Stefan Munnes. Contributor.","code":""},{"path":"https://pkg.surveydown.org/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Helveston J, Hu P, Bunea B (2024). surveydown: Markdown-Based Surveys Using Quarto Shiny. R package, https://surveydown.org/.","code":"@Manual{, title = {surveydown: Markdown-Based Surveys Using Quarto And Shiny}, author = {John Paul Helveston and Pingfan Hu and Bogdan Bunea}, year = {2024}, note = {R package}, url = {https://surveydown.org/}, }"},{"path":"https://pkg.surveydown.org/index.html","id":"surveydown","dir":"","previous_headings":"","what":"Build markdown-based surveys with quarto shiny documents","title":"Build markdown-based surveys with quarto shiny documents","text":"Note: site documents {surveydown} R package - visit main site surveydown.org information! surveydown flexible, open-source platform making surveys R, Quarto, Shiny, Supabase. basic concept : Design survey Quarto document using markdown R code. Convert survey Shiny app can hosted online sent respondents. Store survey responses Supabase database (Postgres database). {surveydown} R package provides functions bring together. See documentation get started making surveydown survey!","code":""},{"path":[]},{"path":"https://pkg.surveydown.org/index.html","id":"install-r--quarto","dir":"","previous_headings":"","what":"Install R & Quarto","title":"Build markdown-based surveys with quarto shiny documents","text":"R Quarto also recommend working IDE good support R, Quarto, Shiny. RStudio great, also like VSCode Positron.","code":""},{"path":"https://pkg.surveydown.org/index.html","id":"install-the-surveydown-r-package","dir":"","previous_headings":"","what":"Install the {surveydown} R package","title":"Build markdown-based surveys with quarto shiny documents","text":"can install {surveydown} CRAN R console: can install development version GitHub: Load package : can also check version installed:","code":"install.packages(\"surveydown\") # install.packages(\"pak\") pak::pak('surveydown-dev/surveydown') library(surveydown) surveydown::sd_version()"},{"path":"https://pkg.surveydown.org/index.html","id":"background--motivation","dir":"","previous_headings":"","what":"Background & Motivation","title":"Build markdown-based surveys with quarto shiny documents","text":"survey platforms (e.g., Google forms, Qualtrics, etc.) use drag--drop interfaces design surveys, making version control collaboration others difficult. ’re also reproducible (others easily reproduce survey made platforms), many require paid subscription license use. surveydown package designed address problems. open-source, markdown-based platform, survey content defined plain text (markdown R code) survey.qmd file app.R file renders survey Shiny app can hosted online. makes survey easy reproduce, share, version control common tools like Git. survey data collected also owned survey designer separate Postgres database (recommend Supabase free open-source database provider). ’re curious whole idea came , check blog post, outlines general idea motivation . post now outdated terms overall package design, provides something origin story motivation developing project.","code":""},{"path":"https://pkg.surveydown.org/index.html","id":"todo-list","dir":"","previous_headings":"","what":"TODO List","title":"Build markdown-based surveys with quarto shiny documents","text":"running list things ’re working / already added project: show_if (conditionally display question) skip_if (conditionally skip page) Set defaults questions choices selected launch. Ability embed markdown inside choice options (like mc buttons formr) Option ignore = TRUE setting (database connection ignored) Automatically include timestamps page question interaction data Option start designated page, e.g. start_page = 'page_name' show_all_pages = TRUE argument show pages hidden questions launched (e.g. able print entire survey text). also sd_print_survey() function print pdf. Set SCSS compatible Quarto-supported bootstrap themes. Include optional progress bar. Include input checks skip_if show_if (question_id exists, data frame names correct) Required questions: post popup question required allowing next button. Add sd_get_data() function survey designer can obtain current survey results inside app: https://shinysurveys.jdtrat.com/articles/get-survey-data.html Ability pass url parameters, e.g. tracking users. Ability redirect users another url. Leverage cookies users close browser can start back left . Admin page w/password preview / download data (see https://github.com/daattali/shinyforms) Form validation: Make sure user inputs correct type depending question type. (see https://shiny.posit.co/r/reference/shiny/0.14/validate.html) Multiple choice (single choice) Multiple choice (multiple choices) Select Text Numeric Multiple choice (button…like formr mc_button) Text area Date Slider Matrix Best worst Resources / related examples: shinysurveys shinyforms","code":""},{"path":[]},{"path":"https://pkg.surveydown.org/index.html","id":"citation-information","dir":"","previous_headings":"","what":"Citation Information","title":"Build markdown-based surveys with quarto shiny documents","text":"use package publication, please cite ! can get citation typing citation(\"surveydown\") R:","code":"citation(\"surveydown\")"},{"path":"https://pkg.surveydown.org/reference/sd_add_page.html","id":null,"dir":"Reference","previous_headings":"","what":"Add a Page Template to the Current Document — sd_add_page","title":"Add a Page Template to the Current Document — sd_add_page","text":"function inserts template surveydown page current cursor position active RStudio document. provides basic structure new page, including title, content area, next button. function call exists document, removed inserting template.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_add_page.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add a Page Template to the Current Document — sd_add_page","text":"","code":"sd_add_page()"},{"path":"https://pkg.surveydown.org/reference/sd_add_page.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add a Page Template to the Current Document — sd_add_page","text":"function return value. modifies active document side effect inserting text potentially removing function call.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_add_page.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add a Page Template to the Current Document — sd_add_page","text":"IMPORTANT: function run outside division R code chunk 'Quarto' document. Running inside division code chunk may result incorrect page structure. function performs following steps: Checks removes existing sd_add_page() function call document. Inserts template current cursor position. template includes: div class 'sd-page' placeholder page ID placeholder page title placeholder page contents R code chunk placeholder questions next button","code":""},{"path":"https://pkg.surveydown.org/reference/sd_add_page.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add a Page Template to the Current Document — sd_add_page","text":"","code":"if (interactive()) { library(surveydown) # Insert a new page template sd_add_page() }"},{"path":"https://pkg.surveydown.org/reference/sd_add_question.html","id":null,"dir":"Reference","previous_headings":"","what":"Add a Question Template to the Current Document — sd_add_question","title":"Add a Question Template to the Current Document — sd_add_question","text":"function inserts template surveydown question current cursor position active RStudio document. supports various question types automatically removes function call inserting template exists document.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_add_question.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add a Question Template to the Current Document — sd_add_question","text":"","code":"sd_add_question(type = \"mc\", chunk = FALSE)"},{"path":"https://pkg.surveydown.org/reference/sd_add_question.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add a Question Template to the Current Document — sd_add_question","text":"type character string specifying type question template insert. Default \"mc\" (multiple choice). Available options : \"mc\": Multiple choice (single selection) \"select\": Dropdown selection \"mc_multiple\": Multiple choice (multiple selections) \"mc_buttons\": Multiple choice button layout (single selection) \"mc_multiple_buttons\": Multiple choice button layout (multiple selections) \"text\": Short text input \"textarea\": Long text input \"numeric\": Numeric input \"slider\": Slider input \"date\": Date input \"daterange\": Date range input chunk Logical. TRUE, code generated R code chunk wrapper. Defaults FALSE.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_add_question.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add a Question Template to the Current Document — sd_add_question","text":"function return value. modifies active document side effect inserting text potentially removing function call.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_add_question.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add a Question Template to the Current Document — sd_add_question","text":"function performs following steps: Checks removes existing sd_add_question() function call document. Inserts appropriate question template current cursor position.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_add_question.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add a Question Template to the Current Document — sd_add_question","text":"","code":"if (interactive()) { library(surveydown) # Insert a default multiple choice question template sd_add_question() # Insert a text input question template sd_add_question(\"text\") # Insert a slider question template sd_add_question(\"slider\") }"},{"path":"https://pkg.surveydown.org/reference/sd_close.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a 'Close' Button to Exit the Survey — sd_close","title":"Create a 'Close' Button to Exit the Survey — sd_close","text":"function creates 'Close' button , clicked, trigger exit process survey. Depending server-side configuration, may show rating question simple confirmation dialog attempting close current browser tab window.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_close.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a 'Close' Button to Exit the Survey — sd_close","text":"","code":"sd_close(label = NULL)"},{"path":"https://pkg.surveydown.org/reference/sd_close.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a 'Close' Button to Exit the Survey — sd_close","text":"label Character string. label 'Close' button. Defaults NULL, case word \"Exit Survey\" used.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_close.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a 'Close' Button to Exit the Survey — sd_close","text":"'shiny' tagList containing 'Close' button UI element associated JavaScript exit process.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_close.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create a 'Close' Button to Exit the Survey — sd_close","text":"function generates 'shiny' action button , clicked, triggers 'show_exit_modal' event. server-side logic (controlled rate_survey parameter sd_server()) determines whether show rating question simple confirmation dialog. function also includes custom message handler closing window. necessary browsers may allow JavaScript close windows opened JavaScript. cases, user prompted close tab manually.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_close.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Create a 'Close' Button to Exit the Survey — sd_close","text":"actual behavior exit process (whether show rating question ) controlled rate_survey parameter sd_server() function, UI function.","code":""},{"path":[]},{"path":"https://pkg.surveydown.org/reference/sd_close.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a 'Close' Button to Exit the Survey — sd_close","text":"","code":"if (interactive()) { library(surveydown) # Get path to example survey file survey_path <- system.file(\"examples\", \"sd_close.qmd\", package = \"surveydown\") # Copy to a temporary directory temp_dir <- tempdir() file.copy(survey_path, file.path(temp_dir, \"survey.qmd\")) orig_dir <- getwd() setwd(temp_dir) # Define a minimal server server <- function(input, output, session) { sd_server() } # Run the app shiny::shinyApp(ui = sd_ui(), server = server) # Clean up setwd(orig_dir) }"},{"path":"https://pkg.surveydown.org/reference/sd_completion_code.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate a Random Completion Code — sd_completion_code","title":"Generate a Random Completion Code — sd_completion_code","text":"function generates random completion code specified number digits. code returned character string.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_completion_code.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate a Random Completion Code — sd_completion_code","text":"","code":"sd_completion_code(digits = 6)"},{"path":"https://pkg.surveydown.org/reference/sd_completion_code.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate a Random Completion Code — sd_completion_code","text":"digits integer specifying number digits completion code. Must positive integer. Default 6.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_completion_code.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate a Random Completion Code — sd_completion_code","text":"character string representing random completion code.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_completion_code.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generate a Random Completion Code — sd_completion_code","text":"","code":"library(surveydown) sd_completion_code() # generates a 6-digit code #> [1] \"545358\" sd_completion_code(digits = 8) # generates an 8-digit code #> [1] \"47164415\" sd_completion_code(digits = 4) # generates a 4-digit code #> [1] \"7285\" sd_completion_code(digits = 10) # generates a 10-digit code #> [1] \"6585941037\""},{"path":"https://pkg.surveydown.org/reference/sd_copy_value.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a copy of a value — sd_copy_value","title":"Create a copy of a value — sd_copy_value","text":"function creates copy input value makes available new output. new output can displayed using sd_output().","code":""},{"path":"https://pkg.surveydown.org/reference/sd_copy_value.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a copy of a value — sd_copy_value","text":"","code":"sd_copy_value(id, id_copy)"},{"path":"https://pkg.surveydown.org/reference/sd_copy_value.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a copy of a value — sd_copy_value","text":"id Character string. ID input value copy. id_copy Character string. ID new copy (must different id).","code":""},{"path":"https://pkg.surveydown.org/reference/sd_copy_value.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a copy of a value — sd_copy_value","text":"NULL invisibly. function called side effects.","code":""},{"path":[]},{"path":"https://pkg.surveydown.org/reference/sd_copy_value.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a copy of a value — sd_copy_value","text":"","code":"if (interactive()) { library(surveydown) # Get path to example survey file survey_path <- system.file(\"examples\", \"sd_ui.qmd\", package = \"surveydown\") # Copy to a temporary directory temp_dir <- tempdir() file.copy(survey_path, file.path(temp_dir, \"sd_copy_value.qmd\")) orig_dir <- getwd() setwd(temp_dir) # Define a minimal server server <- function(input, output, session) { # Make a copy of the \"name\" variable to call its value a second time sd_copy_value(id = \"name\", id_copy = \"name_copy\") sd_server() } # Run the app shiny::shinyApp(ui = sd_ui(), server = server) # Clean up setwd(orig_dir) }"},{"path":"https://pkg.surveydown.org/reference/sd_create_survey.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a new survey template — sd_create_survey","title":"Create a new survey template — sd_create_survey","text":"function creates new survey template copying files package's template directory specified path. handles file conflicts provides appropriate warnings feedback.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_create_survey.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a new survey template — sd_create_survey","text":"","code":"sd_create_survey(path = getwd(), structure = \"single\")"},{"path":"https://pkg.surveydown.org/reference/sd_create_survey.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a new survey template — sd_create_survey","text":"path character string specifying directory survey template created. Defaults current working directory. structure character string specifying template structure use. Must either \"single\" \"multi\". Defaults \"single\".","code":""},{"path":"https://pkg.surveydown.org/reference/sd_create_survey.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a new survey template — sd_create_survey","text":"Invisible NULL. function called side effects creating files providing user feedback.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_create_survey.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create a new survey template — sd_create_survey","text":"function performs following steps: specified path current working directory, asks user confirmation. Validates specified structure (\"single\" \"multi\"). Creates target directory exist. Copies files package's template directory (based specified structure) target path. Preserves directory structure template. Skips existing files provides warnings skipped file. Handles .Rproj files specially, skipping .Rproj file already exists target directory. Provides feedback whether files copied files already existed.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_create_survey.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a new survey template — sd_create_survey","text":"","code":"if (interactive()) { # Create a single-page survey template sd_create_survey(structure = \"single\") # Create a multi-page survey template sd_create_survey(structure = \"multi\") }"},{"path":"https://pkg.surveydown.org/reference/sd_create_translations.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a translations template file — sd_create_translations","title":"Create a translations template file — sd_create_translations","text":"function creates template translations.yml file project root directory users can customize modify system messages.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_create_translations.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a translations template file — sd_create_translations","text":"","code":"sd_create_translations(language = \"en\", path = getwd())"},{"path":"https://pkg.surveydown.org/reference/sd_create_translations.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a translations template file — sd_create_translations","text":"language Character string specifying language use. See https://shiny.posit.co/r/reference/shiny/1.7.0/dateinput supported languages. Also, \"en\", \"de\", \"es\", \"fr\", \"\" chosen, default messages langauges used, otherwise default English messages used. Defaults \"en\". path Character string specifying directory translations.yml file created. Defaults current working directory. file placed root project folder surveydown survey.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_create_translations.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a translations template file — sd_create_translations","text":"Invisible NULL.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_create_translations.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a translations template file — sd_create_translations","text":"","code":"if (interactive()) { # Create English template sd_create_translations() # Create German template sd_create_translations(language = \"de\") # Create Japanese template # Will use English messages but Japanese date picker - user can modify # the messages as desired sd_create_translations(language = \"ja\") }"},{"path":"https://pkg.surveydown.org/reference/sd_database.html","id":null,"dir":"Reference","previous_headings":"","what":"Connect to a 'PostgreSQL' Database with Automatic Cleanup — sd_database","title":"Connect to a 'PostgreSQL' Database with Automatic Cleanup — sd_database","text":"function establishes connection pool 'PostgreSQL' database (e.g. Supabase) sets automatic cleanup 'shiny' session ends.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_database.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Connect to a 'PostgreSQL' Database with Automatic Cleanup — sd_database","text":"","code":"sd_database( host = NULL, dbname = NULL, port = NULL, user = NULL, table = NULL, password = Sys.getenv(\"SURVEYDOWN_PASSWORD\"), gssencmode = \"prefer\", ignore = FALSE, min_size = 1, max_size = Inf )"},{"path":"https://pkg.surveydown.org/reference/sd_database.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Connect to a 'PostgreSQL' Database with Automatic Cleanup — sd_database","text":"host Character string. host address Supabase database. dbname Character string. name Supabase database. port Integer. port number Supabase database connection. user Character string. username Supabase database connection. table Character string. name table interact Supabase database. password Character string. password Supabase database connection. NOTE: can provide hard-coded password , recommend security purposes. Instead, establish password surveydown::sd_set_password(), create local .Renviron file stores password SURVEYDOWN_PASSWORD environment variable. password argument uses default value, set password properly surveydown::sd_set_password(), can safely ignore using password argument . gssencmode Character string. GSS encryption mode database connection. Defaults \"prefer\". NOTE: verified connection details correct still access database, consider setting \"disable\". can necessary secure connection, VPN. ignore Logical. TRUE, data saved local CSV file instead database. Defaults FALSE. min_size Integer. minimum number connections pool. Defaults 1. max_size Integer. maximum number connections pool. Defaults Inf.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_database.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Connect to a 'PostgreSQL' Database with Automatic Cleanup — sd_database","text":"list containing database connection pool (db) table name (table), NULL ignore mode error.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_database.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Connect to a 'PostgreSQL' Database with Automatic Cleanup — sd_database","text":"","code":"if (interactive()) { # Assuming SURVEYDOWN_PASSWORD is set in .Renviron db <- sd_database( host = \"aws-0-us-west-1.pooler.supabase.com\", dbname = \"postgres\", port = \"6---\", user = \"postgres.k----------i\", table = \"your-table-name\", ignore = FALSE ) # Print the structure of the connection str(db) # Close the connection pool when done if (!is.null(db)) { pool::poolClose(db$db) } }"},{"path":"https://pkg.surveydown.org/reference/sd_display_question.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a placeholder for a reactive survey question — sd_display_question","title":"Create a placeholder for a reactive survey question — sd_display_question","text":"function depreciated - use sd_output() instead.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_display_question.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a placeholder for a reactive survey question — sd_display_question","text":"","code":"sd_display_question(id)"},{"path":"https://pkg.surveydown.org/reference/sd_display_question.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a placeholder for a reactive survey question — sd_display_question","text":"id unique identifier question.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_display_question.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a placeholder for a reactive survey question — sd_display_question","text":"'shiny' UI element serves placeholder reactive question.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_display_value.html","id":null,"dir":"Reference","previous_headings":"","what":"Display the value of a survey question — sd_display_value","title":"Display the value of a survey question — sd_display_value","text":"function depreciated - use sd_output() instead.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_display_value.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Display the value of a survey question — sd_display_value","text":"","code":"sd_display_value(id, display_type = \"inline\", wrapper = NULL, ...)"},{"path":"https://pkg.surveydown.org/reference/sd_display_value.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Display the value of a survey question — sd_display_value","text":"id ID question display display_type type display. Can \"inline\" (default), \"text\", \"verbatim\", \"ui\". wrapper function wrap output ... Additional arguments passed wrapper function","code":""},{"path":"https://pkg.surveydown.org/reference/sd_display_value.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Display the value of a survey question — sd_display_value","text":"'shiny' UI element displaying question's value","code":""},{"path":"https://pkg.surveydown.org/reference/sd_get_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Fetch data from a database table with automatic reactivity detection — sd_get_data","title":"Fetch data from a database table with automatic reactivity detection — sd_get_data","text":"function retrieves data specified table database. automatically detects whether used reactive context (e.g., within 'shiny' application) behaves accordingly. reactive context, returns reactive expression automatically refreshes data specified intervals.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_get_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Fetch data from a database table with automatic reactivity detection — sd_get_data","text":"","code":"sd_get_data(db, refresh_interval = NULL)"},{"path":"https://pkg.surveydown.org/reference/sd_get_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Fetch data from a database table with automatic reactivity detection — sd_get_data","text":"db list containing database connection details created using sd_database(). Must elements: db: DBI database connection object table: string specifying name table query refresh_interval Numeric. time interval (seconds) data refreshes reactive context. Default NULL, meaning data refresh.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_get_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Fetch data from a database table with automatic reactivity detection — sd_get_data","text":"non-reactive context, returns data frame containing rows columns specified table. reactive context, returns reactive expression , called, returns recent data specified database table.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_get_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Fetch data from a database table with automatic reactivity detection — sd_get_data","text":"","code":"# Non-reactive context example if (FALSE) { # \\dontrun{ library(surveydown) # Assuming you have a database connection called db created using # sd_database(), you can fetch data with: data <- sd_get_data(db) head(data) # Reactive context example (inside a surveydown app) server <- function(input, output, session) { data <- sd_get_data(db, refresh_interval = 10) output$data_table <- renderTable({ data() # Note the parentheses to retrieve the reactive value }) } } # }"},{"path":"https://pkg.surveydown.org/reference/sd_get_url_pars.html","id":null,"dir":"Reference","previous_headings":"","what":"Get URL Parameters in a 'shiny' Application — sd_get_url_pars","title":"Get URL Parameters in a 'shiny' Application — sd_get_url_pars","text":"function retrieves URL parameters current 'shiny' session. must called within 'shiny' reactive context.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_get_url_pars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get URL Parameters in a 'shiny' Application — sd_get_url_pars","text":"","code":"sd_get_url_pars(...)"},{"path":"https://pkg.surveydown.org/reference/sd_get_url_pars.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get URL Parameters in a 'shiny' Application — sd_get_url_pars","text":"... Optional. Names specific URL parameters retrieve. none specified, URL parameters returned.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_get_url_pars.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get URL Parameters in a 'shiny' Application — sd_get_url_pars","text":"reactive expression returns list URL parameters.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_get_url_pars.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get URL Parameters in a 'shiny' Application — sd_get_url_pars","text":"","code":"if (interactive()) { library(surveydown) # Get path to example survey file survey_path <- system.file(\"examples\", \"sd_redirect.qmd\", package = \"surveydown\") # Copy to a temporary directory temp_dir <- tempdir() file.copy(survey_path, file.path(temp_dir, \"survey.qmd\")) orig_dir <- getwd() setwd(temp_dir) # Define a minimal server server <- function(input, output, session) { # Reactive expression that generates a url with an id variable # parsed from the url url_redirect <- reactive({ params <- sd_get_url_pars() id <- params[\"id\"] return(paste0(\"https://www.google.com?id=\", id)) }) # Create the redirect button sd_redirect( id = \"redirect_url_pars\", url = url_redirect(), button = TRUE, label = \"Redirect\" ) sd_skip_if( input$screening_question == \"end_1\" ~ \"end_page_1\", input$screening_question == \"end_1\" ~ \"end_page_2\", ) sd_server() } # Run the app shiny::shinyApp(ui = sd_ui(), server = server) # Clean up setwd(orig_dir) }"},{"path":"https://pkg.surveydown.org/reference/sd_include_folder.html","id":null,"dir":"Reference","previous_headings":"","what":"Include a folder to the 'shiny' resource path — sd_include_folder","title":"Include a folder to the 'shiny' resource path — sd_include_folder","text":"function includes specified folder 'shiny' resource path, making accessible serving static files 'shiny' application. checks pre-existing resource paths avoid conflicts folders already included package.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_include_folder.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Include a folder to the 'shiny' resource path — sd_include_folder","text":"","code":"sd_include_folder(folder)"},{"path":"https://pkg.surveydown.org/reference/sd_include_folder.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Include a folder to the 'shiny' resource path — sd_include_folder","text":"folder character string specifying name folder include. folder exist root directory 'shiny' app.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_include_folder.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Include a folder to the 'shiny' resource path — sd_include_folder","text":"NULL invisibly. function called side effect adding resource path 'shiny'.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_include_folder.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Include a folder to the 'shiny' resource path — sd_include_folder","text":"","code":"if (interactive()) { library(shiny) # Create an \"images\" folder dir.create(\"images\") # Include the folder in the shiny resource path sd_include_folder(\"images\") }"},{"path":"https://pkg.surveydown.org/reference/sd_is_answered.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if a question is answered — sd_is_answered","title":"Check if a question is answered — sd_is_answered","text":"function checks given question answered user. matrix questions, checks sub-questions (rows) answered.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_is_answered.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if a question is answered — sd_is_answered","text":"","code":"sd_is_answered(question_id)"},{"path":"https://pkg.surveydown.org/reference/sd_is_answered.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if a question is answered — sd_is_answered","text":"question_id ID question check.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_is_answered.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if a question is answered — sd_is_answered","text":"logical value: TRUE question answered, FALSE otherwise.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_is_answered.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check if a question is answered — sd_is_answered","text":"","code":"if (interactive()) { library(surveydown) # Get path to example survey file survey_path <- system.file(\"examples\", \"sd_is_answered.qmd\", package = \"surveydown\") # Copy to a temporary directory temp_dir <- tempdir() file.copy(survey_path, file.path(temp_dir, \"survey.qmd\")) orig_dir <- getwd() setwd(temp_dir) # Define a minimal server server <- function(input, output, session) { sd_show_if( # If \"apple_text\" is answered, show the conditional question sd_is_answered(\"apple_text\") ~ \"other_fruit\" ) sd_server() } # Run the app shiny::shinyApp(ui = sd_ui(), server = server) # Clean up setwd(orig_dir) }"},{"path":"https://pkg.surveydown.org/reference/sd_next.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a 'Next' Button for Page Navigation — sd_next","title":"Create a 'Next' Button for Page Navigation — sd_next","text":"function creates 'Next' button navigating specified next page Surveydown survey. button can activated clicking pressing Enter key visible.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_next.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a 'Next' Button for Page Navigation — sd_next","text":"","code":"sd_next(next_page = NULL, label = NULL)"},{"path":"https://pkg.surveydown.org/reference/sd_next.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a 'Next' Button for Page Navigation — sd_next","text":"next_page Character string. ID next page navigate . parameter required. label Character string. label 'Next' button. Defaults NULL, case word \"Next\" used.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_next.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a 'Next' Button for Page Navigation — sd_next","text":"'shiny' tagList containing 'Next' button UI element.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_next.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create a 'Next' Button for Page Navigation — sd_next","text":"function generates 'shiny' action button , clicked Enter key pressed, sets input value specified next page ID, facilitating page navigation within Shiny application. button styled appear centered page includes class Enter key functionality.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_next.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a 'Next' Button for Page Navigation — sd_next","text":"","code":"if (interactive()) { library(surveydown) # Get path to example survey file survey_path <- system.file(\"examples\", \"sd_next.qmd\", package = \"surveydown\") # Copy to a temporary directory temp_dir <- tempdir() file.copy(survey_path, file.path(temp_dir, \"survey.qmd\")) orig_dir <- getwd() setwd(temp_dir) # Define a minimal server server <- function(input, output, session) { sd_server() } # Run the app shiny::shinyApp(ui = sd_ui(), server = server) # Clean up setwd(orig_dir) }"},{"path":"https://pkg.surveydown.org/reference/sd_output.html","id":null,"dir":"Reference","previous_headings":"","what":"Output Function for Displaying reactive objects and values — sd_output","title":"Output Function for Displaying reactive objects and values — sd_output","text":"Output Function Displaying reactive objects values","code":""},{"path":"https://pkg.surveydown.org/reference/sd_output.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Output Function for Displaying reactive objects and values — sd_output","text":"","code":"sd_output( id, type = NULL, width = \"100%\", display = \"text\", inline = TRUE, wrapper = NULL, ... )"},{"path":"https://pkg.surveydown.org/reference/sd_output.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Output Function for Displaying reactive objects and values — sd_output","text":"id Character string. unique identifier output element. type Character string. Specifies type output. Can \"question\", \"value\", NULL. NULL, function behaves like shiny::uiOutput(). width Character string. width UI element. Defaults \"100%\". display Character string. Specifies display type \"value\" outputs. Can \"text\", \"verbatim\", \"ui\". used type = \"value\". inline Logical. Whether render output inline. Defaults TRUE. wrapper Function. function wrap output. used type = \"value\". ... Additional arguments passed underlying 'shiny' functions wrapper function.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_output.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Output Function for Displaying reactive objects and values — sd_output","text":"'shiny' UI element, type depends input parameters.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_output.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Output Function for Displaying reactive objects and values — sd_output","text":"function behaves differently based type parameter: type NULL, acts like shiny::uiOutput(). type \"question\", creates placeholder reactive survey question. type \"value\", creates output display value survey question, display style determined display parameter.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_output.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Output Function for Displaying reactive objects and values — sd_output","text":"","code":"if (interactive()) { library(surveydown) # Get path to example survey file survey_path <- system.file(\"examples\", \"sd_output.qmd\", package = \"surveydown\") # Copy to a temporary directory temp_dir <- tempdir() file.copy(survey_path, file.path(temp_dir, \"survey.qmd\")) orig_dir <- getwd() setwd(temp_dir) # Define a minimal server server <- function(input, output, session) { sd_server() } # Run the app shiny::shinyApp(ui = sd_ui(), server = server) # Clean up setwd(orig_dir) }"},{"path":"https://pkg.surveydown.org/reference/sd_question.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a survey question — sd_question","title":"Create a survey question — sd_question","text":"function creates various types survey questions use Surveydown survey.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_question.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a survey question — sd_question","text":"","code":"sd_question( type, id, label, cols = \"80\", direction = \"horizontal\", status = \"default\", width = \"100%\", height = \"100px\", selected = NULL, label_select = \"Choose an option...\", grid = TRUE, individual = TRUE, justified = FALSE, force_edges = TRUE, option = NULL, placeholder = NULL, resize = NULL, row = NULL )"},{"path":"https://pkg.surveydown.org/reference/sd_question.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a survey question — sd_question","text":"type Specifies type question. Possible values \"select\", \"mc\", \"mc_multiple\", \"mc_buttons\", \"mc_multiple_buttons\", \"text\", \"textarea\", \"numeric\", \"slider\", \"date\", \"daterange\", \"matrix\". id unique identifier question, used variable name resulting survey data. label Character string. label UI element, can formatted markdown. cols Integer. Number columns textarea input. Defaults 80. direction Character string. direction button groups (\"horizontal\" \"vertical\"). Defaults \"horizontal\". status Character string. status button groups. Defaults \"default\". width Character string. width UI element. Defaults \"100%\". height Character string. height textarea input. Defaults \"100px\". selected Value. selected value(s) certain input elements. label_select Character string. label select input. Defaults \"Choose option...\". grid Logical. Whether show grid slider input. Defaults TRUE. individual Logical. Whether buttons group individually styled. Defaults TRUE. justified Logical. Whether buttons group fill width parent div. Defaults FALSE. force_edges Logical. Whether force edges slider input. Defaults TRUE. option List. Options select, radio, checkbox, slider inputs. placeholder Character string. Placeholder text text textarea inputs. resize Character string. Resize option textarea input. Defaults NULL. row List. Used \"matrix\" type questions. Contains row labels corresponding IDs.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_question.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a survey question — sd_question","text":"'shiny' UI element wrapped div data attribute question ID.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_question.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create a survey question — sd_question","text":"function supports various question types: \"select\": dropdown selection \"mc\": Multiple choice (single selection) \"mc_multiple\": Multiple choice (multiple selections allowed) \"mc_buttons\": Multiple choice button-style options (single selection) \"mc_multiple_buttons\": Multiple choice button-style options (multiple selections allowed) \"text\": Single-line text input \"textarea\": Multi-line text input \"numeric\": Numeric input \"slider\": Slider input \"date\": Date input \"daterange\": Date range input \"matrix\": Matrix-style question rows columns \"matrix\" type questions, use row parameter define rows matrix. element row list name (used row ID) value (used row label).","code":""},{"path":"https://pkg.surveydown.org/reference/sd_question.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a survey question — sd_question","text":"","code":"if (interactive()) { library(surveydown) # Get path to example survey file survey_path <- system.file(\"examples\", \"basic_survey.qmd\", package = \"surveydown\") # Copy to a temporary directory temp_dir <- tempdir() file.copy(survey_path, file.path(temp_dir, \"survey.qmd\")) orig_dir <- getwd() setwd(temp_dir) # Define a minimal server server <- function(input, output, session) { sd_server() } # Run the app shiny::shinyApp(ui = sd_ui(), server = server) # Clean up setwd(orig_dir) }"},{"path":"https://pkg.surveydown.org/reference/sd_redirect.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a Redirect Element for 'shiny' Applications — sd_redirect","title":"Create a Redirect Element for 'shiny' Applications — sd_redirect","text":"function creates UI element redirects user specified URL. can used reactive non-reactive contexts within 'shiny' applications.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_redirect.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a Redirect Element for 'shiny' Applications — sd_redirect","text":"","code":"sd_redirect( id, url, button = TRUE, label = \"Click here\", delay = NULL, newtab = FALSE )"},{"path":"https://pkg.surveydown.org/reference/sd_redirect.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a Redirect Element for 'shiny' Applications — sd_redirect","text":"id character string unique id used identify redirect button survey body. url character string specifying URL redirect . button logical value indicating whether create button (TRUE) text element (FALSE) redirect. Default TRUE. label character string button text label. Defaults NULL, case words \"Click \" used. delay optional numeric value specifying delay seconds automatic redirection. NULL (default), automatic redirection occurs. newtab logical value indicating whether open URL new tab (TRUE) current tab (FALSE). Default FALSE.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_redirect.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a Redirect Element for 'shiny' Applications — sd_redirect","text":"reactive context, returns function called, renders redirect element. non-reactive context, returns redirect element directly.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_redirect.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a Redirect Element for 'shiny' Applications — sd_redirect","text":"","code":"if (interactive()) { library(surveydown) # Get path to example survey file survey_path <- system.file(\"examples\", \"sd_redirect.qmd\", package = \"surveydown\") # Copy to a temporary directory temp_dir <- tempdir() file.copy(survey_path, file.path(temp_dir, \"survey.qmd\")) orig_dir <- getwd() setwd(temp_dir) # Define a minimal server server <- function(input, output, session) { # Reactive expression that generates a url with an id variable # parsed from the url url_redirect <- reactive({ params <- sd_get_url_pars() id <- params[\"id\"] return(paste0(\"https://www.google.com?id=\", id)) }) # Create the redirect button sd_redirect( id = \"redirect_url_pars\", url = url_redirect(), button = TRUE, label = \"Redirect\" ) sd_skip_if( input$screening_question == \"end_1\" ~ \"end_page_1\", input$screening_question == \"end_1\" ~ \"end_page_2\", ) sd_server() } # Run the app shiny::shinyApp(ui = sd_ui(), server = server) # Clean up setwd(orig_dir) }"},{"path":"https://pkg.surveydown.org/reference/sd_server.html","id":null,"dir":"Reference","previous_headings":"","what":"Server logic for a surveydown survey — sd_server","title":"Server logic for a surveydown survey — sd_server","text":"function defines server-side logic 'shiny' application used surveydown. handles various operations conditional display, progress tracking, page navigation, database updates survey responses, exit survey functionality.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_server.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Server logic for a surveydown survey — sd_server","text":"","code":"sd_server( db = NULL, required_questions = NULL, all_questions_required = FALSE, start_page = NULL, admin_page = FALSE, auto_scroll = FALSE, rate_survey = FALSE, language = \"en\", use_cookies = TRUE )"},{"path":"https://pkg.surveydown.org/reference/sd_server.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Server logic for a surveydown survey — sd_server","text":"db list containing database connection information created using sd_database() function. Defaults NULL. required_questions Vector character strings. IDs questions must answered. Defaults NULL. all_questions_required Logical. TRUE, questions survey required. Defaults FALSE. start_page Character string. ID page start . Defaults NULL. admin_page Logical. Whether include admin page viewing downloading survey data. Defaults FALSE. auto_scroll Logical. Whether enable auto-scrolling next question answering. Defaults FALSE. rate_survey Logical. TRUE, shows rating question exiting survey. FALSE, shows simple confirmation dialog. Defaults FALSE. language Set language survey system messages. Include translations.yml file, choose built one following list: English (\"en\"), German (\"de\"), Spanish (\"es\"), French (\"fr\"), Italian (\"\"). Simplified Chinese (\"zh-CN\"). Defaults \"en\". use_cookies Logical. TRUE, enables cookie-based session management storing restoring survey progress. Defaults TRUE.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_server.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Server logic for a surveydown survey — sd_server","text":"function return value; sets server-side logic 'shiny' application.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_server.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Server logic for a surveydown survey — sd_server","text":"function performs following tasks: Initializes variables reactive values. Implements conditional display logic questions. Tracks answered questions updates progress bar. Handles page navigation skip logic. Manages required questions. Performs database operation. Sets admin functionality enabled admin_page argument. Controls auto-scrolling behavior based auto_scroll argument. Uses sweetalert warning messages required questions answered. Handles exit survey process based rate_survey argument.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_server.html","id":"progress-bar","dir":"Reference","previous_headings":"","what":"Progress Bar","title":"Server logic for a surveydown survey — sd_server","text":"progress bar updated based last answered question. jump percentage corresponding last answered question never decrease, even earlier questions answered later. progress calculated ratio last answered question's index total number questions.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_server.html","id":"database-operations","dir":"Reference","previous_headings":"","what":"Database Operations","title":"Server logic for a surveydown survey — sd_server","text":"db provided, function update database survey responses. db NULL (ignore mode), responses saved local CSV file.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_server.html","id":"auto-scrolling","dir":"Reference","previous_headings":"","what":"Auto-Scrolling","title":"Server logic for a surveydown survey — sd_server","text":"auto_scroll TRUE, survey automatically scroll next question current question answered. behavior can disabled setting auto_scroll = FALSE.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_server.html","id":"exit-survey","dir":"Reference","previous_headings":"","what":"Exit Survey","title":"Server logic for a surveydown survey — sd_server","text":"rate_survey = TRUE, function show rating question user attempts exit survey. FALSE, show simple confirmation dialog. rating, provided, saved survey data.","code":""},{"path":[]},{"path":"https://pkg.surveydown.org/reference/sd_server.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Server logic for a surveydown survey — sd_server","text":"","code":"if (interactive()) { library(surveydown) # Get path to example survey file survey_path <- system.file(\"examples\", \"basic_survey.qmd\", package = \"surveydown\") # Copy to a temporary directory temp_dir <- tempdir() file.copy(survey_path, file.path(temp_dir, \"survey.qmd\")) orig_dir <- getwd() setwd(temp_dir) # Define a minimal server server <- function(input, output, session) { # sd_server() accepts these following parameters sd_server( db = NULL, required_questions = NULL, all_questions_required = FALSE, start_page = NULL, admin_page = FALSE, auto_scroll = FALSE, rate_survey = FALSE, language = \"en\", use_cookies = TRUE ) } # Run the app shiny::shinyApp(ui = sd_ui(), server = server) # Clean up setwd(orig_dir) }"},{"path":"https://pkg.surveydown.org/reference/sd_set_password.html","id":null,"dir":"Reference","previous_headings":"","what":"Set password for surveydown survey — sd_set_password","title":"Set password for surveydown survey — sd_set_password","text":"function sets surveydown password, used access 'PostgreSQL' data (e.g. Supabase). password saved .Renviron file adds .Renviron .gitignore.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_set_password.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set password for surveydown survey — sd_set_password","text":"","code":"sd_set_password(password)"},{"path":"https://pkg.surveydown.org/reference/sd_set_password.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set password for surveydown survey — sd_set_password","text":"password Character string. password set database connection.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_set_password.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set password for surveydown survey — sd_set_password","text":"None. function called side effects.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_set_password.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Set password for surveydown survey — sd_set_password","text":"function performs following actions: Creates .Renviron file root directory exist. Adds updates SURVEYDOWN_PASSWORD entry .Renviron file. Adds .Renviron .gitignore already .","code":""},{"path":"https://pkg.surveydown.org/reference/sd_set_password.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Set password for surveydown survey — sd_set_password","text":"","code":"if (FALSE) { # \\dontrun{ # Set a temporary password for demonstration temp_password <- paste0(sample(letters, 10, replace = TRUE), collapse = \"\") # Set the password sd_set_password(temp_password) # After restarting R, verify the password was set cat(\"Password is :\", Sys.getenv('SURVEYDOWN_PASSWORD')) } # }"},{"path":"https://pkg.surveydown.org/reference/sd_setup.html","id":null,"dir":"Reference","previous_headings":"","what":"Required Set Up Function — sd_setup","title":"Required Set Up Function — sd_setup","text":"function depreciated longer needed.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_setup.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Required Set Up Function — sd_setup","text":"","code":"sd_setup()"},{"path":"https://pkg.surveydown.org/reference/sd_setup.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Required Set Up Function — sd_setup","text":"function return value. called side effects setting 'shiny' application.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_setup.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Required Set Up Function — sd_setup","text":"function configures 'shiny' application use Bootstrap 5 styling enables 'shinyjs' JavaScript functionalities within application.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_show_if.html","id":null,"dir":"Reference","previous_headings":"","what":"Define show conditions for survey questions — sd_show_if","title":"Define show conditions for survey questions — sd_show_if","text":"function used define conditions certain questions survey shown. takes one formulas left-hand side condition right-hand side target question ID. called arguments, return NULL set conditions.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_show_if.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Define show conditions for survey questions — sd_show_if","text":"","code":"sd_show_if(...)"},{"path":"https://pkg.surveydown.org/reference/sd_show_if.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Define show conditions for survey questions — sd_show_if","text":"... One formulas defining show conditions. left-hand side formula condition based input values, right-hand side ID question show condition met.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_show_if.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Define show conditions for survey questions — sd_show_if","text":"list parsed conditions, element contains condition target question ID. Returns NULL conditions provided.","code":""},{"path":[]},{"path":"https://pkg.surveydown.org/reference/sd_show_if.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Define show conditions for survey questions — sd_show_if","text":"","code":"if (interactive()) { library(surveydown) # Get path to example survey file survey_path <- system.file(\"examples\", \"sd_show_if.qmd\", package = \"surveydown\") # Copy to a temporary directory temp_dir <- tempdir() file.copy(survey_path, file.path(temp_dir, \"survey.qmd\")) orig_dir <- getwd() setwd(temp_dir) # Define a minimal server server <- function(input, output, session) { sd_show_if( # If \"Other\" is chosen, show the conditional question input$fav_fruit == \"other\" ~ \"fav_fruit_other\" ) sd_server() } # Run the app shiny::shinyApp(ui = sd_ui(), server = server) # Clean up setwd(orig_dir) }"},{"path":"https://pkg.surveydown.org/reference/sd_show_password.html","id":null,"dir":"Reference","previous_headings":"","what":"Show the Saved Survey Password — sd_show_password","title":"Show the Saved Survey Password — sd_show_password","text":"function displays password saved .Renviron file SURVEYDOWN_PASSWORD variable. includes confirmation step ensure user wants display password console. password found, suggests using sd_set_password() function define password.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_show_password.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Show the Saved Survey Password — sd_show_password","text":"","code":"sd_show_password()"},{"path":"https://pkg.surveydown.org/reference/sd_show_password.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Show the Saved Survey Password — sd_show_password","text":"character string containing password found confirmed, message password saved along suggestion set one.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_show_password.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Show the Saved Survey Password — sd_show_password","text":"","code":"if (FALSE) { # \\dontrun{ surveydown::sd_show_password() } # }"},{"path":"https://pkg.surveydown.org/reference/sd_skip_if.html","id":null,"dir":"Reference","previous_headings":"","what":"Define skip conditions for survey pages — sd_skip_if","title":"Define skip conditions for survey pages — sd_skip_if","text":"function used define conditions certain pages survey skipped. takes one formulas left-hand side condition right-hand side target page ID.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_skip_if.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Define skip conditions for survey pages — sd_skip_if","text":"","code":"sd_skip_if(...)"},{"path":"https://pkg.surveydown.org/reference/sd_skip_if.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Define skip conditions for survey pages — sd_skip_if","text":"... One formulas defining skip conditions. left-hand side formula condition based input values, right-hand side ID page skip condition met.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_skip_if.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Define skip conditions for survey pages — sd_skip_if","text":"list parsed conditions, element contains condition target page ID.","code":""},{"path":[]},{"path":"https://pkg.surveydown.org/reference/sd_skip_if.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Define skip conditions for survey pages — sd_skip_if","text":"","code":"if (interactive()) { library(surveydown) # Get path to example survey file survey_path <- system.file(\"examples\", \"sd_skip_if.qmd\", package = \"surveydown\") # Copy to a temporary directory temp_dir <- tempdir() file.copy(survey_path, file.path(temp_dir, \"survey.qmd\")) orig_dir <- getwd() setwd(temp_dir) # Define a minimal server server <- function(input, output, session) { # Skip to page based on input sd_skip_if( input$fav_fruit == \"orange\" ~ \"orange_page\", input$fav_fruit == \"other\" ~ \"other_page\" ) sd_server() } # Run the app shiny::shinyApp(ui = sd_ui(), server = server) # Clean up setwd(orig_dir) }"},{"path":"https://pkg.surveydown.org/reference/sd_store_value.html","id":null,"dir":"Reference","previous_headings":"","what":"Store a value in the survey data — sd_store_value","title":"Store a value in the survey data — sd_store_value","text":"function allows storing additional values included survey data, respondent IDs metadata.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_store_value.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Store a value in the survey data — sd_store_value","text":"","code":"sd_store_value(value, id = NULL)"},{"path":"https://pkg.surveydown.org/reference/sd_store_value.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Store a value in the survey data — sd_store_value","text":"value value stored. can R object can coerced character string. id (Optional) Character string. id (name) value data. provided, name value variable used.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_store_value.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Store a value in the survey data — sd_store_value","text":"NULL (invisibly)","code":""},{"path":"https://pkg.surveydown.org/reference/sd_store_value.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Store a value in the survey data — sd_store_value","text":"","code":"if (interactive()) { library(surveydown) # Get path to example survey file survey_path <- system.file(\"examples\", \"sd_ui.qmd\", package = \"surveydown\") # Copy to a temporary directory temp_dir <- tempdir() file.copy(survey_path, file.path(temp_dir, \"basic_survey.qmd\")) orig_dir <- getwd() setwd(temp_dir) # Define a minimal server server <- function(input, output, session) { # Create a respondent ID to store respondentID <- 42 # Store the respondentID sd_store_value(respondentID) # Store the respondentID as the variable \"respID\" sd_store_value(respondentID, \"respID\") sd_server() } # Run the app shiny::shinyApp(ui = sd_ui(), server = server) # Clean up setwd(orig_dir) }"},{"path":"https://pkg.surveydown.org/reference/sd_ui.html","id":null,"dir":"Reference","previous_headings":"","what":"Create the UI for a surveydown survey — sd_ui","title":"Create the UI for a surveydown survey — sd_ui","text":"function creates user interface surveydown survey, including necessary CSS JavaScript files, applies custom styling. retrieves theme progress bar settings survey.qmd file.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_ui.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create the UI for a surveydown survey — sd_ui","text":"","code":"sd_ui()"},{"path":"https://pkg.surveydown.org/reference/sd_ui.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create the UI for a surveydown survey — sd_ui","text":"'shiny' UI object","code":""},{"path":"https://pkg.surveydown.org/reference/sd_ui.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create the UI for a surveydown survey — sd_ui","text":"function reads following settings survey.qmd YAML header: theme: theme applied survey. barcolor: color progress bar (valid hex color). barposition: position progress bar ('top', 'bottom', 'none'). barcolor specified NULL, default theme color used. barposition specified, defaults 'top'.","code":""},{"path":[]},{"path":"https://pkg.surveydown.org/reference/sd_ui.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create the UI for a surveydown survey — sd_ui","text":"","code":"if (interactive()) { library(surveydown) # Get path to example survey file survey_path <- system.file(\"examples\", \"sd_ui.qmd\", package = \"surveydown\") # Copy to a temporary directory temp_dir <- tempdir() file.copy(survey_path, file.path(temp_dir, \"survey.qmd\")) orig_dir <- getwd() setwd(temp_dir) # Define a minimal server server <- function(input, output, session) { sd_server() } # Run the app shiny::shinyApp(ui = sd_ui(), server = server) # Clean up setwd(orig_dir) }"},{"path":"https://pkg.surveydown.org/reference/sd_version.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Surveydown Version — sd_version","title":"Check Surveydown Version — sd_version","text":"function checks local surveydown package --date latest online version. compares local version latest version available GitHub provides information whether update needed.","code":""},{"path":"https://pkg.surveydown.org/reference/sd_version.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Surveydown Version — sd_version","text":"","code":"sd_version()"},{"path":"https://pkg.surveydown.org/reference/sd_version.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Surveydown Version — sd_version","text":"return value, called side effects (prints version information update status console).","code":""},{"path":"https://pkg.surveydown.org/reference/sd_version.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Surveydown Version — sd_version","text":"","code":"surveydown::sd_version() #> surveydown (local): 0.5.2 #> surveydown (latest): 0.5.2 #> #> surveydown is up to date."},{"path":[]},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-052","dir":"Changelog","previous_headings":"","what":"surveydown 0.5.2","title":"surveydown 0.5.2","text":"Cookies feature fixed.","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-051","dir":"Changelog","previous_headings":"","what":"surveydown 0.5.1","title":"surveydown 0.5.1","text":"CRAN release: 2024-11-27 Revert mostly v0.4.2 completely remove cookies feature added v0.5.0. re-implement new approach later version. Fixed typo error message (data.csv -> preview_data.csv).","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-050","dir":"Changelog","previous_headings":"","what":"surveydown 0.5.0","title":"surveydown 0.5.0","text":"CRAN release: 2024-11-25 New cookies feature! Now sd_server() accepts new argument use_cookies, defaults TRUE. enables cookies reopening survey resume participant survey left. database trace original session_id continuous data update based user input. changed FALSE, survey start brand new session upon reopening. -line data storage upgrade. Now ignore mode , data stored project directory file name called preview_data.csv. file works exactly online database, compatible cookies functionality. Simplified Chinese supported sd_server(). can trigger : sd_server(language = \"zh-CN\"). Improvement: default language behavior UI functions cleaner separately rendering survey.qmd file. Bug fix: used bug multiple themes defined YAML. Now ’s solved.","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-042","dir":"Changelog","previous_headings":"","what":"surveydown 0.4.2","title":"surveydown 0.4.2","text":"New “translations” feature now supported (see PR #138). allows system messages date formats specified language using language argument sd_server(). Custom language messages can modified providing translations.yml file root project folder. Added new sd_create_translations() function generate template translations.yml file use edit system messages. Added Stefan Munnes contributor DESCRIPTION file (ctb) Bug fix: is_matrix metadata recorded matrix sub-questions exported _survey/questions.yml file, caused error matrix question required. now corrected obtaining question structure stored _survey/questions.yml file.","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-041","dir":"Changelog","previous_headings":"","what":"surveydown 0.4.1","title":"surveydown 0.4.1","text":"Modified survey rendering move rendered files “_survey” folder. Export survey question metadata “_survey/questions.yml” file (see #132). Survey content now extracted saved ’_survey/pages.rds’, ’_survey/head.rds’, ’_survey/questions.yml’ files faster loading. Survey load content stored files changes detected ‘survey.qmd’ ‘app.R’ files.","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-040","dir":"Changelog","previous_headings":"","what":"surveydown 0.4.0","title":"surveydown 0.4.0","text":"CRAN release: 2024-11-01 examples updated include run-able examples (possible). Added example survey.qmd files inst/examples (use function examples). roxygen documentation reviewed errors / typos. Removed sd_update() function. Removed sd_deploy() function. Installation instructions updated.","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-037","dir":"Changelog","previous_headings":"","what":"surveydown 0.3.7","title":"surveydown 0.3.7","text":"Updated sd_output() now able output chosen question values, chosen question option label(s), question label . Addresses feature request #128. Enhance: sd_update() now directly force update package without checking version difference anymore. New: sd_is_answered() function check question answered returns TRUE FALSE accordingly. \"matrix\" type, sub-questions answered marked TRUE.","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-036","dir":"Changelog","previous_headings":"","what":"surveydown 0.3.6","title":"surveydown 0.3.6","text":"Enhance: sd_add_question() now chunk argument, TRUE include outer chunk wrapper. Default FALSE. Enhance: matrix question type now root question id shown data sheet. id essential logic, example can used handle sd_show_if() logic. root id also removed all_question_required logic, since ’s handle doesn’t provide option answer. Enhance: Removed use_html argument sd_server(). Now survey.qmd file always rendered app runs one two conditions met: 1) survey.html file detected, 2) survey.html file outdated. Otherwise, use rendered survey.html file. Bug fix: auto_scroll now works better smoother. Bug fix: enter key trigger page turn working text, textarea, numeric, select, date, daterange. Enhance: Enter key can now used trigger “Submit Exit” button rating pop-modal.","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-035","dir":"Changelog","previous_headings":"","what":"surveydown 0.3.5","title":"surveydown 0.3.5","text":"Enhance: database updating simplified write database page turn survey closes. Bug fix: added new questions values survey creating initial database table, new values added table. Now added. Enhance: auto_scroll changed FALSE default.","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-034","dir":"Changelog","previous_headings":"","what":"surveydown 0.3.4","title":"surveydown 0.3.4","text":"Bug fix: reactive questions now work show_if conditions Bug fix: show_if conditions now work even target question different page. Bug fix: reactive question ids (defined server) considered check_skip_show() checks, ’d get error question id invalid. Enhance: sd_server() accepts new parameter called \"rate_survey\", default FALSE. TRUE, Exit button trigger rating question. FALSE, Exit button trigger double confirmation ensure user really wants exit. Enhance: Now survey check exists sd_close() function call. Enhance: Now survey check reserved question IDs used, including session_id, time_start, time_end, exit_survey_rating. future. Enhance: Now sd_output() function take care styling setting reactive questions. example, sd_output(id = \"some_question_id\", type = \"question\", width = \"80%\") define 80% reactive question. Enhance: Now sd_show_if() can take care cross-page conditional reactive questions.","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-033","dir":"Changelog","previous_headings":"","what":"surveydown 0.3.3","title":"surveydown 0.3.3","text":"Enhance: sd_server() now new parameter called auto_scroll. ’s default TRUE, enables auto scrolling tracks user’s input, can turned changing FALSE. Thanks contribution Zain Hoda. Enhance: sd_question() now \"matrix\" type. documentation page updated. Enhance: Asterisk, indication required questions, now moved top right corner question containers. Enhance: Replaced default shiny alert sweetalert.","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-032","dir":"Changelog","previous_headings":"","what":"surveydown 0.3.2","title":"surveydown 0.3.2","text":"New: Added sd_completion_code() function. Bug fix: make stored values accessible sd_output() type = 'value' argument. Previously question values displayed UI sd_output(). New: sd_add_question() instantly create question template. Defaults type \"mc\" also accepts types (\"text\", \"textarea\", \"numeric\", etc.). function call delete running. New: sd_add_page() instantly create page template. Make sure run function outside division code chunk. function call delete running.","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-031","dir":"Changelog","previous_headings":"","what":"surveydown 0.3.1","title":"surveydown 0.3.1","text":"Enhance: Improved efficiency database_uploading() changed fields get written, also writing happens checking show_if conditions (addresses #100). Enhance: Modified default rendering behavior delete rendered html file. Enhance: Modified refresh_interval argument sd_get_data() defaulting NULL, means data reactively fetched, regardless context used . data continuously refresh sd_get_data() called within reactive context refresh_interval > 0. Enhance: Modified messaging sd_set_password() print user’s password provide clearer instructions. New: sd_show_password() added show stored password. user prompted double confirm want show . password, user prompted , along message using sd_set_password() create password.","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-030","dir":"Changelog","previous_headings":"","what":"surveydown 0.3.0","title":"surveydown 0.3.0","text":"Introduced sd_ui() function set placeholders shiny app ui. Heavily revised skip_if show_if works, removing skip_if_custom show_if_custom. Now work similar case_when() function, provide formula condition ~ target condition either function. also provided globally inside server() function using sd_skip_if() sd_show_if(). Require survey file named \"survey.qmd\". Added sd_include_folder() function users can add folder shiny resource path. Automatically include images, js, css, www folders well folders quarto files shiny resource path package loads. Heavily modified sd_next() works improve page navigation ensure sd_next() button unique id based current page. Removed quarto extension. sd_create_survey() changed sourcing template directly package. Two parameters provided. first parameter path, defines relative path target. left blank, path current working directory. second parameter structure, defines structure template user wants choose, default \"single\" can changed \"multi\". sd_deploy() wrapper function rsconnect::deployApp() deploy survey. sd_update() replacement sd_update_surveydown() update package. sd_version() replacement sd_check_versions() check current version latest version. sd_close() function create close button survey.","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-024","dir":"Changelog","previous_headings":"","what":"surveydown 0.2.4","title":"surveydown 0.2.4","text":"need use Next button anymore. Next buttons can now chunk questions spacing added. Modified margins top bottom. Solved large gap created hidden questions. Fixed issue sd_store_value(). used problem value list multiple entries. Now collapsed commas due application format_question_value() value variable. Removed reactive argument sd_get_data(). Now functions compatible reactive (server) static (ui) conditions automatically match, without necessity explicitly specifying . sd_redirect() updated parameter called newtab, defaults FALSE. TRUE, redirection link opened new tab. used together delay, new tab might blocked browser count-, user click blocked. Improved database_uploading() function secure possible SQL injection attacks.","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-023","dir":"Changelog","previous_headings":"","what":"surveydown 0.2.3","title":"surveydown 0.2.3","text":"Solved speed problem database connections: refactored sd_server() efficiency; converted local data storage lists instead data frames. Assigned session_id leading column, removed respondent_id column.","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-022","dir":"Changelog","previous_headings":"","what":"surveydown 0.2.2","title":"surveydown 0.2.2","text":"sd_redirect() create redirection external links, either providing button, countdown, . function can called survey body server chunk. sd_get_url_pars() reactively get parameters URL. 3 functions work together retrieve redirect URL parameters surveydown compatible survey panels. Now sd_next() sd_redirect() support “Enter” key better user experience. Add automatic clean sd_database(). sd_output() function replaces original sd_display_question() (specifying type = \"question\") sd_display_value() (specifying type = \"value\"). original 2 functions depreciated removed future updates. sd_output() used \"id\" specified, works shiny::uiOutput().","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-021","dir":"Changelog","previous_headings":"","what":"surveydown 0.2.1","title":"surveydown 0.2.1","text":"sd_database(), now db_name changed dbname, table_name changed table, consistency Supabase, simplicity parameter names. Now error message sd_database() also prompt “verified connection details correct still access database, consider setting gssencmode parameter \"disable\" sd_database() function.” don’t encourage users disable gssencmode, since ’s secure , users encounter connection error, possible solution. Bug fix: bug introduced restructuring sd_server() function last update affected numeric questions determined answered , now fixed. Fixed issue #80: sd_display_value() used multiple times different question IDs, fetch last user input. Now ’s fixed. Renamed main lua file inst/quarto/filters surveydown.lua sd_main.lua updated extension v0.2.5 call via robust, cross-platform approach. (Extension) Renamed extension lua filter sd_wrapper.lua avoid naming conflict. Now extension used wrapper. sd_main.lua related CSS JS files R package.","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-020","dir":"Changelog","previous_headings":"","what":"surveydown 0.2.0","title":"surveydown 0.2.0","text":"Moved sd_store_value() sd_copy_value() server.R file (server operations). Added respondent_id variable tracks respondent based starting survey. Restructure server efficient. Now required questions can successfully bypass hidden required questions types.","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-012","dir":"Changelog","previous_headings":"","what":"surveydown 0.1.2","title":"surveydown 0.1.2","text":"Moved main surveydown.lua file package inst/quarto/filters. surveydown Quarto extension now just wrapper load file, extension won’t likely need update updates can made package lua file. Changed jhelvy surveydown-dev version control functions. Now duplicated page_id question_id, survey stop show error. Removed roxygen2 documentation non-exported functions.","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-011","dir":"Changelog","previous_headings":"","what":"surveydown 0.1.1","title":"surveydown 0.1.1","text":"Added sd_get_data() reactive argument enable reactive data fetching. sd_question() now reactive argument enable reactive questions, sd_question_reactive() removed. Made sd_admin_enable() internal, changed admin_enable(). Removed sd_admin_ui() sd_add_admin() package. Moved surveydown.css page_nav.js files R package Quarto extension. Added keep alive functionality survey. admin page password looking SUPABASE_PASSWORD environment variable, SURVEYDOWN_PASSWORD. data fetching working download data CSV file admin page, now uses sd_get_data() works. show_if_custom logic working multiple conditions, now . skip_if_custom logic error condition NULL (fixed isTRUE()). sd_config(), items assigned <- operator, causing deleted thing assigned NULL. Now changed =.","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-010","dir":"Changelog","previous_headings":"","what":"surveydown 0.1.0","title":"surveydown 0.1.0","text":"Added sd_display_value() displaying question value based question id. Added sd_copy_value() making copy question value, may needed need display something since can’t make one object id. Changed sd_reactive_output() sd_display_question(). Changed sd_store_value() works avoid global environment, changed arg name name id. Added sd_add_admin() function react admin_page condition, set true ‘Admin’ page created survey creators. Added sd_admin_ui() function create UI Admin page button. (extension) JS files removed extension R package. Now extension contains .lua file css styles.","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-009","dir":"Changelog","previous_headings":"","what":"surveydown 0.0.9","title":"surveydown 0.0.9","text":"Required questions now moved sd_config() separate required_questions argument, instead defined sd_question(). Two new functions supporting reactive questions: sd_question_reactive() sd_reactive_output(). sd_store_value() function store variables database. example, sd_store_value(respondentID, \"respID\") store value respondentID column named \"respID\". name provided, column named original variable name, case, respondentID. Enhanced robustness progress bar. Now progress bar update based user’s input. Added timestamp column beginning result dataframe. Now Mac PC problem connecting supabase. Updated roxygen2 documentation texts.","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-008","dir":"Changelog","previous_headings":"","what":"surveydown 0.0.8","title":"surveydown 0.0.8","text":"sd_database() function added pause argument default FALSE. pause = FALSE, database properly connected; pause = TRUE, local CSV generated survey results stored . sd_config() function preview removed due pause sd_database. pause = FALSE (aka default), warning messages shown missing incorrect password, prompt usage sd_set_password(). Initiation admin_page argument config.R.","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-007","dir":"Changelog","previous_headings":"","what":"surveydown 0.0.7","title":"surveydown 0.0.7","text":"sd_set_password() function set supabase password survey environment variable. function takes string, supabase password. recommend run R Console password appear .qmd file. (Continue) Upon running sd_set_password(), .Renviron file created survey project root directory. file, SUPABASE_PASSWORD=your_password created, your_password whatever input sd_set_password(). , .Renviron added .gitignore file avoid pushed GitHub. (Continue) already .Renviron file, SUPABASE_PASSWORD=your_password concatenated end. already definition SUPABASE_PASSWORD, overwritten. .gitignore file, created. already .Renviron .gitignore, won’t duplicated. (Continue) explanation means simply run sd_set_password() define supabase password survey project. takes care rest necessary operations, can rerun sd_set_password() change password, previous value safely overwritten.","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-006","dir":"Changelog","previous_headings":"","what":"surveydown 0.0.6","title":"surveydown 0.0.6","text":"sd_database, gssencmode argument added set “prefer” default. cases, local deployment may fail due network environments VPN settings. can solved setting gssencmode = \"disable\" survey qmd file. Now survey can updated even deployment. may add, delete, modify question. old question column time stamp, stay . new question column time stamp concatenated end table. (extension) Now example.qmd survey instructions supabase configuration shinyapps deployment. (extension) Now .gitignore file .Renviron included. file store supabase password essential shinyapps deployment. Eliminating file pushing GitHub ensure password saved locally.","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-005","dir":"Changelog","previous_headings":"","what":"surveydown 0.0.5","title":"surveydown 0.0.5","text":"create_survey() changed sd_create_survey() function name consistency. sd_update_extension() function update surveydown Quarto extension. sd_check_versions() function check version R package Quarto extension. don’t match latest version, suggestion run sd_update_surveydown() function. sd_update_surveydown() function update R package Quarto extension.","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-004","dir":"Changelog","previous_headings":"","what":"surveydown 0.0.4","title":"surveydown 0.0.4","text":"(extension) Raleway Font set default font survey pages. Can overwritten YAML header theme command using bootswatch themes custom scss file. (extension) Default page background set “#f2f6f9” (light blue color). Can overwritten YAML header backgroundcolor. (extension) Questions now encapsulated container distinguishes descriptive texts. (extension) Options mc_button mu_multiple_buttons types questions now centered. Now surveydown::create_survey() function download whole extension repo, containing extension, example survey, RStudio project.","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-003","dir":"Changelog","previous_headings":"","what":"surveydown 0.0.3","title":"surveydown 0.0.3","text":"Now show_if can applied multiple options question, allows users one option question triggers revealing hidden question. Now “required” question hidden, trigger page warning “questions answered”. (extension) Now users can page name ID header, regardless capitalization. example, users can now page ID “#educational”, header “#Educational”. sounds , previous versions, page hiding logic show bug page ID page header.","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-002","dir":"Changelog","previous_headings":"","what":"surveydown 0.0.2","title":"surveydown 0.0.2","text":"Support added required argument sd_question(), allows users force question required. answered, popup window blocks user continuing next page. supabase backend now connected documentation set database complete. Initial setup tests added","code":""},{"path":"https://pkg.surveydown.org/news/index.html","id":"surveydown-001","dir":"Changelog","previous_headings":"","what":"surveydown 0.0.1","title":"surveydown 0.0.1","text":"Initial version!","code":""}]