diff --git a/404.html b/404.html index a7aa041a..a4083664 100644 --- a/404.html +++ b/404.html @@ -28,7 +28,7 @@ surveydown - 0.0.8 + 0.0.9 + + + + + +
+
+
+ +
+

Check if all required questions are answered

+
+ +
+

Usage

+
check_all_required(questions, questions_required, input, show_if)
+
+ +
+

Arguments

+ + +
questions
+

Vector of question identifiers

+ + +
questions_required
+

Vector of required question identifiers

+ + +
input
+

Shiny input object

+ + +
show_if
+

Data frame of show-if conditions

+ +
+
+

Value

+

Logical indicating if all required questions are answered

+
+ +
+ + +
+ + + + + + + diff --git a/reference/check_answer.html b/reference/check_answer.html new file mode 100644 index 00000000..830735f6 --- /dev/null +++ b/reference/check_answer.html @@ -0,0 +1,97 @@ + +Check if a single question is answered — check_answer • surveydown + Skip to contents + + +
+
+
+ +
+

Check if a single question is answered

+
+ +
+

Usage

+
check_answer(q, input)
+
+ +
+

Arguments

+ + +
q
+

Question identifier

+ + +
input
+

Shiny input object

+ +
+
+

Value

+

Logical indicating if the question is answered

+
+ +
+ + +
+ + + + + + + diff --git a/reference/check_skip_show.html b/reference/check_skip_show.html new file mode 100644 index 00000000..324fb25e --- /dev/null +++ b/reference/check_skip_show.html @@ -0,0 +1,109 @@ + +Check skip and show conditions — check_skip_show • surveydown + Skip to contents + + +
+
+
+ +
+

This function validates the skip_if and show_if conditions provided in the configuration.

+
+ +
+

Usage

+
check_skip_show(config, skip_if, skip_if_custom, show_if, show_if_custom)
+
+ +
+

Arguments

+ + +
config
+

The survey configuration list

+ + +
skip_if
+

Data frame of skip conditions

+ + +
skip_if_custom
+

Custom skip function

+ + +
show_if
+

Data frame of show conditions

+ + +
show_if_custom
+

Custom show function

+ +
+
+

Value

+

TRUE if all checks pass, otherwise stops with an error message

+
+ +
+ + +
+ + + + + + + diff --git a/reference/create_table.html b/reference/create_table.html new file mode 100644 index 00000000..9ece9400 --- /dev/null +++ b/reference/create_table.html @@ -0,0 +1,101 @@ + +Create a new table in the database — create_table • surveydown + Skip to contents + + +
+
+
+ +
+

Create a new table in the database

+
+ +
+

Usage

+
create_table(db, table_name, df)
+
+ +
+

Arguments

+ + +
db
+

Database connection object

+ + +
table_name
+

String name of the table to create

+ + +
df
+

Data frame used to determine table structure

+ +
+
+

Value

+

None (called for side effects)

+
+ +
+ + +
+ + + + + + + diff --git a/reference/database_uploading.html b/reference/database_uploading.html new file mode 100644 index 00000000..1842e041 --- /dev/null +++ b/reference/database_uploading.html @@ -0,0 +1,104 @@ + +Upload data to the database — database_uploading • surveydown + Skip to contents + + +
+
+
+ +
+

This function handles the process of uploading survey data to the database, +including creating the table if it doesn't exist and updating existing rows.

+
+ +
+

Usage

+
database_uploading(df, db, table_name)
+
+ +
+

Arguments

+ + +
df
+

Data frame of survey data to upload

+ + +
db
+

Database connection object

+ + +
table_name
+

String name of the table to upload to

+ +
+
+

Value

+

None (called for side effects)

+
+ +
+ + +
+ + + + + + + diff --git a/reference/download_extension.html b/reference/download_extension.html index b69a5ae6..a6805611 100644 --- a/reference/download_extension.html +++ b/reference/download_extension.html @@ -7,7 +7,7 @@ surveydown - 0.0.8 + 0.0.9 + + + + + +
+
+
+ +
+

Get page nodes from HTML

+
+ +
+

Usage

+
get_page_nodes()
+
+ +
+

Value

+

A list of page nodes from the HTML document

+
+ +
+ + +
+ + + + + + + diff --git a/reference/get_page_structure.html b/reference/get_page_structure.html new file mode 100644 index 00000000..b44a3429 --- /dev/null +++ b/reference/get_page_structure.html @@ -0,0 +1,85 @@ + +Get page structure from HTML — get_page_structure • surveydown + Skip to contents + + +
+
+
+ +
+

Get page structure from HTML

+
+ +
+

Usage

+
get_page_structure()
+
+ +
+

Value

+

A list where each element represents a page and contains the question IDs on that page

+
+ +
+ + +
+ + + + + + + diff --git a/reference/get_question_nodes.html b/reference/get_question_nodes.html new file mode 100644 index 00000000..b079d93f --- /dev/null +++ b/reference/get_question_nodes.html @@ -0,0 +1,85 @@ + +Get question nodes from HTML — get_question_nodes • surveydown + Skip to contents + + +
+
+
+ +
+

Get question nodes from HTML

+
+ +
+

Usage

+
get_question_nodes()
+
+ +
+

Value

+

A list of question nodes from the HTML document

+
+ +
+ + +
+ + + + + + + diff --git a/reference/get_question_structure.html b/reference/get_question_structure.html new file mode 100644 index 00000000..da8f8de0 --- /dev/null +++ b/reference/get_question_structure.html @@ -0,0 +1,85 @@ + +Get question structure from HTML — get_question_structure • surveydown + Skip to contents + + +
+
+
+ +
+

Get question structure from HTML

+
+ +
+

Usage

+
get_question_structure()
+
+ +
+

Value

+

A list where each element represents a question and contains its options

+
+ +
+ + +
+ + + + + + + diff --git a/reference/get_utc_timestamp.html b/reference/get_utc_timestamp.html new file mode 100644 index 00000000..8288b403 --- /dev/null +++ b/reference/get_utc_timestamp.html @@ -0,0 +1,85 @@ + +Get Current UTC Timestamp — get_utc_timestamp • surveydown + Skip to contents + + +
+
+
+ +
+

This function returns the current timestamp in UTC format.

+
+ +
+

Usage

+
get_utc_timestamp()
+
+ +
+

Value

+

A character string representing the current UTC timestamp.

+
+ +
+ + +
+ + + + + + + diff --git a/reference/handle_basic_show_if_logic.html b/reference/handle_basic_show_if_logic.html new file mode 100644 index 00000000..c0091cb7 --- /dev/null +++ b/reference/handle_basic_show_if_logic.html @@ -0,0 +1,93 @@ + +Handle basic show-if logic — handle_basic_show_if_logic • surveydown + Skip to contents + + +
+
+
+ +
+

Handle basic show-if logic

+
+ +
+

Usage

+
handle_basic_show_if_logic(input, show_if)
+
+ +
+

Arguments

+ + +
input
+

Shiny input object

+ + +
show_if
+

Data frame of show-if conditions

+ +
+ +
+ + +
+ + + + + + + diff --git a/reference/handle_basic_skip_logic.html b/reference/handle_basic_skip_logic.html new file mode 100644 index 00000000..2e6b6fbc --- /dev/null +++ b/reference/handle_basic_skip_logic.html @@ -0,0 +1,105 @@ + +Handle basic skip logic — handle_basic_skip_logic • surveydown + Skip to contents + + +
+
+
+ +
+

Handle basic skip logic

+
+ +
+

Usage

+
handle_basic_skip_logic(input, skip_if, current_page, next_page)
+
+ +
+

Arguments

+ + +
input
+

Shiny input object

+ + +
skip_if
+

Data frame of skip-if conditions

+ + +
current_page
+

Current page identifier

+ + +
next_page
+

Next page identifier

+ +
+
+

Value

+

Updated next page identifier

+
+ +
+ + +
+ + + + + + + diff --git a/reference/handle_custom_show_if_logic.html b/reference/handle_custom_show_if_logic.html new file mode 100644 index 00000000..a5353015 --- /dev/null +++ b/reference/handle_custom_show_if_logic.html @@ -0,0 +1,93 @@ + +Handle custom show-if logic — handle_custom_show_if_logic • surveydown + Skip to contents + + +
+
+
+ +
+

Handle custom show-if logic

+
+ +
+

Usage

+
handle_custom_show_if_logic(input, show_if_custom)
+
+ +
+

Arguments

+ + +
input
+

Shiny input object

+ + +
show_if_custom
+

List of custom show-if conditions

+ +
+ +
+ + +
+ + + + + + + diff --git a/reference/handle_custom_skip_logic.html b/reference/handle_custom_skip_logic.html new file mode 100644 index 00000000..ebcb0061 --- /dev/null +++ b/reference/handle_custom_skip_logic.html @@ -0,0 +1,105 @@ + +Handle custom skip logic — handle_custom_skip_logic • surveydown + Skip to contents + + +
+
+
+ +
+

Handle custom skip logic

+
+ +
+

Usage

+
handle_custom_skip_logic(input, skip_if_custom, current_page, next_page)
+
+ +
+

Arguments

+ + +
input
+

Shiny input object

+ + +
skip_if_custom
+

List of custom skip-if conditions

+ + +
current_page
+

Current page identifier

+ + +
next_page
+

Next page identifier

+ +
+
+

Value

+

Updated next page identifier

+
+ +
+ + +
+ + + + + + + diff --git a/reference/handle_skip_logic.html b/reference/handle_skip_logic.html new file mode 100644 index 00000000..75b3a431 --- /dev/null +++ b/reference/handle_skip_logic.html @@ -0,0 +1,109 @@ + +Handle overall skip logic — handle_skip_logic • surveydown + Skip to contents + + +
+
+
+ +
+

Handle overall skip logic

+
+ +
+

Usage

+
handle_skip_logic(input, skip_if, skip_if_custom, current_page, next_page)
+
+ +
+

Arguments

+ + +
input
+

Shiny input object

+ + +
skip_if
+

Data frame of basic skip-if conditions

+ + +
skip_if_custom
+

List of custom skip-if conditions

+ + +
current_page
+

Current page identifier

+ + +
next_page
+

Next page identifier

+ +
+
+

Value

+

Updated next page identifier

+
+ +
+ + +
+ + + + + + + diff --git a/reference/index.html b/reference/index.html index 42e49710..e6a85a3b 100644 --- a/reference/index.html +++ b/reference/index.html @@ -7,7 +7,7 @@ surveydown - 0.0.8 + 0.0.9 + + + + + +
+
+
+ +
+

This function initializes timestamps for pages and questions in a survey.

+
+ +
+

Usage

+
initialize_timestamps(page_ids, question_ids)
+
+ +
+

Arguments

+ + +
page_ids
+

A vector of page IDs.

+ + +
question_ids
+

A vector of question IDs.

+ +
+
+

Value

+

A list of initialized timestamps for pages and questions.

+
+ +
+ + +
+ + + + + + + diff --git a/reference/is_question_visible.html b/reference/is_question_visible.html new file mode 100644 index 00000000..8fa6e709 --- /dev/null +++ b/reference/is_question_visible.html @@ -0,0 +1,101 @@ + +Check if a question is visible — is_question_visible • surveydown + Skip to contents + + +
+
+
+ +
+

Check if a question is visible

+
+ +
+

Usage

+
is_question_visible(q, show_if, input)
+
+ +
+

Arguments

+ + +
q
+

Question identifier

+ + +
show_if
+

Data frame of show-if conditions

+ + +
input
+

Shiny input object

+ +
+
+

Value

+

Logical indicating if the question is visible

+
+ +
+ + +
+ + + + + + + diff --git a/reference/list_name_md_to_html.html b/reference/list_name_md_to_html.html new file mode 100644 index 00000000..b515f482 --- /dev/null +++ b/reference/list_name_md_to_html.html @@ -0,0 +1,96 @@ + +Convert List Names from Markdown to HTML — list_name_md_to_html • surveydown + Skip to contents + + +
+
+
+ +
+

This function converts the names of a list from markdown to HTML format. +It only works for mc_buttons and mc_multiple_buttons.

+
+ +
+

Usage

+
list_name_md_to_html(list)
+
+ +
+

Arguments

+ + +
list
+

A list whose names are in markdown format.

+ +
+
+

Value

+

A list with names converted to HTML format.

+
+ +
+ + +
+ + + + + + + diff --git a/reference/make_next_button_id.html b/reference/make_next_button_id.html new file mode 100644 index 00000000..41036a20 --- /dev/null +++ b/reference/make_next_button_id.html @@ -0,0 +1,93 @@ + +Generate Next Button ID — make_next_button_id • surveydown + Skip to contents + + +
+
+
+ +
+

This internal function generates a unique ID for the 'Next' button based on the next page ID.

+
+ +
+

Usage

+
make_next_button_id(next_page)
+
+ +
+

Arguments

+ + +
next_page
+

Character string. The ID of the next page.

+ +
+
+

Value

+

A character string representing the button ID.

+
+ +
+ + +
+ + + + + + + diff --git a/reference/make_ts_name.html b/reference/make_ts_name.html new file mode 100644 index 00000000..19a2c4f2 --- /dev/null +++ b/reference/make_ts_name.html @@ -0,0 +1,97 @@ + +Make Timestamp Name — make_ts_name • surveydown + Skip to contents + + +
+
+
+ +
+

This function creates a standardized name for timestamps based on the type and ID.

+
+ +
+

Usage

+
make_ts_name(type, id)
+
+ +
+

Arguments

+ + +
type
+

A character string, either "page" or "question".

+ + +
id
+

The ID of the page or question.

+ +
+
+

Value

+

A character string representing the timestamp name.

+
+ +
+ + +
+ + + + + + + diff --git a/reference/markdown_to_html.html b/reference/markdown_to_html.html new file mode 100644 index 00000000..914e4e55 --- /dev/null +++ b/reference/markdown_to_html.html @@ -0,0 +1,93 @@ + +Convert Markdown to HTML — markdown_to_html • surveydown + Skip to contents + + +
+
+
+ +
+

This function converts markdown text to HTML.

+
+ +
+

Usage

+
markdown_to_html(text)
+
+ +
+

Arguments

+ + +
text
+

A character string containing markdown text.

+ +
+
+

Value

+

An HTML string converted from the input markdown text.

+
+ +
+ + +
+ + + + + + + diff --git a/reference/r_to_sql_type.html b/reference/r_to_sql_type.html new file mode 100644 index 00000000..40ef3a53 --- /dev/null +++ b/reference/r_to_sql_type.html @@ -0,0 +1,93 @@ + +Convert R data type to SQL data type — r_to_sql_type • surveydown + Skip to contents + + +
+
+
+ +
+

Convert R data type to SQL data type

+
+ +
+

Usage

+
r_to_sql_type(r_type)
+
+ +
+

Arguments

+ + +
r_type
+

String representing R data type

+ +
+
+

Value

+

String representing corresponding SQL data type

+
+ +
+ + +
+ + + + + + + diff --git a/reference/sd_check_versions.html b/reference/sd_check_versions.html index 03a00793..84527c8a 100644 --- a/reference/sd_check_versions.html +++ b/reference/sd_check_versions.html @@ -1,7 +1,11 @@ Check Surveydown Versions — sd_check_versions • surveydown +are up-to-date with the latest online version. It compares local versions +with the latest versions available on GitHub and provides information about +whether updates are needed."> Skip to contents @@ -9,7 +13,7 @@ surveydown - 0.0.8 + 0.0.9 + + + + + +
+
+
+ +
+

This function creates various types of reactive survey questions for use in a Surveydown survey. +It wraps the sd_question function in a renderUI call, allowing for dynamic question generation.

+
+ +
+

Usage

+
sd_question_reactive(...)
+
+ +
+

Arguments

+ + +
...
+

Other inputs to be passed to sd_question.

+ +
+
+

Value

+

A renderUI function that creates the survey question.

+
+ +
+

Examples

+
sd_question_reactive(type = "text", id = "name", label = "What is your name?")
+
+
+
+
+ + +
+ + + +
+ + + + + + + diff --git a/reference/sd_reactive_output.html b/reference/sd_reactive_output.html new file mode 100644 index 00000000..adf863e6 --- /dev/null +++ b/reference/sd_reactive_output.html @@ -0,0 +1,105 @@ + +Create a placeholder for a reactive survey question — sd_reactive_output • surveydown + Skip to contents + + +
+
+
+ +
+

This function creates a placeholder div for a reactive survey question in a Surveydown survey. +It's used in conjunction with sd_question_reactive to allow for dynamic question rendering.

+
+ +
+

Usage

+
sd_reactive_output(id)
+
+ +
+

Arguments

+ + +
id
+

A unique identifier for the question.

+ +
+
+

Value

+

A Shiny UI element that serves as a placeholder for the reactive question.

+
+ +
+

Examples

+
sd_reactive_output("name")
+#> <div id="placeholder-name" data-question-id="name" class="question-container reactive-question-placeholder">
+#>   <div id="name" class="shiny-html-output"></div>
+#> </div>
+
+
+
+
+ + +
+ + + +
+ + + + + + + diff --git a/reference/sd_server.html b/reference/sd_server.html index e1c48f6d..44862dab 100644 --- a/reference/sd_server.html +++ b/reference/sd_server.html @@ -11,7 +11,7 @@ surveydown - 0.0.8 + 0.0.9 + + + + + +
+
+
+ +
+

This function allows storing additional values to be included in the survey data, +such as respondent IDs or other custom data. The values are stored in a special +environment (.sd_custom_values) and will be included when the survey data is saved.

+
+ +
+

Usage

+
sd_store_value(value, name = NULL)
+
+ +
+

Arguments

+ + +
value
+

The value to be stored.

+ + +
name
+

(Optional) The name for the value in the data. +If not provided, the name of the value variable will be used.

+ +
+
+

Value

+

NULL (invisibly)

+
+ +
+

Examples

+
if (FALSE) { # \dontrun{
+  sd_store_value(respondentID)
+  sd_store_value(respondentID, "respID")
+} # }
+
+
+
+
+ + +
+ + + +
+ + + + + + + diff --git a/reference/sd_update_extension.html b/reference/sd_update_extension.html index 5c425aba..21c6326a 100644 --- a/reference/sd_update_extension.html +++ b/reference/sd_update_extension.html @@ -9,7 +9,7 @@ surveydown - 0.0.8 + 0.0.9 + + + + + +
+
+
+ +
+

Transform survey data for database storage

+
+ +
+

Usage

+
transform_data(question_vals, timestamp_vals, session_id, custom_vals)
+
+ +
+

Arguments

+ + +
question_vals
+

List of question values

+ + +
timestamp_vals
+

List of timestamp values

+ + +
session_id
+

String representing the session ID

+ + +
custom_vals
+

List of custom values

+ +
+
+

Value

+

A data frame with transformed survey data

+
+ +
+ + +
+ + + +
+ + + + + + + diff --git a/reference/vector_to_json_array.html b/reference/vector_to_json_array.html new file mode 100644 index 00000000..a2bafefb --- /dev/null +++ b/reference/vector_to_json_array.html @@ -0,0 +1,96 @@ + +Convert Vector to JSON Array — vector_to_json_array • surveydown + Skip to contents + + +
+
+
+ +
+

This function converts a vector to a JSON array string. It's a custom alternative +to jsonlite::toJSON().

+
+ +
+

Usage

+
vector_to_json_array(vec)
+
+ +
+

Arguments

+ + +
vec
+

A vector to be converted to a JSON array.

+ +
+
+

Value

+

A character string representing the JSON array.

+
+ +
+ + +
+ + + +
+ + + + + + + diff --git a/search.json b/search.json index 5ee2038a..eeed7e16 100644 --- a/search.json +++ b/search.json @@ -1 +1 @@ -[{"path":"https://jhelvy.github.io/surveydown/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://jhelvy.github.io/surveydown/articles/content.html","id":"start-with-a-template","dir":"Articles","previous_headings":"","what":"Start with a template","title":"Survey Content","text":"R console, run following setup template survey: create folder located \"path//folder\" following files: example.qmd: template survey edit. example.Rproj: RStudio project file (helpful ’re working RStudio) _extensions: folder surveydown Quarto extension needed make everything work (don’t modify ). Every survey created {surveydown} separate project folder.","code":"surveydown::sd_create_survey(\"path/to/folder\")"},{"path":"https://jhelvy.github.io/surveydown/articles/content.html","id":"survey-components","dir":"Articles","previous_headings":"","what":"Survey components","title":"Survey Content","text":"Every {surveydown} survey configured single .qmd file consists 4 parts: YAML header. setup code chunk. survey body. server code chunk.","code":""},{"path":"https://jhelvy.github.io/surveydown/articles/content.html","id":"yaml-header","dir":"Articles","previous_headings":"","what":"1. YAML Header","title":"Survey Content","text":"YAML header top .qmd file. addition two required elements, YAML can used set survey theme well modify survey progress bar.","code":""},{"path":"https://jhelvy.github.io/surveydown/articles/content.html","id":"required-yaml-content","dir":"Articles","previous_headings":"1. YAML Header","what":"Required YAML content","title":"Survey Content","text":"surveydown survey, YAML must contain least following: server: shiny part ensures document render shiny app. filters: [surveydown] part applies surveydown Quarto extension project, required.","code":"--- server: shiny filters: [surveydown] ---"},{"path":"https://jhelvy.github.io/surveydown/articles/content.html","id":"setitng-the-theme","dir":"Articles","previous_headings":"1. YAML Header","what":"Setitng the theme","title":"Survey Content","text":"YAML can also used set several optional global settings, overall survey theme: 25 bootswatch themes choose . can also provide custom.scss file modify theme, even combine two, e.g.:","code":"--- theme: united # Any bootswatch theme --- --- theme: [united, custom.scss] ---"},{"path":"https://jhelvy.github.io/surveydown/articles/content.html","id":"progress-bar","dir":"Articles","previous_headings":"1. YAML Header","what":"Progress bar","title":"Survey Content","text":"can modify survey progress bar barcolor barposition keys, e.g.: barcolor key defines color progress bar. defaults theme, meaning take primary theme color. may also use hex code overwrite color wish, e.g.: #768692. barposition key defines position progress bar. defaults top, can also changed bottom none (remove bar). progress bar updates every question user clicks , pages.","code":"--- barcolor: theme barposition: top ---"},{"path":"https://jhelvy.github.io/surveydown/articles/content.html","id":"setup-code-chunk","dir":"Articles","previous_headings":"","what":"2. Setup code chunk","title":"Survey Content","text":"YAML header, ’ll need load surveydown package run sd_setup() function. placed inside code chunk looks like : Anything loaded setup chunk accessible survey body server, recommend also loading packages / data chunk well.","code":"```{r} #| context: setup #| warning: false #| message: false # Load the package library(surveydown) # Run initial setup function (essential - do not delete) sd_setup() ```"},{"path":"https://jhelvy.github.io/surveydown/articles/content.html","id":"survey-body","dir":"Articles","previous_headings":"","what":"3. Survey body","title":"Survey Content","text":"survey body content setup code chunk server code chunk. can use markdown (RStudio visual editor) insert text, images, etc. just like Quarto document. unique elements surveydown survey pages, navigation buttons, questions.","code":""},{"path":"https://jhelvy.github.io/surveydown/articles/content.html","id":"adding-pages","dir":"Articles","previous_headings":"3. Survey body","what":"Adding pages","title":"Survey Content","text":"surveydown, pages defined using fences (:::), like : can see, use three colon symbols :::, called “fence”, mark start end pages. notation commonly used Quarto variety use cases, like defining subfigures images. starting fence, need define page name (e.g. welcome page2 example ) need define class .sd-page. anything put page fences appear page.","code":"::: {#welcome .sd-page} Page 1 content here ::: ::: {#page2 .sd-page} Page 2 content here :::"},{"path":"https://jhelvy.github.io/surveydown/articles/content.html","id":"adding-navigation-buttons","dir":"Articles","previous_headings":"3. Survey body","what":"Adding navigation buttons","title":"Survey Content","text":"navigate next page, need insert sd_next() function call inside code chunk, like : code chunk create “Next” button goes page 2 looks like : example, next button inserted code chunk ::: fences welcome page order “Next” button goes page 2. can also send user pages just changing value assigned next_page argument. Finally, can also change label button changing label argument, like :","code":"```{r} sd_next(next_page = 'page2') ``` ```{r} sd_next(next_page = 'page2', label = 'Next page') ```"},{"path":"https://jhelvy.github.io/surveydown/articles/content.html","id":"adding-questions","dir":"Articles","previous_headings":"3. Survey body","what":"Adding questions","title":"Survey Content","text":"Every survey question created using sd_question() function inside code chunk. question type defined type argument. example, add multiple choice question, insert following code chunk: code chunk create multiple choice question looks like : favorite type penguin? sd_question() function can used create variety question types, like text input, select drop choices, changing type argument (see vignette(\"questions\")). function many arguments customizing look feel question, height width (see vignette(\"formatting\")). Finally, sd_question() required argument can used make question required optional (e.g., required = TRUE). default FALSE, meaning question optional.","code":"```{r} 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://jhelvy.github.io/surveydown/articles/content.html","id":"server-code-chunk","dir":"Articles","previous_headings":"","what":"4. Server code chunk","title":"Survey Content","text":"bottom .qmd file special “server” code chunk (’s #| context: server bit) defines app server. can customize control survey flow logic well define database store survey response data. looks like : sd_server() function bottom makes everything run, can safely ignore - just don’t change good! sd_database() function set database. See vignette(\"database\") details. sd_config() function can define custom control logic survey, conditional display (conditionally displaying question based responses questions), conditional skip (conditionally sending respondent page based responses questions). See vignette(\"control\")","code":"```{r} #| context: server # Define the database settings db <- sd_database() # Define the configuration settings config <- sd_config() # The sd_server() function initiates your survey - don't change this sd_server( input = input, session = session, config = config, db = db ) ```"},{"path":[]},{"path":"https://jhelvy.github.io/surveydown/articles/control.html","id":"basic-skipping","dir":"Articles","previous_headings":"Page skipping","what":"Basic skipping","title":"Control Logic","text":"Use skip_if argument control basic skipping logic.","code":""},{"path":"https://jhelvy.github.io/surveydown/articles/control.html","id":"custom-skipping","dir":"Articles","previous_headings":"Page skipping","what":"Custom skipping","title":"Control Logic","text":"Use skip_if_custom argument control custom skipping logic.","code":""},{"path":[]},{"path":"https://jhelvy.github.io/surveydown/articles/control.html","id":"basic-conditional-display","dir":"Articles","previous_headings":"Conditional display","what":"Basic conditional display","title":"Control Logic","text":"Use show_if argument control basic conditional display logic.","code":""},{"path":"https://jhelvy.github.io/surveydown/articles/control.html","id":"custom-conditional-display","dir":"Articles","previous_headings":"Conditional display","what":"Custom conditional display","title":"Control Logic","text":"Use show_if_custom argument control custom conditional display logic.","code":""},{"path":"https://jhelvy.github.io/surveydown/articles/database.html","id":"step-1-creating-your-account-","dir":"Articles","previous_headings":"","what":"Step 1: Creating your account.","title":"Database Setup","text":"begin database setup involves creating account supabase website.","code":""},{"path":"https://jhelvy.github.io/surveydown/articles/database.html","id":"step-2-creating-your-account-","dir":"Articles","previous_headings":"","what":"Step 2: Creating your account.","title":"Database Setup","text":"Main page, select “Start Project” underlined red.","code":""},{"path":"https://jhelvy.github.io/surveydown/articles/database.html","id":"step-3-creating-your-database-","dir":"Articles","previous_headings":"","what":"Step 3: Creating your database.","title":"Database Setup","text":"creating new account proceed dashboard, select “New Project”","code":""},{"path":"https://jhelvy.github.io/surveydown/articles/database.html","id":"step-4-creating-your-database-","dir":"Articles","previous_headings":"","what":"Step 4: Creating your database.","title":"Database Setup","text":"next step create respective database, sure take note database password needed later .","code":""},{"path":"https://jhelvy.github.io/surveydown/articles/database.html","id":"step-5-finding-our-db-parameters-","dir":"Articles","previous_headings":"","what":"Step 5: Finding our DB parameters.","title":"Database Setup","text":"project dashboard select settings gear bottom left.","code":""},{"path":"https://jhelvy.github.io/surveydown/articles/database.html","id":"step-6-finding-our-db-parameters-","dir":"Articles","previous_headings":"","what":"Step 6: Finding our DB parameters.","title":"Database Setup","text":"Select “Database” configuration.","code":""},{"path":"https://jhelvy.github.io/surveydown/articles/database.html","id":"step-7-finding-our-db-parameters-","dir":"Articles","previous_headings":"","what":"Step 7: Finding our DB parameters.","title":"Database Setup","text":"Take note connection parameters, well database password Step 4.","code":""},{"path":"https://jhelvy.github.io/surveydown/articles/database.html","id":"step-8-taking-a-look-at-the-sd_database-function-","dir":"Articles","previous_headings":"","what":"Step 8: Taking a look at the sd_database() function.","title":"Database Setup","text":"Now ’ve created database gotten needed parameters can now connect database survey. Taking look code inside survey.qmd file may notice 6 parameters, 5 ’ve discovered earlier. last parameter “table_name”, parameter can name choosing. Note: parameters currently listed NULL must wrapped quotes replaced. may also notice db defined twice. putting parameters respective places make sure delete line: may also notice password parameter hidden inside R environment. security reasons recommended.","code":"# surveydown stores data on a database that you define at https://supabase.com/ # To connect to a database to store the survey data, update this with details # from your supabase account and database. See documentation for details. # For security, we recommend storing your supabase password in your R # environment instead of hard-coding it here, which you can open and edit with # usethis::edit_r_environ() db <- sd_database( host = NULL, db_name = NULL, port = NULL, user = NULL, table_name = NULL, password = Sys.getenv(\"SUPABASE_PASSWORD\") ) # If you don't have a database setup you can just leave the function blank. db <- sd_database() db <- sd_database()"},{"path":"https://jhelvy.github.io/surveydown/articles/database.html","id":"step-9-putting-the-dasebase-password-inside-of-the-r-env-","dir":"Articles","previous_headings":"","what":"Step 9: Putting the dasebase Password inside of the R env.","title":"Database Setup","text":"step shows put database password inside R environment.","code":""},{"path":"https://jhelvy.github.io/surveydown/articles/database.html","id":"first-open-the-r-environment-","dir":"Articles","previous_headings":"Step 9: Putting the dasebase Password inside of the R env.","what":"First: Open the R environment.","title":"Database Setup","text":"open new R tab called “.Renviron”","code":"usethis::edit_r_environ()"},{"path":"https://jhelvy.github.io/surveydown/articles/database.html","id":"second-edit-r-environment-","dir":"Articles","previous_headings":"Step 9: Putting the dasebase Password inside of the R env.","what":"Second: Edit R environment.","title":"Database Setup","text":"Add database password. Note: need wrapped quotes SUPABASE_PASSWORD=######","code":""},{"path":"https://jhelvy.github.io/surveydown/articles/database.html","id":"third-restart-your-r-session","dir":"Articles","previous_headings":"Step 9: Putting the dasebase Password inside of the R env.","what":"Third: Restart your R session","title":"Database Setup","text":"can done going “Session” -> “Restart R” shortcut “Cmd + Shift + 0” Mac.","code":""},{"path":"https://jhelvy.github.io/surveydown/articles/database.html","id":"step-10-bringing-it-all-together-","dir":"Articles","previous_headings":"","what":"Step 10: Bringing it all together.","title":"Database Setup","text":"Now password secure parameters can update sd_database() function Step 8 look like :","code":"db <- sd_database( host = \"aws-0-us-west-1.pooler.supabase.com\", #This varies based on location, #check Step 7. db_name = \"postgres\", # For the purpose of supabase, this will always be \"postgres\". port = \"####\", # Your 4 digit port number from Step 7. user = \"postgres.UserValue\", # This is the User parameter from Step 7. table_name = \"What Ever Name You Want\", # This is what your table name will be. password = Sys.getenv(\"SUPABASE_PASSWORD\") #Database password - Steps 4 and 9. )"},{"path":"https://jhelvy.github.io/surveydown/articles/database.html","id":"tada","dir":"Articles","previous_headings":"","what":"Tada!!!","title":"Database Setup","text":"Going back Project dashboard selecting “Table Editor” left hand bar tab see table appear survey run interacted atleast .","code":""},{"path":"https://jhelvy.github.io/surveydown/articles/deploy.html","id":"demo-survey","dir":"Articles","previous_headings":"","what":"Demo Survey","title":"Deploying Your Survey","text":"trouble constructing survey, prepared demo survey: Online demo survey GitHub repository survey made RStudio using {surveydown} R package surveydown Quarto extension, survey data stored supabase, online website deployed shinyapps.","code":""},{"path":[]},{"path":"https://jhelvy.github.io/surveydown/articles/deploy.html","id":"step-1-1-construct-your-survey","dir":"Articles","previous_headings":"Step 1: Survey Project","what":"Step 1-1: Construct your survey","title":"Deploying Your Survey","text":"Construct survey using {surveydown} R package surveydown Quarto extension. previous articles Usage Guide sufficient guide survey construction process.","code":""},{"path":"https://jhelvy.github.io/surveydown/articles/deploy.html","id":"step-1-2-set-your-password","dir":"Articles","previous_headings":"Step 1: Survey Project","what":"Step 1-2: Set your password","title":"Deploying Your Survey","text":"One important setting password supabase project. ’s . set supabase project, create password . password defined survey project. end survey .qmd file, ’ll need define db variable, settings supabase project. argument called password. can directly paste password password = \"my_password\", ’s recommended since make supabase project unsafe. recommend write password = Sys.getenv(\"SUPABASE_PASSWORD\"), like : , define password using sd_set_password() function. example, password my_password, run sd_set_password(\"my_password\") R Console. Great! Now supabase password successfully defined survey project! interested, details sd_set_password() : creates .Renviron file writes existing one. .Renviron file, writes SUPABASE_PASSWORD=my_password, \"my_password\" whatever argument sd_set_password() function. previously defined SUPABASE_PASSWORD .Renviron, overwritten, safe run function multiple times. adds .Renviron .gitignore avoid pushed GitHub thus keeps password safe. run multiple times, .Renviron appear .gitignore.","code":"db <- sd_database( # Other settings... password = Sys.getenv(\"SUPABASE_PASSWORD\") )"},{"path":"https://jhelvy.github.io/surveydown/articles/deploy.html","id":"step-1-3-render-your--qmd-file","dir":"Articles","previous_headings":"Step 1: Survey Project","what":"Step 1-3: Render your .qmd file","title":"Deploying Your Survey","text":"simple: just hit Render cmd/ctrl + shift + K (Mac/Win). reason make stand-alone step , WITHOUT rendering .qmd file, survey deployed online. One thing… fail deploy locally set every argument correctly db variable, try define gssencmode = \"disable\" db variable: can help solve connection problem. value gssencmode set \"prefer\" default.","code":"db <- sd_database( # Other settings... gssencmode = \"disable\" )"},{"path":"https://jhelvy.github.io/surveydown/articles/deploy.html","id":"step-2-supabase-project","dir":"Articles","previous_headings":"","what":"Step 2: Supabase Project","title":"Deploying Your Survey","text":"covered 5. Database Setup. want mention don’t need actively create table supabase project. db variable .qmd file, table_name argument. Whatever name define become table name supabase: example, table name supabase project \"demo\". survey project runs successfully locally can survey data collected supabase, ready online deployment.","code":"db <- sd_database( # Other settings... table_name = \"demo\" )"},{"path":"https://jhelvy.github.io/surveydown/articles/deploy.html","id":"step-3-online-deployment","dir":"Articles","previous_headings":"","what":"Step 3: Online Deployment","title":"Deploying Your Survey","text":"final step: deploy survey online. ’m glad ’ve made far! almost ! ’ll use shinyapps.io. Now start, two explanations clear possible questions: shinyapps.io can support Shiny Apps Quarto Shiny Documents. case, survey considered Quarto Shiny Document. Quarto Pub also website publishing platform. fact, Quarto Pub shinyapps.io provided Posit. However, DON’T use Quarto Pub survey deployment. core reason , shinyapps.io can make interactive websites, Quarto Pub makes static websites. survey apparently interactive website, ’s compatible shinyapps.io, Quarto Pub. start using shinyapps.io, ’ll need create account follow basic instructions set sub-domain authorize IDE. See information . account sub-domain ready, ’s time deploy survey website. Make sure rsconnect R package installed (done authorize IDE): simplest way run : URL page domain followed /your_survey, means name .qmd file URL. tab name HTML page also your_survey. Better give good name .qmd file. , ’ll need firstly render locally make sure works properly. Otherwise, deployment fail. want define different tab name survey page, run: Now survey site deployed. survey now served shinyapps.io, data stored supabase. Congratulations! explanation (personal interpretation) deployment functions: rsconnect, two functions can used deployment: deployApp() deployDoc(). serve different purposes mix-used. deployApp() used deploy Shiny App. doesn’t work .qmd, works Shiny App .rmd, accepts multiple files. deployDoc() used deploy Quarto Shiny Document. works single file tries “automatically discover dependencies” (direct paste official instructions). Since survey Quarto Shiny Document, use deployDoc(). guess deployDoc() newer function specifically works .qmd. feeling function specifically made .qmd match fact “single document” “dependencies”. case, deployDoc() perfect match.","code":"install.packages('rsconnect') rsconnect::deployDoc(\"your_survey.qmd\") rsconnect::deployDoc( doc = \"your_survey.qmd\", appName = \"Survey Name\" )"},{"path":"https://jhelvy.github.io/surveydown/articles/formatting.html","id":"markdown","dir":"Articles","previous_headings":"","what":"Markdown","title":"Formatting Your Survey","text":"Markdown supported question label. label argument question type can accept markdown formatting. example, question uses ** symbols make works bold. Scripts: Output: Markdown also supported options mc_buttons questions. mc_button type questions, can also use markdown format option labels. Scripts: Output: true mc_multiple_buttons. Scripts: Output:","code":"sd_question( type = 'mc', id = 'markdown_label', label = \"**This** is a question *label* supporting ***markdown***:\", option = c( \"Option A\" = \"option_a\", \"Option B\" = \"option_b\", \"Option C\" = \"option_c\" ) ) sd_question( type = 'mc_buttons', id = 'markdown_buttons', label = \"The 3 options below support markdown:\", option = c( \"*Option A*\" = \"option_a\", \"**Option B**\" = \"option_b\", \"***Option C***\" = \"option_c\" ) ) sd_question( type = 'mc_multiple_buttons', id = 'markdown_multiple_buttons', label = \"The 3 options below support markdown:\", option = c( \"*Option A*\" = \"option_a\", \"**Option B**\" = \"option_b\", \"***Option C***\" = \"option_c\" ) )"},{"path":"https://jhelvy.github.io/surveydown/articles/formatting.html","id":"html","dir":"Articles","previous_headings":"","what":"HTML","title":"Formatting Your Survey","text":"HTML supported options mc_buttons mc_multiple_buttons, can insert mixed content including plain text, markdown, HTML images. example, question complex labels choice question. Scripts: Output:","code":"# Define the option vector html_buttons_option <- c(\"option_1\", \"option_2\", \"option_3\") # Change the names of each element to display markdown-formatted text # and an embedded image using html names(html_buttons_option)[1] <- \"**Option 1**

**Type**: Fuji
**Price**: $ 2 / lb
**Freshness**: Average\" names(html_buttons_option)[2] <- \"**Option 2**

**Type**: Pink Lady
**Price**: $ 1.5 / lb
**Freshness**: Excellent\" names(html_buttons_option)[3] <- \"**Option 3**

**Type**: Honeycrisp
**Price**: $ 2 / lb
**Freshness**: Poor\" sd_question( type = 'mc_buttons', id = 'html_buttons', label = \"A sample survey question using `mc_buttons`\", option = html_buttons_option )"},{"path":"https://jhelvy.github.io/surveydown/articles/formatting.html","id":"width","dir":"Articles","previous_headings":"","what":"Width","title":"Formatting Your Survey","text":"Use width argument change width question. Scripts: Output:","code":"sd_question( type = \"textarea\", id = \"change_width\", label = \"This text area has width set as 40%:\", width = \"40%\" )"},{"path":"https://jhelvy.github.io/surveydown/articles/install.html","id":"install-r-quarto","dir":"Articles","previous_headings":"","what":"Install R & Quarto","title":"Installation","text":"need : Install R Install Quarto Also, recommend working IDE. RStudio great, also like VS Code Positron.","code":""},{"path":"https://jhelvy.github.io/surveydown/articles/install.html","id":"install-the-surveydown-r-package","dir":"Articles","previous_headings":"","what":"Install the {surveydown} R package","title":"Installation","text":"{surveydown} yet CRAN, can install development version GitHub following command R:","code":"# install.packages(\"remotes\") remotes::install_github(\"jhelvy/surveydown\")"},{"path":"https://jhelvy.github.io/surveydown/articles/install.html","id":"install-the-surveydown-quarto-extension","dir":"Articles","previous_headings":"","what":"Install the surveydown Quarto Extension","title":"Installation","text":"start working actual survey, ’ll need surveydown Quarto extension. recommend starting template survey, automatically add latest extension : Otherwise, can install extension using terminal {surveydown} package: Using Terminal: Using {surveydown} R package:","code":"surveydown::sd_create_survey(\"path/to/folder\") quarto install extension jhelvy/surveydown-ext surveydown::sd_update_extension()"},{"path":"https://jhelvy.github.io/surveydown/articles/install.html","id":"version-control","dir":"Articles","previous_headings":"","what":"Version Control","title":"Installation","text":"check latest R package Quarto extension versions installed, run: update R package Quarto extension latest version:","code":"surveydown::sd_check_versions() surveydown::sd_update_surveydown()"},{"path":"https://jhelvy.github.io/surveydown/articles/questions.html","id":"introduction-of-arguments","dir":"Articles","previous_headings":"","what":"Introduction of Arguments","title":"Question Types","text":"article showcases different types question supported surveydown. question requires user define following arguments sd_question() function: id: unique identifier question, used variable name resulting survey data. label: label displayed question survey. text: Single line open text input. textarea: Multiple line open text input. numeric: Single line numeric text input. mc: Multiple choice single select option (radio buttons). mc_buttons: mc “button” style instead radio buttons. mc_multiple: Multiple choice mutliple select options (check boxes). mc_multiple_buttons: mc_multiple “button” style instead check boxes. select: Select choice drop menu. slider: (construction) Slider select discrete categories continuous numbers. date: Select date calendar widget. daterange: Select two dates calendar widgets (e.g. begin end dates).","code":""},{"path":[]},{"path":"https://jhelvy.github.io/surveydown/articles/questions.html","id":"text","dir":"Articles","previous_headings":"Question Types","what":"1. text","title":"Question Types","text":"Use type = 'text' specify text input type question. Scripts: Output:","code":"sd_question( type = \"text\", id = \"silly_word\", label = \"Write a silly word:\" )"},{"path":"https://jhelvy.github.io/surveydown/articles/questions.html","id":"textarea","dir":"Articles","previous_headings":"Question Types","what":"2. textarea","title":"Question Types","text":"Use type = 'textarea' specify text area input type question. Scripts: Output:","code":"sd_question( type = \"textarea\", id = \"silly_paragraph\", label = \"Write a silly paragraph:\" )"},{"path":"https://jhelvy.github.io/surveydown/articles/questions.html","id":"numeric","dir":"Articles","previous_headings":"Question Types","what":"3. numeric","title":"Question Types","text":"Use type = 'numeric' specify numeric input type. Scripts: Output:","code":"sd_question( type = 'numeric', id = 'age', label = \"What's your age?\" )"},{"path":"https://jhelvy.github.io/surveydown/articles/questions.html","id":"mc","dir":"Articles","previous_headings":"Question Types","what":"4. mc","title":"Question Types","text":"Use type = 'mc' specify multiple choice type question single choice option. Scripts: Output:","code":"sd_question( type = 'mc', id = 'artist', label = \"Which artist do you prefer most from this list?\", option = c( \"Taylor Swift\" = \"taylor_swift\", \"Beyoncé\" = \"beyonce\", \"Adele\" = \"adele\", \"Rihanna\" = \"rihanna\", \"Lady Gaga\" = \"ladygaga\", \"Ed Sheeran\" = \"ed_sheeran\", \"Drake\" = \"drake\" ) )"},{"path":"https://jhelvy.github.io/surveydown/articles/questions.html","id":"mc_buttons","dir":"Articles","previous_headings":"Question Types","what":"5. mc_buttons","title":"Question Types","text":"Use type = 'mc_buttons' generate button version mc. Scripts: Output:","code":"sd_question( type = 'mc_buttons', id = 'fruit', label = \"Which fruit do you prefer most from this list?\", option = c( \"Apple\" = \"apple\", \"Banana\" = \"banana\", \"Pear\" = \"pear\", \"Strawberry\" = \"strawberry\", \"Grape\" = \"grape\", \"Mango\" = \"mango\", \"Watermelon\" = \"watermelon\" ) )"},{"path":"https://jhelvy.github.io/surveydown/articles/questions.html","id":"mc_multiple","dir":"Articles","previous_headings":"Question Types","what":"6. mc_multiple","title":"Question Types","text":"Use type = 'mc_multiple' specify multiple choice type question multiple selection enabled. Scripts: Output:","code":"sd_question( type = 'mc_multiple', id = 'swift', label = \"What are your favorite Taylor Swift albums (select all that apply)?\", option = c( \"Taylor Swift (2006)\" = \"taylor_swift\", \"Fearless (2008)\" = \"fearless\", \"Speak Now (2010)\" = \"speak_now\", \"Red (2012)\" = \"red\", \"1989 (2014)\" = \"1989\", \"Reputation (2017)\" = \"reputation\", \"Lover (2019)\" = \"lover\", \"Folklore (2020)\" = \"folklore\", \"Evermore (2020)\" = \"evermore\", \"Midnights (2022)\" = \"midnights\" ) )"},{"path":"https://jhelvy.github.io/surveydown/articles/questions.html","id":"mc_multiple_buttons","dir":"Articles","previous_headings":"Question Types","what":"7. mc_multiple_buttons","title":"Question Types","text":"Use type = 'mc_multiple_buttons' generate button version mc_multiple. Scripts: Output:","code":"sd_question( type = 'mc_multiple_buttons', id = 'michael_jackson', label = \"Which are your favorite Michael Jackson songs (select all that apply)?\", option = c( \"Thriller (1982)\" = \"thriller\", \"Billie Jean (1982)\" = \"billie_jean\", \"Beat It (1982)\" = \"beat_it\", \"Man in the Mirror (1987)\" = \"man_in_the_mirror\", \"Smooth Criminal (1987)\" = \"smooth_criminal\", \"Black or White (1991)\" = \"black_or_white\", \"Bad (1987)\" = \"bad\", \"Human Nature (1982)\" = \"human_nature\" ) )"},{"path":"https://jhelvy.github.io/surveydown/articles/questions.html","id":"select","dir":"Articles","previous_headings":"Question Types","what":"8. select","title":"Question Types","text":"Use type = 'select' specify drop select type question. Scripts: Output:","code":"sd_question( type = 'select', id = 'education', label = \"What is the highest level of education you have attained?\", option = c( \"Did not attend high school\" = \"hs_no\", \"Some high school\" = \"hs_some\", \"High school graduate\" = \"hs_grad\", \"Some college\" = \"college_some\", \"College\" = \"college_grad\", \"Graduate Work\" = \"grad\", \"Prefer not to say\" = \"no_response\" ) )"},{"path":"https://jhelvy.github.io/surveydown/articles/questions.html","id":"slider-under-construction","dir":"Articles","previous_headings":"Question Types","what":"9. slider (Under Construction)","title":"Question Types","text":"Due compatibility issues, slider type still construction. Now slider axis show numeric values ranging 10 100. solve problem future releases. Use type = 'slider' specify slider input type. Scripts: Output: type = 'slider' can also used select range. Scripts: Output:","code":"sd_question( type = 'slider', id = 'climate_care', label = \"To what extent do you believe human-caused climate change is real?\", option = c( \"Don't Believe\" = \"dont_believe\", \"Somewhat Believe\" = \"somewhat\", \"Neutral\" = \"neutral\", \"Believe\" = \"believe\", \"Strongly Believe\" = \"strongly_believe\" ) ) sd_question( type = 'slider', id = 'coldest_months', label = \"What months do you think are the coldest throughout a year?\", option = month.abb, selected = month.abb[c(4, 8)] )"},{"path":"https://jhelvy.github.io/surveydown/articles/questions.html","id":"date","dir":"Articles","previous_headings":"Question Types","what":"10. date","title":"Question Types","text":"Use type = 'date' specify date input type. Scripts: Output: date value today’s date default. Upon clicking text box, provided date dialog box choose date .","code":"sd_question( type = 'date', id = 'dob', label = \"What is your date of birth?\" )"},{"path":"https://jhelvy.github.io/surveydown/articles/questions.html","id":"daterange","dir":"Articles","previous_headings":"Question Types","what":"11. daterange","title":"Question Types","text":"Use type = 'daterange' specify date range input type. Scripts: Output:","code":"sd_question( type = 'daterange', id = 'hs_date', label = \"When did you start and finish high school?\" )"},{"path":"https://jhelvy.github.io/surveydown/articles/surveydown.html","id":"install-surveydown","dir":"Articles","previous_headings":"","what":"1. Install surveydown","title":"Introduction to surveydown","text":"See vignette(\"install\")","code":""},{"path":"https://jhelvy.github.io/surveydown/articles/surveydown.html","id":"start-with-a-template","dir":"Articles","previous_headings":"","what":"2. Start with a template","title":"Introduction to surveydown","text":"R console, run following setup template survey: create folder located \"path//folder\" following files: example.qmd: template survey edit. example.Rproj: RStudio project file (helpful ’re working RStudio) _extensions: folder surveydown Quarto extension needed make everything work (don’t modify ).","code":"surveydown::sd_create_survey(\"path/to/folder\")"},{"path":"https://jhelvy.github.io/surveydown/articles/surveydown.html","id":"add-content","dir":"Articles","previous_headings":"","what":"3. Add content","title":"Introduction to surveydown","text":"See vignette(\"content\") details adding content survey, like text, images, etc. markdown / code chunks. quick overview: Add pages using fences, like : Add questions sd_question() function code chunks (see vignette(\"questions\") supported question types). example:","code":"::: {#page1 .sd-page} Page 1 content here ::: ```{r} 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://jhelvy.github.io/surveydown/articles/surveydown.html","id":"add-control-logic","dir":"Articles","previous_headings":"","what":"4. Add control logic","title":"Introduction to surveydown","text":"server chunk (bottom qmd file), add control logic survey sd_config() function. See vignette(\"control\")","code":""},{"path":"https://jhelvy.github.io/surveydown/articles/surveydown.html","id":"setup-your-database","dir":"Articles","previous_headings":"","what":"5. Setup your database","title":"Introduction to surveydown","text":"Also server chunk, setup database sd_database() function, leave blank preview / edit survey without database connected. See vignette(\"database\")","code":""},{"path":"https://jhelvy.github.io/surveydown/articles/surveydown.html","id":"locally-preview","dir":"Articles","previous_headings":"","what":"6. Locally preview","title":"Introduction to surveydown","text":"Preview survey clicking “Run Document” button RStudio terminal running command quarto serve survey_file_name.qmd.","code":""},{"path":"https://jhelvy.github.io/surveydown/articles/surveydown.html","id":"deploy","dir":"Articles","previous_headings":"","what":"7. Deploy","title":"Introduction to surveydown","text":"Deploy survey hosting favorite server, like shinyapps.io, huggingface, etc. See vignette(\"deploy\")","code":""},{"path":"https://jhelvy.github.io/surveydown/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.","code":""},{"path":"https://jhelvy.github.io/surveydown/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 Documents. R package, https://jhelvy.github.io/surveydown/.","code":"@Manual{, title = {{surveydown}: Markdown-Based Surveys Using Quarto Shiny Documents}, author = {John Paul Helveston and Pingfan Hu and Bogdan Bunea}, year = {2024}, note = {R package}, url = {https://jhelvy.github.io/surveydown/}, }"},{"path":[]},{"path":"https://jhelvy.github.io/surveydown/index.html","id":"markdown-based-surveys-with-quarto-shiny-documents","dir":"","previous_headings":"","what":"Markdown-Based Surveys With Quarto Shiny Documents.","title":"Build markdown-based surveys with quarto shiny documents","text":"Note: still early-stage project. don’t yet recommend using collecting data, love feedback try ! project brings together three open source technologies (Quarto, shiny, supabase) create dynamic, markdown-based surveys. ’s basic concept: Design survey Quarto shiny document using markdown R code. Render doc shiny app can hosted online sent respondents. Store survey responses supabase database. {surveydown} R package works tandem surveydown Quarto extension make everything work. See documentation get started making surveydown survey!","code":""},{"path":"https://jhelvy.github.io/surveydown/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. open-source, markdown-based platform, surveydown designed address problems. surveydown, survey content created plain text (markdown R code) single .qmd file renders shiny app. makes survey easy reproduce, share, version control common tools like Git. resulting shiny app survey can hosted number platforms, like shinyapps.io huggingface, survey data collected owned survey designer supabase account. Best , everything open source free :) ’re curious whole idea came , check blog post, outlines general idea motivation . post now outdated terms overall design, provides something origin story motivation developing project.","code":""},{"path":"https://jhelvy.github.io/surveydown/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 adding 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 preview = TRUE (database ignored) Export timestamps page data Export timestamps question interaction (since increase data size considerably, maybe add question_times = FALSE argument) Option start designated page, e.g. start_page = 'page_name' show_all = TRUE argument show pages hidden questions launched (e.g. able print entire survey text). also called print_mode = TRUE. Set SCSS compatible Quarto-supported bootstrap themes Add optional progress bar Include input checks skip_if show_if (question_id exists, data frame names correct) Required questions (required = TRUE): post popup question required allowing next button. Default required = FALSE. Form validation: Make sure user inputs correct type depending question type. (see https://shiny.posit.co/r/reference/shiny/0.14/validate.html) Admin page w/password preview / download data (see https://github.com/daattali/shinyforms) User tracking via url parameters: https://shinysurveys.jdtrat.com/articles/surveying-shinysurveys.html#user-tracking Deal cookies users close browser can start back left . Add sd_get_data() function survey designer can obtain current survey results inside app: https://shinysurveys.jdtrat.com/articles/get-survey-data.html Multiple choice (single choice) Multiple choice (multiple choices) Select Text Numeric Multiple choice (button…like formr mc_button) Text area Date Matrix [?] Slider Resources / examples: shinysurveys shinyforms Example adding JS modules shiny app (pop message) - useful adding number JS-based features, like pop ups required questions, JS-based progress bar, etc.","code":""},{"path":"https://jhelvy.github.io/surveydown/index.html","id":"documentation-todo","dir":"","previous_headings":"","what":"Documentation TODO","title":"Build markdown-based surveys with quarto shiny documents","text":"Vignettes following: Quick overview / basic usage List question types examples Question formatting options Flow control (conditional skipping conditional display) Setting database supabase","code":""},{"path":[]},{"path":"https://jhelvy.github.io/surveydown/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://jhelvy.github.io/surveydown/reference/download_extension.html","id":null,"dir":"Reference","previous_headings":"","what":"Download and Extract Survey Extension — download_extension","title":"Download and Extract Survey Extension — download_extension","text":"helper function downloads surveydown extension GitHub extracts .","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/download_extension.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Download and Extract Survey Extension — download_extension","text":"","code":"download_extension(temp_dir)"},{"path":"https://jhelvy.github.io/surveydown/reference/download_extension.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Download and Extract Survey Extension — download_extension","text":"temp_dir temporary directory store downloaded files.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/download_extension.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Download and Extract Survey Extension — download_extension","text":"character string path unzipped directory.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/get_extension_version.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Surveydown Extension Version — get_extension_version","title":"Get Surveydown Extension Version — get_extension_version","text":"function reads version surveydown Quarto extension _extension.yml file.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/get_extension_version.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Surveydown Extension Version — get_extension_version","text":"","code":"get_extension_version(path = getwd())"},{"path":"https://jhelvy.github.io/surveydown/reference/get_extension_version.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Surveydown Extension Version — get_extension_version","text":"path character string specifying directory search extension. Defaults current working directory.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/get_extension_version.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Surveydown Extension Version — get_extension_version","text":"character string representing extension version, NULL extension found.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/get_latest_version_from_url.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Latest Version from URL — get_latest_version_from_url","title":"Get Latest Version from URL — get_latest_version_from_url","text":"function fetches latest version file given URL.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/get_latest_version_from_url.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Latest Version from URL — get_latest_version_from_url","text":"","code":"get_latest_version_from_url(url, pattern)"},{"path":"https://jhelvy.github.io/surveydown/reference/get_latest_version_from_url.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Latest Version from URL — get_latest_version_from_url","text":"url URL file containing version information pattern pattern search file (e.g., \"Version: \" \"version: \")","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/get_latest_version_from_url.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Latest Version from URL — get_latest_version_from_url","text":"package_version object representing latest version, NULL unable fetch","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/sd_check_versions.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Surveydown Versions — sd_check_versions","title":"Check Surveydown Versions — sd_check_versions","text":"function checks local surveydown R package Quarto extension --date latest online version.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/sd_check_versions.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Surveydown Versions — sd_check_versions","text":"","code":"sd_check_versions()"},{"path":"https://jhelvy.github.io/surveydown/reference/sd_check_versions.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Surveydown Versions — sd_check_versions","text":"return value, called side effects (prints version information).","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/sd_check_versions.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Surveydown Versions — sd_check_versions","text":"","code":"sd_check_versions() #> surveydown R package (local): 0.0.8 #> surveydown R package (latest): 0.0.8 #> surveydown Quarto ext (local): Not found #> surveydown Quarto ext (latest): 0.0.8 #> #> Updates are available. To update both the package and extension to the latest version, run: surveydown::sd_update_surveydown()"},{"path":"https://jhelvy.github.io/surveydown/reference/sd_config.html","id":null,"dir":"Reference","previous_headings":"","what":"Configuration Function for surveydown Surveys — sd_config","title":"Configuration Function for surveydown Surveys — sd_config","text":"function sets configuration surveydown survey, including page question structures, conditional display settings, navigation options.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/sd_config.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Configuration Function for surveydown Surveys — sd_config","text":"","code":"sd_config( skip_if = NULL, skip_if_custom = NULL, show_if = NULL, show_if_custom = NULL, start_page = NULL, show_all_pages = FALSE, admin_page = FALSE )"},{"path":"https://jhelvy.github.io/surveydown/reference/sd_config.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Configuration Function for surveydown Surveys — sd_config","text":"skip_if list conditions certain pages skipped. Defaults NULL. skip_if_custom custom function handle conditions certain pages skipped. Defaults NULL. show_if list conditions certain pages shown. Defaults NULL. show_if_custom custom function handle conditions certain pages shown. Defaults NULL. start_page Character string. ID page start . Defaults NULL. show_all_pages Logical. Whether show pages initially. Defaults FALSE. admin_page Logical. Whether include admin page viewing downloading survey data. Defaults FALSE.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/sd_config.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Configuration Function for surveydown Surveys — sd_config","text":"list containing configuration settings survey, including page question structures, conditional display settings, navigation options, admin page settings.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/sd_config.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Configuration Function for surveydown Surveys — sd_config","text":"function retrieves survey metadata, checks validity conditional display settings, ensures specified start page () exists. stores settings configuration list. admin_page set TRUE, admin page included survey. page allows viewing downloading survey data upon entering correct survey password (set using sd_set_password()).","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/sd_config.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Configuration Function for surveydown Surveys — sd_config","text":"","code":"if (FALSE) { # \\dontrun{ config <- sd_config( skip_if = list(), skip_if_custom = NULL, show_if = list(), show_if_custom = NULL, start_page = \"page1\", show_all_pages = FALSE, admin_page = TRUE ) } # }"},{"path":"https://jhelvy.github.io/surveydown/reference/sd_create_survey.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a Survey Template — sd_create_survey","title":"Create a Survey Template — sd_create_survey","text":"function creates survey template specified directory. can use different templates, \"simple\" default. function prompts user confirm use current working directory path specified.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/sd_create_survey.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a Survey Template — sd_create_survey","text":"","code":"sd_create_survey(path = getwd(), template = \"simple\")"},{"path":"https://jhelvy.github.io/surveydown/reference/sd_create_survey.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a Survey Template — sd_create_survey","text":"path character string specifying directory create survey template. Defaults current working directory. template character string specifying survey template use. Defaults \"simple\".","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/sd_create_survey.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a Survey Template — sd_create_survey","text":"message indicating successful creation survey template.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/sd_create_survey.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a Survey Template — sd_create_survey","text":"","code":"if (FALSE) { # \\dontrun{ sd_create_survey() sd_create_survey(path = \"path/to/package\", template = \"simple\") } # }"},{"path":"https://jhelvy.github.io/surveydown/reference/sd_database.html","id":null,"dir":"Reference","previous_headings":"","what":"Connect to a supabase Database — sd_database","title":"Connect to a supabase Database — sd_database","text":"function establishes connection supabase database using provided connection details.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/sd_database.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Connect to a supabase Database — sd_database","text":"","code":"sd_database( host = NULL, db_name = NULL, port = NULL, user = NULL, table_name = NULL, password = Sys.getenv(\"SURVEYDOWN_PASSWORD\"), gssencmode = \"prefer\", pause = FALSE )"},{"path":"https://jhelvy.github.io/surveydown/reference/sd_database.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Connect to a supabase Database — sd_database","text":"host Character string. host address supabase database. db_name Character string. name supabase database. port Integer. port number supabase database connection. user Character string. username supabase database connection. table_name Character string. name table interact supabase database. password Character string. password supabase database connection. Defaults value SURVEYDOWN_PASSWORD environment variable. gssencmode Character string. GSS encryption mode database connection. Defaults \"prefer\". pause Logical. TRUE, data saved local CSV file instead database. Defaults FALSE.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/sd_database.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Connect to a supabase Database — sd_database","text":"list containing database connection object (db) table name (table_name), NULL pause mode.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/sd_database.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Connect to a supabase Database — sd_database","text":"function checks presence required parameters attempts establish connection supabase database. successful, returns list containing database connection object table name. user must created specified table supabase beforehand. pause mode enabled, function returns NULL data saved local CSV file. password obtained SURVEYDOWN_PASSWORD environment variable default, can overridden explicitly passing value.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/sd_database.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Connect to a supabase Database — sd_database","text":"user must create table inside supabase order make additions.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/sd_database.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Connect to a supabase Database — sd_database","text":"","code":"if (FALSE) { # \\dontrun{ # Assuming SURVEYDOWN_PASSWORD is set in .Renviron db_connection <- sd_database( host = \"aws-0-us-west-1.pooler.supabase.com\", db_name = \"postgres\", port = \"6---\", user = \"postgres.k----------i\", table_name = \"your-table-name\", pause = FALSE ) # Explicitly providing the password db_connection <- sd_database( host = \"aws-0-us-west-1.pooler.supabase.com\", db_name = \"postgres\", port = \"6---\", user = \"postgres.k----------i\", table_name = \"your-table-name\", password = \"your-password\", pause = FALSE ) } # }"},{"path":"https://jhelvy.github.io/surveydown/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.","code":""},{"path":"https://jhelvy.github.io/surveydown/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 = \"Next\")"},{"path":"https://jhelvy.github.io/surveydown/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 \"Next\".","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/sd_next.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a 'Next' Button for Page Navigation — sd_next","text":"Shiny action button UI element.","code":""},{"path":"https://jhelvy.github.io/surveydown/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, sets input value specified next page ID, facilitating page navigation within Shiny application.","code":""},{"path":"https://jhelvy.github.io/surveydown/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 (FALSE) { # \\dontrun{ ui <- fluidPage( sd_next(next_page = \"page2\", label = \"Next Page\") ) server <- function(input, output, session) { observeEvent(input$next_page, { # Navigate to the next page shinyjs::hide(\"page1\") shinyjs::show(\"page2\") }) } shinyApp(ui, server) } # }"},{"path":"https://jhelvy.github.io/surveydown/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.","code":""},{"path":"https://jhelvy.github.io/surveydown/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, required = FALSE, resize = NULL )"},{"path":"https://jhelvy.github.io/surveydown/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\". See \"Details\" section type. 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 justified. 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. required Logical. Whether input required. Defaults FALSE. resize Character string. Resize option textarea input. Defaults NULL.","code":""},{"path":"https://jhelvy.github.io/surveydown/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 custom data attribute question ID.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/sd_question.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create a survey question — sd_question","text":"Insert detailed information , details types questions","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/sd_question.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a survey question — sd_question","text":"","code":"# Insert examples here"},{"path":"https://jhelvy.github.io/surveydown/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, handling various operations conditional display, progress tracking, page navigation, database updates.","code":""},{"path":"https://jhelvy.github.io/surveydown/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(input, session, config, db = NULL)"},{"path":"https://jhelvy.github.io/surveydown/reference/sd_server.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Server Logic for a surveydown survey — sd_server","text":"input Shiny input object. session Shiny session object. config list containing configuration settings application. Expected elements include page_structure, page_ids, question_ids, show_if, skip_if, skip_if_custom, show_if_custom, preview, start_page. db list containing database connection information created using sd_database() function. Expected elements include db table_name. Defaults NULL.","code":""},{"path":"https://jhelvy.github.io/surveydown/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 local variables based provided configuration. Sets reactive values track timestamps progress. Implements conditional display logic UI elements based show_if show_if_custom conditions. Tracks progress answered questions updates progress bar accordingly. Handles page navigation within Shiny application, including basic custom skip logic. Performs database operations store responses, either specified database local CSV file preview mode.","code":""},{"path":"https://jhelvy.github.io/surveydown/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 (FALSE) { # \\dontrun{ server <- function(input, output, session) { config <- list( page_structure = list(), page_ids = c(\"page1\", \"page2\"), question_ids = c(\"q1\", \"q2\"), show_if = NULL, skip_if = NULL, skip_if_custom = NULL, show_if_custom = NULL, start_page = \"page1\" ) sd_server(input, session, config) } shinyApp(ui = ui, server = server) } # }"},{"path":"https://jhelvy.github.io/surveydown/reference/sd_set_password.html","id":null,"dir":"Reference","previous_headings":"","what":"Set Supabase Password — sd_set_password","title":"Set Supabase Password — sd_set_password","text":"function sets supabase password .Renviron file adds .Renviron .gitignore.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/sd_set_password.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set Supabase Password — sd_set_password","text":"","code":"sd_set_password(password)"},{"path":"https://jhelvy.github.io/surveydown/reference/sd_set_password.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set Supabase Password — sd_set_password","text":"password Character string. password set Supabase connection.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/sd_set_password.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set Supabase Password — sd_set_password","text":"None. function called side effects.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/sd_set_password.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Set Supabase Password — 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://jhelvy.github.io/surveydown/reference/sd_set_password.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Set Supabase Password — sd_set_password","text":"","code":"if (FALSE) { # \\dontrun{ sd_set_password(\"your_SURVEYDOWN_PASSWORD\") } # }"},{"path":"https://jhelvy.github.io/surveydown/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 required surveydown survey. sets Shiny application Bootstrap 5 initializes Shinyjs JavaScript functionalities.","code":""},{"path":"https://jhelvy.github.io/surveydown/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://jhelvy.github.io/surveydown/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://jhelvy.github.io/surveydown/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://jhelvy.github.io/surveydown/reference/sd_setup.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Required Set Up Function — sd_setup","text":"","code":"if (FALSE) { # \\dontrun{ ui <- fluidPage( sd_setup(), # Your UI elements here ) server <- function(input, output, session) { # Your server logic here } shinyApp(ui, server) } # }"},{"path":"https://jhelvy.github.io/surveydown/reference/sd_update_extension.html","id":null,"dir":"Reference","previous_headings":"","what":"Update Survey Extension — sd_update_extension","title":"Update Survey Extension — sd_update_extension","text":"function updates creates _extensions/jhelvy/surveydown folder latest contents surveydown-ext repository.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/sd_update_extension.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Update Survey Extension — sd_update_extension","text":"","code":"sd_update_extension(path = getwd())"},{"path":"https://jhelvy.github.io/surveydown/reference/sd_update_extension.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Update Survey Extension — sd_update_extension","text":"path character string specifying directory update create extension. Defaults current working directory.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/sd_update_extension.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Update Survey Extension — sd_update_extension","text":"message indicating successful update extension.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/sd_update_extension.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Update Survey Extension — sd_update_extension","text":"","code":"if (FALSE) { # \\dontrun{ sd_update_extension() sd_update_extension(path = \"path/to/project\") } # }"},{"path":"https://jhelvy.github.io/surveydown/reference/sd_update_surveydown.html","id":null,"dir":"Reference","previous_headings":"","what":"Update Surveydown Package and Extension — sd_update_surveydown","title":"Update Surveydown Package and Extension — sd_update_surveydown","text":"function checks updates surveydown R package associated Quarto extension. ensures components --date versions match.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/sd_update_surveydown.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Update Surveydown Package and Extension — sd_update_surveydown","text":"","code":"sd_update_surveydown(force = FALSE)"},{"path":"https://jhelvy.github.io/surveydown/reference/sd_update_surveydown.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Update Surveydown Package and Extension — sd_update_surveydown","text":"force Logical; TRUE, forces update regardless current versions. Defaults FALSE.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/sd_update_surveydown.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Update Surveydown Package and Extension — sd_update_surveydown","text":"return value, called side effects.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/sd_update_surveydown.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Update Surveydown Package and Extension — sd_update_surveydown","text":"","code":"if (FALSE) { # \\dontrun{ sd_update_surveydown() sd_update_surveydown(force = TRUE) } # }"},{"path":[]},{"path":"https://jhelvy.github.io/surveydown/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://jhelvy.github.io/surveydown/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://jhelvy.github.io/surveydown/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://jhelvy.github.io/surveydown/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://jhelvy.github.io/surveydown/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://jhelvy.github.io/surveydown/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://jhelvy.github.io/surveydown/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://jhelvy.github.io/surveydown/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":"https://jhelvy.github.io/surveydown/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://jhelvy.github.io/surveydown/articles/content.html","id":"start-with-a-template","dir":"Articles","previous_headings":"","what":"Start with a template","title":"Survey Content","text":"R console, run following setup template survey: create folder located \"path//folder\" following files: example.qmd: template survey edit. example.Rproj: RStudio project file (helpful ’re working RStudio) _extensions: folder surveydown Quarto extension needed make everything work (don’t modify ). Every survey created {surveydown} separate project folder.","code":"surveydown::sd_create_survey(\"path/to/folder\")"},{"path":"https://jhelvy.github.io/surveydown/articles/content.html","id":"survey-components","dir":"Articles","previous_headings":"","what":"Survey components","title":"Survey Content","text":"Every {surveydown} survey configured single .qmd file consists 4 parts: YAML header. setup code chunk. survey body. server code chunk.","code":""},{"path":"https://jhelvy.github.io/surveydown/articles/content.html","id":"yaml-header","dir":"Articles","previous_headings":"","what":"1. YAML Header","title":"Survey Content","text":"YAML header top .qmd file. addition two required elements, YAML can used set survey theme well modify survey progress bar.","code":""},{"path":"https://jhelvy.github.io/surveydown/articles/content.html","id":"required-yaml-content","dir":"Articles","previous_headings":"1. YAML Header","what":"Required YAML content","title":"Survey Content","text":"surveydown survey, YAML must contain least following: server: shiny part ensures document render shiny app. filters: [surveydown] part applies surveydown Quarto extension project, required.","code":"--- server: shiny filters: [surveydown] ---"},{"path":"https://jhelvy.github.io/surveydown/articles/content.html","id":"setitng-the-theme","dir":"Articles","previous_headings":"1. YAML Header","what":"Setitng the theme","title":"Survey Content","text":"YAML can also used set several optional global settings, overall survey theme: 25 bootswatch themes choose . can also provide custom.scss file modify theme, even combine two, e.g.:","code":"--- theme: united # Any bootswatch theme --- --- theme: [united, custom.scss] ---"},{"path":"https://jhelvy.github.io/surveydown/articles/content.html","id":"progress-bar","dir":"Articles","previous_headings":"1. YAML Header","what":"Progress bar","title":"Survey Content","text":"can modify survey progress bar barcolor barposition keys, e.g.: barcolor key defines color progress bar. defaults theme, meaning take primary theme color. may also use hex code overwrite color wish, e.g.: #768692. barposition key defines position progress bar. defaults top, can also changed bottom none (remove bar). progress bar updates every question user clicks , pages.","code":"--- barcolor: theme barposition: top ---"},{"path":"https://jhelvy.github.io/surveydown/articles/content.html","id":"setup-code-chunk","dir":"Articles","previous_headings":"","what":"2. Setup code chunk","title":"Survey Content","text":"YAML header, ’ll need load surveydown package run sd_setup() function. placed inside code chunk looks like : Anything loaded setup chunk accessible survey body server, recommend also loading packages / data chunk well.","code":"```{r} #| context: setup #| warning: false #| message: false # Load the package library(surveydown) # Run initial setup function (essential - do not delete) sd_setup() ```"},{"path":"https://jhelvy.github.io/surveydown/articles/content.html","id":"survey-body","dir":"Articles","previous_headings":"","what":"3. Survey body","title":"Survey Content","text":"survey body content setup code chunk server code chunk. can use markdown (RStudio visual editor) insert text, images, etc. just like Quarto document. unique elements surveydown survey pages, navigation buttons, questions.","code":""},{"path":"https://jhelvy.github.io/surveydown/articles/content.html","id":"adding-pages","dir":"Articles","previous_headings":"3. Survey body","what":"Adding pages","title":"Survey Content","text":"surveydown, pages defined using fences (:::), like : can see, use three colon symbols :::, called “fence”, mark start end pages. notation commonly used Quarto variety use cases, like defining subfigures images. starting fence, need define page name (e.g. welcome page2 example ) need define class .sd-page. anything put page fences appear page.","code":"::: {#welcome .sd-page} Page 1 content here ::: ::: {#page2 .sd-page} Page 2 content here :::"},{"path":"https://jhelvy.github.io/surveydown/articles/content.html","id":"adding-navigation-buttons","dir":"Articles","previous_headings":"3. Survey body","what":"Adding navigation buttons","title":"Survey Content","text":"navigate next page, need insert sd_next() function call inside code chunk, like : code chunk create “Next” button goes page 2 looks like : example, next button inserted code chunk ::: fences welcome page order “Next” button goes page 2. can also send user pages just changing value assigned next_page argument. Finally, can also change label button changing label argument, like :","code":"```{r} sd_next(next_page = 'page2') ``` ```{r} sd_next(next_page = 'page2', label = 'Next page') ```"},{"path":"https://jhelvy.github.io/surveydown/articles/content.html","id":"adding-questions","dir":"Articles","previous_headings":"3. Survey body","what":"Adding questions","title":"Survey Content","text":"Every survey question created using sd_question() function inside code chunk. question type defined type argument. example, add multiple choice question, insert following code chunk: code chunk create multiple choice question looks like : favorite type penguin? * sd_question() function can used create variety question types, like text input, select drop choices, changing type argument (see vignette(\"questions\")). function many arguments customizing look feel question, height width (see vignette(\"formatting\")). Finally, sd_question() required argument can used make question required optional (e.g., required = TRUE). default FALSE, meaning question optional.","code":"```{r} 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://jhelvy.github.io/surveydown/articles/content.html","id":"server-code-chunk","dir":"Articles","previous_headings":"","what":"4. Server code chunk","title":"Survey Content","text":"bottom .qmd file special “server” code chunk (’s #| context: server bit) defines app server. can customize control survey flow logic well define database store survey response data. looks like : sd_server() function bottom makes everything run, can safely ignore - just don’t change good! sd_database() function set database. See vignette(\"database\") details. sd_config() function can define custom control logic survey, conditional display (conditionally displaying question based responses questions), conditional skip (conditionally sending respondent page based responses questions). See vignette(\"control\")","code":"```{r} #| context: server # Define the database settings db <- sd_database() # Define the configuration settings config <- sd_config() # The sd_server() function initiates your survey - don't change this sd_server( input = input, session = session, config = config, db = db ) ```"},{"path":[]},{"path":"https://jhelvy.github.io/surveydown/articles/control.html","id":"basic-skipping","dir":"Articles","previous_headings":"Page skipping","what":"Basic skipping","title":"Control Logic","text":"Use skip_if argument control basic skipping logic.","code":""},{"path":"https://jhelvy.github.io/surveydown/articles/control.html","id":"custom-skipping","dir":"Articles","previous_headings":"Page skipping","what":"Custom skipping","title":"Control Logic","text":"Use skip_if_custom argument control custom skipping logic.","code":""},{"path":[]},{"path":"https://jhelvy.github.io/surveydown/articles/control.html","id":"basic-conditional-display","dir":"Articles","previous_headings":"Conditional display","what":"Basic conditional display","title":"Control Logic","text":"Use show_if argument control basic conditional display logic.","code":""},{"path":"https://jhelvy.github.io/surveydown/articles/control.html","id":"custom-conditional-display","dir":"Articles","previous_headings":"Conditional display","what":"Custom conditional display","title":"Control Logic","text":"Use show_if_custom argument control custom conditional display logic.","code":""},{"path":"https://jhelvy.github.io/surveydown/articles/database.html","id":"step-1-creating-your-account-","dir":"Articles","previous_headings":"","what":"Step 1: Creating your account.","title":"Database Setup","text":"begin database setup involves creating account supabase website.","code":""},{"path":"https://jhelvy.github.io/surveydown/articles/database.html","id":"step-2-creating-your-account-","dir":"Articles","previous_headings":"","what":"Step 2: Creating your account.","title":"Database Setup","text":"Main page, select “Start Project” underlined red.","code":""},{"path":"https://jhelvy.github.io/surveydown/articles/database.html","id":"step-3-creating-your-database-","dir":"Articles","previous_headings":"","what":"Step 3: Creating your database.","title":"Database Setup","text":"creating new account proceed dashboard, select “New Project”","code":""},{"path":"https://jhelvy.github.io/surveydown/articles/database.html","id":"step-4-creating-your-database-","dir":"Articles","previous_headings":"","what":"Step 4: Creating your database.","title":"Database Setup","text":"next step create respective database, sure take note database password needed later .","code":""},{"path":"https://jhelvy.github.io/surveydown/articles/database.html","id":"step-5-finding-our-db-parameters-","dir":"Articles","previous_headings":"","what":"Step 5: Finding our DB parameters.","title":"Database Setup","text":"project dashboard select settings gear bottom left.","code":""},{"path":"https://jhelvy.github.io/surveydown/articles/database.html","id":"step-6-finding-our-db-parameters-","dir":"Articles","previous_headings":"","what":"Step 6: Finding our DB parameters.","title":"Database Setup","text":"Select “Database” configuration.","code":""},{"path":"https://jhelvy.github.io/surveydown/articles/database.html","id":"step-7-finding-our-db-parameters-","dir":"Articles","previous_headings":"","what":"Step 7: Finding our DB parameters.","title":"Database Setup","text":"Take note connection parameters, well database password Step 4.","code":""},{"path":"https://jhelvy.github.io/surveydown/articles/database.html","id":"step-8-taking-a-look-at-the-sd_database-function-","dir":"Articles","previous_headings":"","what":"Step 8: Taking a look at the sd_database() function.","title":"Database Setup","text":"Now ’ve created database gotten needed parameters can now connect database survey. Taking look code inside survey.qmd file may notice 6 parameters, 5 ’ve discovered earlier. last parameter “table_name”, parameter can name choosing. Note: parameters currently listed NULL must wrapped quotes replaced. may also notice db defined twice. putting parameters respective places make sure delete line: may also notice password parameter hidden inside R environment. security reasons recommended.","code":"# surveydown stores data on a database that you define at https://supabase.com/ # To connect to a database to store the survey data, update this with details # from your supabase account and database. See documentation for details. # For security, we recommend storing your supabase password in your R # environment instead of hard-coding it here, which you can open and edit with # usethis::edit_r_environ() db <- sd_database( host = NULL, db_name = NULL, port = NULL, user = NULL, table_name = NULL, password = Sys.getenv(\"SUPABASE_PASSWORD\") ) # If you don't have a database setup you can just leave the function blank. db <- sd_database() db <- sd_database()"},{"path":"https://jhelvy.github.io/surveydown/articles/database.html","id":"step-9-putting-the-dasebase-password-inside-of-the-r-env-","dir":"Articles","previous_headings":"","what":"Step 9: Putting the dasebase Password inside of the R env.","title":"Database Setup","text":"step shows put database password inside R environment.","code":""},{"path":"https://jhelvy.github.io/surveydown/articles/database.html","id":"first-open-the-r-environment-","dir":"Articles","previous_headings":"Step 9: Putting the dasebase Password inside of the R env.","what":"First: Open the R environment.","title":"Database Setup","text":"open new R tab called “.Renviron”","code":"usethis::edit_r_environ()"},{"path":"https://jhelvy.github.io/surveydown/articles/database.html","id":"second-edit-r-environment-","dir":"Articles","previous_headings":"Step 9: Putting the dasebase Password inside of the R env.","what":"Second: Edit R environment.","title":"Database Setup","text":"Add database password. Note: need wrapped quotes SUPABASE_PASSWORD=######","code":""},{"path":"https://jhelvy.github.io/surveydown/articles/database.html","id":"third-restart-your-r-session","dir":"Articles","previous_headings":"Step 9: Putting the dasebase Password inside of the R env.","what":"Third: Restart your R session","title":"Database Setup","text":"can done going “Session” -> “Restart R” shortcut “Cmd + Shift + 0” Mac.","code":""},{"path":"https://jhelvy.github.io/surveydown/articles/database.html","id":"step-10-bringing-it-all-together-","dir":"Articles","previous_headings":"","what":"Step 10: Bringing it all together.","title":"Database Setup","text":"Now password secure parameters can update sd_database() function Step 8 look like :","code":"db <- sd_database( host = \"aws-0-us-west-1.pooler.supabase.com\", #This varies based on location, #check Step 7. db_name = \"postgres\", # For the purpose of supabase, this will always be \"postgres\". port = \"####\", # Your 4 digit port number from Step 7. user = \"postgres.UserValue\", # This is the User parameter from Step 7. table_name = \"What Ever Name You Want\", # This is what your table name will be. password = Sys.getenv(\"SUPABASE_PASSWORD\") #Database password - Steps 4 and 9. )"},{"path":"https://jhelvy.github.io/surveydown/articles/database.html","id":"tada","dir":"Articles","previous_headings":"","what":"Tada!!!","title":"Database Setup","text":"Going back Project dashboard selecting “Table Editor” left hand bar tab see table appear survey run interacted atleast .","code":""},{"path":"https://jhelvy.github.io/surveydown/articles/deploy.html","id":"demo-survey","dir":"Articles","previous_headings":"","what":"Demo Survey","title":"Deploying Your Survey","text":"trouble constructing survey, prepared demo survey: Online demo survey GitHub repository survey made RStudio using {surveydown} R package surveydown Quarto extension, survey data stored supabase, online website deployed shinyapps.","code":""},{"path":[]},{"path":"https://jhelvy.github.io/surveydown/articles/deploy.html","id":"step-1-1-construct-your-survey","dir":"Articles","previous_headings":"Step 1: Survey Project","what":"Step 1-1: Construct your survey","title":"Deploying Your Survey","text":"Construct survey using {surveydown} R package surveydown Quarto extension. previous articles Usage Guide sufficient guide survey construction process.","code":""},{"path":"https://jhelvy.github.io/surveydown/articles/deploy.html","id":"step-1-2-set-your-password","dir":"Articles","previous_headings":"Step 1: Survey Project","what":"Step 1-2: Set your password","title":"Deploying Your Survey","text":"One important setting password supabase project. ’s . set supabase project, create password . password defined survey project. end survey .qmd file, ’ll need define db variable, settings supabase project. argument called password. can directly paste password password = \"my_password\", ’s recommended since make supabase project unsafe. recommend write password = Sys.getenv(\"SUPABASE_PASSWORD\"), like : , define password using sd_set_password() function. example, password my_password, run sd_set_password(\"my_password\") R Console. Great! Now supabase password successfully defined survey project! interested, details sd_set_password() : creates .Renviron file writes existing one. .Renviron file, writes SUPABASE_PASSWORD=my_password, \"my_password\" whatever argument sd_set_password() function. previously defined SUPABASE_PASSWORD .Renviron, overwritten, safe run function multiple times. adds .Renviron .gitignore avoid pushed GitHub thus keeps password safe. run multiple times, .Renviron appear .gitignore.","code":"db <- sd_database( # Other settings... password = Sys.getenv(\"SUPABASE_PASSWORD\") )"},{"path":"https://jhelvy.github.io/surveydown/articles/deploy.html","id":"step-1-3-render-your--qmd-file","dir":"Articles","previous_headings":"Step 1: Survey Project","what":"Step 1-3: Render your .qmd file","title":"Deploying Your Survey","text":"simple: just hit Render cmd/ctrl + shift + K (Mac/Win). reason make stand-alone step , WITHOUT rendering .qmd file, survey deployed online. One thing… fail deploy locally set every argument correctly db variable, try define gssencmode = \"disable\" db variable: can help solve connection problem. value gssencmode set \"prefer\" default.","code":"db <- sd_database( # Other settings... gssencmode = \"disable\" )"},{"path":"https://jhelvy.github.io/surveydown/articles/deploy.html","id":"step-2-supabase-project","dir":"Articles","previous_headings":"","what":"Step 2: Supabase Project","title":"Deploying Your Survey","text":"covered 5. Database Setup. want mention don’t need actively create table supabase project. db variable .qmd file, table_name argument. Whatever name define become table name supabase: example, table name supabase project \"demo\". survey project runs successfully locally can survey data collected supabase, ready online deployment.","code":"db <- sd_database( # Other settings... table_name = \"demo\" )"},{"path":"https://jhelvy.github.io/surveydown/articles/deploy.html","id":"step-3-online-deployment","dir":"Articles","previous_headings":"","what":"Step 3: Online Deployment","title":"Deploying Your Survey","text":"final step: deploy survey online. ’m glad ’ve made far! almost ! ’ll use shinyapps.io. Now start, two explanations clear possible questions: shinyapps.io can support Shiny Apps Quarto Shiny Documents. case, survey considered Quarto Shiny Document. Quarto Pub also website publishing platform. fact, Quarto Pub shinyapps.io provided Posit. However, DON’T use Quarto Pub survey deployment. core reason , shinyapps.io can make interactive websites, Quarto Pub makes static websites. survey apparently interactive website, ’s compatible shinyapps.io, Quarto Pub. start using shinyapps.io, ’ll need create account follow basic instructions set sub-domain authorize IDE. See information . account sub-domain ready, ’s time deploy survey website. Make sure rsconnect R package installed (done authorize IDE): simplest way run : URL page domain followed /your_survey, means name .qmd file URL. tab name HTML page also your_survey. Better give good name .qmd file. , ’ll need firstly render locally make sure works properly. Otherwise, deployment fail. want define different tab name survey page, run: Now survey site deployed. survey now served shinyapps.io, data stored supabase. Congratulations! explanation (personal interpretation) deployment functions: rsconnect, two functions can used deployment: deployApp() deployDoc(). serve different purposes mix-used. deployApp() used deploy Shiny App. doesn’t work .qmd, works Shiny App .rmd, accepts multiple files. deployDoc() used deploy Quarto Shiny Document. works single file tries “automatically discover dependencies” (direct paste official instructions). Since survey Quarto Shiny Document, use deployDoc(). guess deployDoc() newer function specifically works .qmd. feeling function specifically made .qmd match fact “single document” “dependencies”. case, deployDoc() perfect match.","code":"install.packages('rsconnect') rsconnect::deployDoc(\"your_survey.qmd\") rsconnect::deployDoc( doc = \"your_survey.qmd\", appName = \"Survey Name\" )"},{"path":"https://jhelvy.github.io/surveydown/articles/formatting.html","id":"markdown","dir":"Articles","previous_headings":"","what":"Markdown","title":"Formatting Your Survey","text":"Markdown supported question label. label argument question type can accept markdown formatting. example, question uses ** symbols make works bold. Scripts: Output: Markdown also supported options mc_buttons questions. mc_button type questions, can also use markdown format option labels. Scripts: Output: true mc_multiple_buttons. Scripts: Output:","code":"sd_question( type = 'mc', id = 'markdown_label', label = \"**This** is a question *label* supporting ***markdown***:\", option = c( \"Option A\" = \"option_a\", \"Option B\" = \"option_b\", \"Option C\" = \"option_c\" ) ) sd_question( type = 'mc_buttons', id = 'markdown_buttons', label = \"The 3 options below support markdown:\", option = c( \"*Option A*\" = \"option_a\", \"**Option B**\" = \"option_b\", \"***Option C***\" = \"option_c\" ) ) sd_question( type = 'mc_multiple_buttons', id = 'markdown_multiple_buttons', label = \"The 3 options below support markdown:\", option = c( \"*Option A*\" = \"option_a\", \"**Option B**\" = \"option_b\", \"***Option C***\" = \"option_c\" ) )"},{"path":"https://jhelvy.github.io/surveydown/articles/formatting.html","id":"html","dir":"Articles","previous_headings":"","what":"HTML","title":"Formatting Your Survey","text":"HTML supported options mc_buttons mc_multiple_buttons, can insert mixed content including plain text, markdown, HTML images. example, question complex labels choice question. Scripts: Output:","code":"# Define the option vector html_buttons_option <- c(\"option_1\", \"option_2\", \"option_3\") # Change the names of each element to display markdown-formatted text # and an embedded image using html names(html_buttons_option)[1] <- \"**Option 1**

**Type**: Fuji
**Price**: $ 2 / lb
**Freshness**: Average\" names(html_buttons_option)[2] <- \"**Option 2**

**Type**: Pink Lady
**Price**: $ 1.5 / lb
**Freshness**: Excellent\" names(html_buttons_option)[3] <- \"**Option 3**

**Type**: Honeycrisp
**Price**: $ 2 / lb
**Freshness**: Poor\" sd_question( type = 'mc_buttons', id = 'html_buttons', label = \"A sample survey question using `mc_buttons`\", option = html_buttons_option )"},{"path":"https://jhelvy.github.io/surveydown/articles/formatting.html","id":"width","dir":"Articles","previous_headings":"","what":"Width","title":"Formatting Your Survey","text":"Use width argument change width question. Scripts: Output:","code":"sd_question( type = \"textarea\", id = \"change_width\", label = \"This text area has width set as 40%:\", width = \"40%\" )"},{"path":"https://jhelvy.github.io/surveydown/articles/install.html","id":"install-r-quarto","dir":"Articles","previous_headings":"","what":"Install R & Quarto","title":"Installation","text":"need : Install R Install Quarto Also, recommend working IDE. RStudio great, also like VS Code Positron.","code":""},{"path":"https://jhelvy.github.io/surveydown/articles/install.html","id":"install-the-surveydown-r-package","dir":"Articles","previous_headings":"","what":"Install the {surveydown} R package","title":"Installation","text":"{surveydown} yet CRAN, can install development version GitHub following command R:","code":"# install.packages(\"remotes\") remotes::install_github(\"jhelvy/surveydown\")"},{"path":"https://jhelvy.github.io/surveydown/articles/install.html","id":"install-the-surveydown-quarto-extension","dir":"Articles","previous_headings":"","what":"Install the surveydown Quarto Extension","title":"Installation","text":"start working actual survey, ’ll need surveydown Quarto extension. recommend starting template survey, automatically add latest extension : Otherwise, can install extension using terminal {surveydown} package: Using Terminal: Using {surveydown} R package:","code":"surveydown::sd_create_survey(\"path/to/folder\") quarto install extension jhelvy/surveydown-ext surveydown::sd_update_extension()"},{"path":"https://jhelvy.github.io/surveydown/articles/install.html","id":"version-control","dir":"Articles","previous_headings":"","what":"Version Control","title":"Installation","text":"check latest R package Quarto extension versions installed, run: update R package Quarto extension latest version:","code":"surveydown::sd_check_versions() surveydown::sd_update_surveydown()"},{"path":"https://jhelvy.github.io/surveydown/articles/questions.html","id":"introduction-of-arguments","dir":"Articles","previous_headings":"","what":"Introduction of Arguments","title":"Question Types","text":"article showcases different types question supported surveydown. question requires user define following arguments sd_question() function: id: unique identifier question, used variable name resulting survey data. label: label displayed question survey. text: Single line open text input. textarea: Multiple line open text input. numeric: Single line numeric text input. mc: Multiple choice single select option (radio buttons). mc_buttons: mc “button” style instead radio buttons. mc_multiple: Multiple choice mutliple select options (check boxes). mc_multiple_buttons: mc_multiple “button” style instead check boxes. select: Select choice drop menu. slider: (construction) Slider select discrete categories continuous numbers. date: Select date calendar widget. daterange: Select two dates calendar widgets (e.g. begin end dates).","code":""},{"path":[]},{"path":"https://jhelvy.github.io/surveydown/articles/questions.html","id":"text","dir":"Articles","previous_headings":"Question Types","what":"1. text","title":"Question Types","text":"Use type = 'text' specify text input type question. Scripts: Output:","code":"sd_question( type = \"text\", id = \"silly_word\", label = \"Write a silly word:\" )"},{"path":"https://jhelvy.github.io/surveydown/articles/questions.html","id":"textarea","dir":"Articles","previous_headings":"Question Types","what":"2. textarea","title":"Question Types","text":"Use type = 'textarea' specify text area input type question. Scripts: Output:","code":"sd_question( type = \"textarea\", id = \"silly_paragraph\", label = \"Write a silly paragraph:\" )"},{"path":"https://jhelvy.github.io/surveydown/articles/questions.html","id":"numeric","dir":"Articles","previous_headings":"Question Types","what":"3. numeric","title":"Question Types","text":"Use type = 'numeric' specify numeric input type. Scripts: Output:","code":"sd_question( type = 'numeric', id = 'age', label = \"What's your age?\" )"},{"path":"https://jhelvy.github.io/surveydown/articles/questions.html","id":"mc","dir":"Articles","previous_headings":"Question Types","what":"4. mc","title":"Question Types","text":"Use type = 'mc' specify multiple choice type question single choice option. Scripts: Output:","code":"sd_question( type = 'mc', id = 'artist', label = \"Which artist do you prefer most from this list?\", option = c( \"Taylor Swift\" = \"taylor_swift\", \"Beyoncé\" = \"beyonce\", \"Adele\" = \"adele\", \"Rihanna\" = \"rihanna\", \"Lady Gaga\" = \"ladygaga\", \"Ed Sheeran\" = \"ed_sheeran\", \"Drake\" = \"drake\" ) )"},{"path":"https://jhelvy.github.io/surveydown/articles/questions.html","id":"mc_buttons","dir":"Articles","previous_headings":"Question Types","what":"5. mc_buttons","title":"Question Types","text":"Use type = 'mc_buttons' generate button version mc. Scripts: Output:","code":"sd_question( type = 'mc_buttons', id = 'fruit', label = \"Which fruit do you prefer most from this list?\", option = c( \"Apple\" = \"apple\", \"Banana\" = \"banana\", \"Pear\" = \"pear\", \"Strawberry\" = \"strawberry\", \"Grape\" = \"grape\", \"Mango\" = \"mango\", \"Watermelon\" = \"watermelon\" ) )"},{"path":"https://jhelvy.github.io/surveydown/articles/questions.html","id":"mc_multiple","dir":"Articles","previous_headings":"Question Types","what":"6. mc_multiple","title":"Question Types","text":"Use type = 'mc_multiple' specify multiple choice type question multiple selection enabled. Scripts: Output:","code":"sd_question( type = 'mc_multiple', id = 'swift', label = \"What are your favorite Taylor Swift albums (select all that apply)?\", option = c( \"Taylor Swift (2006)\" = \"taylor_swift\", \"Fearless (2008)\" = \"fearless\", \"Speak Now (2010)\" = \"speak_now\", \"Red (2012)\" = \"red\", \"1989 (2014)\" = \"1989\", \"Reputation (2017)\" = \"reputation\", \"Lover (2019)\" = \"lover\", \"Folklore (2020)\" = \"folklore\", \"Evermore (2020)\" = \"evermore\", \"Midnights (2022)\" = \"midnights\" ) )"},{"path":"https://jhelvy.github.io/surveydown/articles/questions.html","id":"mc_multiple_buttons","dir":"Articles","previous_headings":"Question Types","what":"7. mc_multiple_buttons","title":"Question Types","text":"Use type = 'mc_multiple_buttons' generate button version mc_multiple. Scripts: Output:","code":"sd_question( type = 'mc_multiple_buttons', id = 'michael_jackson', label = \"Which are your favorite Michael Jackson songs (select all that apply)?\", option = c( \"Thriller (1982)\" = \"thriller\", \"Billie Jean (1982)\" = \"billie_jean\", \"Beat It (1982)\" = \"beat_it\", \"Man in the Mirror (1987)\" = \"man_in_the_mirror\", \"Smooth Criminal (1987)\" = \"smooth_criminal\", \"Black or White (1991)\" = \"black_or_white\", \"Bad (1987)\" = \"bad\", \"Human Nature (1982)\" = \"human_nature\" ) )"},{"path":"https://jhelvy.github.io/surveydown/articles/questions.html","id":"select","dir":"Articles","previous_headings":"Question Types","what":"8. select","title":"Question Types","text":"Use type = 'select' specify drop select type question. Scripts: Output:","code":"sd_question( type = 'select', id = 'education', label = \"What is the highest level of education you have attained?\", option = c( \"Did not attend high school\" = \"hs_no\", \"Some high school\" = \"hs_some\", \"High school graduate\" = \"hs_grad\", \"Some college\" = \"college_some\", \"College\" = \"college_grad\", \"Graduate Work\" = \"grad\", \"Prefer not to say\" = \"no_response\" ) )"},{"path":"https://jhelvy.github.io/surveydown/articles/questions.html","id":"slider-under-construction","dir":"Articles","previous_headings":"Question Types","what":"9. slider (Under Construction)","title":"Question Types","text":"Due compatibility issues, slider type still construction. Now slider axis show numeric values ranging 10 100. solve problem future releases. Use type = 'slider' specify slider input type. Scripts: Output: type = 'slider' can also used select range. Scripts: Output:","code":"sd_question( type = 'slider', id = 'climate_care', label = \"To what extent do you believe human-caused climate change is real?\", option = c( \"Don't Believe\" = \"dont_believe\", \"Somewhat Believe\" = \"somewhat\", \"Neutral\" = \"neutral\", \"Believe\" = \"believe\", \"Strongly Believe\" = \"strongly_believe\" ) ) sd_question( type = 'slider', id = 'coldest_months', label = \"What months do you think are the coldest throughout a year?\", option = month.abb, selected = month.abb[c(4, 8)] )"},{"path":"https://jhelvy.github.io/surveydown/articles/questions.html","id":"date","dir":"Articles","previous_headings":"Question Types","what":"10. date","title":"Question Types","text":"Use type = 'date' specify date input type. Scripts: Output: date value today’s date default. Upon clicking text box, provided date dialog box choose date .","code":"sd_question( type = 'date', id = 'dob', label = \"What is your date of birth?\" )"},{"path":"https://jhelvy.github.io/surveydown/articles/questions.html","id":"daterange","dir":"Articles","previous_headings":"Question Types","what":"11. daterange","title":"Question Types","text":"Use type = 'daterange' specify date range input type. Scripts: Output:","code":"sd_question( type = 'daterange', id = 'hs_date', label = \"When did you start and finish high school?\" )"},{"path":"https://jhelvy.github.io/surveydown/articles/surveydown.html","id":"install-surveydown","dir":"Articles","previous_headings":"","what":"1. Install surveydown","title":"Introduction to surveydown","text":"See vignette(\"install\")","code":""},{"path":"https://jhelvy.github.io/surveydown/articles/surveydown.html","id":"start-with-a-template","dir":"Articles","previous_headings":"","what":"2. Start with a template","title":"Introduction to surveydown","text":"R console, run following setup template survey: create folder located \"path//folder\" following files: example.qmd: template survey edit. example.Rproj: RStudio project file (helpful ’re working RStudio) _extensions: folder surveydown Quarto extension needed make everything work (don’t modify ).","code":"surveydown::sd_create_survey(\"path/to/folder\")"},{"path":"https://jhelvy.github.io/surveydown/articles/surveydown.html","id":"add-content","dir":"Articles","previous_headings":"","what":"3. Add content","title":"Introduction to surveydown","text":"See vignette(\"content\") details adding content survey, like text, images, etc. markdown / code chunks. quick overview: Add pages using fences, like : Add questions sd_question() function code chunks (see vignette(\"questions\") supported question types). example:","code":"::: {#page1 .sd-page} Page 1 content here ::: ```{r} 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://jhelvy.github.io/surveydown/articles/surveydown.html","id":"add-control-logic","dir":"Articles","previous_headings":"","what":"4. Add control logic","title":"Introduction to surveydown","text":"server chunk (bottom qmd file), add control logic survey sd_config() function. See vignette(\"control\")","code":""},{"path":"https://jhelvy.github.io/surveydown/articles/surveydown.html","id":"setup-your-database","dir":"Articles","previous_headings":"","what":"5. Setup your database","title":"Introduction to surveydown","text":"Also server chunk, setup database sd_database() function, leave blank preview / edit survey without database connected. See vignette(\"database\")","code":""},{"path":"https://jhelvy.github.io/surveydown/articles/surveydown.html","id":"locally-preview","dir":"Articles","previous_headings":"","what":"6. Locally preview","title":"Introduction to surveydown","text":"Preview survey clicking “Run Document” button RStudio terminal running command quarto serve survey_file_name.qmd.","code":""},{"path":"https://jhelvy.github.io/surveydown/articles/surveydown.html","id":"deploy","dir":"Articles","previous_headings":"","what":"7. Deploy","title":"Introduction to surveydown","text":"Deploy survey hosting favorite server, like shinyapps.io, huggingface, etc. See vignette(\"deploy\")","code":""},{"path":"https://jhelvy.github.io/surveydown/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.","code":""},{"path":"https://jhelvy.github.io/surveydown/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 Documents. R package, https://jhelvy.github.io/surveydown/.","code":"@Manual{, title = {{surveydown}: Markdown-Based Surveys Using Quarto Shiny Documents}, author = {John Paul Helveston and Pingfan Hu and Bogdan Bunea}, year = {2024}, note = {R package}, url = {https://jhelvy.github.io/surveydown/}, }"},{"path":[]},{"path":"https://jhelvy.github.io/surveydown/index.html","id":"markdown-based-surveys-with-quarto-shiny-documents","dir":"","previous_headings":"","what":"Markdown-Based Surveys With Quarto Shiny Documents.","title":"Build markdown-based surveys with quarto shiny documents","text":"Note: still early-stage project. don’t yet recommend using collecting data, love feedback try ! project brings together three open source technologies (Quarto, shiny, supabase) create dynamic, markdown-based surveys. ’s basic concept: Design survey Quarto shiny document using markdown R code. Render doc shiny app can hosted online sent respondents. Store survey responses supabase database. {surveydown} R package works tandem surveydown Quarto extension make everything work. See documentation get started making surveydown survey!","code":""},{"path":"https://jhelvy.github.io/surveydown/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. open-source, markdown-based platform, surveydown designed address problems. surveydown, survey content created plain text (markdown R code) single .qmd file renders shiny app. makes survey easy reproduce, share, version control common tools like Git. resulting shiny app survey can hosted number platforms, like shinyapps.io huggingface, survey data collected owned survey designer supabase account. Best , everything open source free :) ’re curious whole idea came , check blog post, outlines general idea motivation . post now outdated terms overall design, provides something origin story motivation developing project.","code":""},{"path":"https://jhelvy.github.io/surveydown/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 adding 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 preview = TRUE (database ignored) Export timestamps page data Export timestamps question interaction (since increase data size considerably, maybe add question_times = FALSE argument) Option start designated page, e.g. start_page = 'page_name' show_all = TRUE argument show pages hidden questions launched (e.g. able print entire survey text). also called print_mode = TRUE. Set SCSS compatible Quarto-supported bootstrap themes Add optional progress bar Include input checks skip_if show_if (question_id exists, data frame names correct) Required questions (required = TRUE): post popup question required allowing next button. Default required = FALSE. Form validation: Make sure user inputs correct type depending question type. (see https://shiny.posit.co/r/reference/shiny/0.14/validate.html) Admin page w/password preview / download data (see https://github.com/daattali/shinyforms) User tracking via url parameters: https://shinysurveys.jdtrat.com/articles/surveying-shinysurveys.html#user-tracking Deal cookies users close browser can start back left . Add sd_get_data() function survey designer can obtain current survey results inside app: https://shinysurveys.jdtrat.com/articles/get-survey-data.html Multiple choice (single choice) Multiple choice (multiple choices) Select Text Numeric Multiple choice (button…like formr mc_button) Text area Date Matrix [?] Slider Resources / examples: shinysurveys shinyforms Example adding JS modules shiny app (pop message) - useful adding number JS-based features, like pop ups required questions, JS-based progress bar, etc.","code":""},{"path":"https://jhelvy.github.io/surveydown/index.html","id":"documentation-todo","dir":"","previous_headings":"","what":"Documentation TODO","title":"Build markdown-based surveys with quarto shiny documents","text":"Vignettes following: Quick overview / basic usage List question types examples Question formatting options Flow control (conditional skipping conditional display) Setting database supabase","code":""},{"path":[]},{"path":"https://jhelvy.github.io/surveydown/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://jhelvy.github.io/surveydown/reference/check_all_required.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if all required questions are answered — check_all_required","title":"Check if all required questions are answered — check_all_required","text":"Check required questions answered","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/check_all_required.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if all required questions are answered — check_all_required","text":"","code":"check_all_required(questions, questions_required, input, show_if)"},{"path":"https://jhelvy.github.io/surveydown/reference/check_all_required.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if all required questions are answered — check_all_required","text":"questions Vector question identifiers questions_required Vector required question identifiers input Shiny input object show_if Data frame show-conditions","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/check_all_required.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if all required questions are answered — check_all_required","text":"Logical indicating required questions answered","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/check_answer.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if a single question is answered — check_answer","title":"Check if a single question is answered — check_answer","text":"Check single question answered","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/check_answer.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if a single question is answered — check_answer","text":"","code":"check_answer(q, input)"},{"path":"https://jhelvy.github.io/surveydown/reference/check_answer.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if a single question is answered — check_answer","text":"q Question identifier input Shiny input object","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/check_answer.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if a single question is answered — check_answer","text":"Logical indicating question answered","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/check_skip_show.html","id":null,"dir":"Reference","previous_headings":"","what":"Check skip and show conditions — check_skip_show","title":"Check skip and show conditions — check_skip_show","text":"function validates skip_if show_if conditions provided configuration.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/check_skip_show.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check skip and show conditions — check_skip_show","text":"","code":"check_skip_show(config, skip_if, skip_if_custom, show_if, show_if_custom)"},{"path":"https://jhelvy.github.io/surveydown/reference/check_skip_show.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check skip and show conditions — check_skip_show","text":"config survey configuration list skip_if Data frame skip conditions skip_if_custom Custom skip function show_if Data frame show conditions show_if_custom Custom show function","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/check_skip_show.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check skip and show conditions — check_skip_show","text":"TRUE checks pass, otherwise stops error message","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/create_table.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a new table in the database — create_table","title":"Create a new table in the database — create_table","text":"Create new table database","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/create_table.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a new table in the database — create_table","text":"","code":"create_table(db, table_name, df)"},{"path":"https://jhelvy.github.io/surveydown/reference/create_table.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a new table in the database — create_table","text":"db Database connection object table_name String name table create df Data frame used determine table structure","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/create_table.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a new table in the database — create_table","text":"None (called side effects)","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/database_uploading.html","id":null,"dir":"Reference","previous_headings":"","what":"Upload data to the database — database_uploading","title":"Upload data to the database — database_uploading","text":"function handles process uploading survey data database, including creating table exist updating existing rows.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/database_uploading.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Upload data to the database — database_uploading","text":"","code":"database_uploading(df, db, table_name)"},{"path":"https://jhelvy.github.io/surveydown/reference/database_uploading.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Upload data to the database — database_uploading","text":"df Data frame survey data upload db Database connection object table_name String name table upload ","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/database_uploading.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Upload data to the database — database_uploading","text":"None (called side effects)","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/download_extension.html","id":null,"dir":"Reference","previous_headings":"","what":"Download and Extract Survey Extension — download_extension","title":"Download and Extract Survey Extension — download_extension","text":"helper function downloads surveydown extension GitHub extracts .","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/download_extension.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Download and Extract Survey Extension — download_extension","text":"","code":"download_extension(temp_dir)"},{"path":"https://jhelvy.github.io/surveydown/reference/download_extension.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Download and Extract Survey Extension — download_extension","text":"temp_dir temporary directory store downloaded files.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/download_extension.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Download and Extract Survey Extension — download_extension","text":"character string path unzipped directory.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/get_extension_version.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Surveydown Extension Version — get_extension_version","title":"Get Surveydown Extension Version — get_extension_version","text":"function reads version surveydown Quarto extension _extension.yml file.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/get_extension_version.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Surveydown Extension Version — get_extension_version","text":"","code":"get_extension_version(path = getwd())"},{"path":"https://jhelvy.github.io/surveydown/reference/get_extension_version.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Surveydown Extension Version — get_extension_version","text":"path character string specifying directory search extension. Defaults current working directory.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/get_extension_version.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Surveydown Extension Version — get_extension_version","text":"character string representing extension version, NULL extension found.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/get_latest_version_from_url.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Latest Version from URL — get_latest_version_from_url","title":"Get Latest Version from URL — get_latest_version_from_url","text":"function fetches latest version file given URL.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/get_latest_version_from_url.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Latest Version from URL — get_latest_version_from_url","text":"","code":"get_latest_version_from_url(url, pattern)"},{"path":"https://jhelvy.github.io/surveydown/reference/get_latest_version_from_url.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get Latest Version from URL — get_latest_version_from_url","text":"url URL file containing version information pattern pattern search file (e.g., \"Version: \" \"version: \")","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/get_latest_version_from_url.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Latest Version from URL — get_latest_version_from_url","text":"package_version object representing latest version, NULL unable fetch","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/get_page_nodes.html","id":null,"dir":"Reference","previous_headings":"","what":"Get page nodes from HTML — get_page_nodes","title":"Get page nodes from HTML — get_page_nodes","text":"Get page nodes HTML","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/get_page_nodes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get page nodes from HTML — get_page_nodes","text":"","code":"get_page_nodes()"},{"path":"https://jhelvy.github.io/surveydown/reference/get_page_nodes.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get page nodes from HTML — get_page_nodes","text":"list page nodes HTML document","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/get_page_structure.html","id":null,"dir":"Reference","previous_headings":"","what":"Get page structure from HTML — get_page_structure","title":"Get page structure from HTML — get_page_structure","text":"Get page structure HTML","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/get_page_structure.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get page structure from HTML — get_page_structure","text":"","code":"get_page_structure()"},{"path":"https://jhelvy.github.io/surveydown/reference/get_page_structure.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get page structure from HTML — get_page_structure","text":"list element represents page contains question IDs page","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/get_question_nodes.html","id":null,"dir":"Reference","previous_headings":"","what":"Get question nodes from HTML — get_question_nodes","title":"Get question nodes from HTML — get_question_nodes","text":"Get question nodes HTML","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/get_question_nodes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get question nodes from HTML — get_question_nodes","text":"","code":"get_question_nodes()"},{"path":"https://jhelvy.github.io/surveydown/reference/get_question_nodes.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get question nodes from HTML — get_question_nodes","text":"list question nodes HTML document","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/get_question_structure.html","id":null,"dir":"Reference","previous_headings":"","what":"Get question structure from HTML — get_question_structure","title":"Get question structure from HTML — get_question_structure","text":"Get question structure HTML","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/get_question_structure.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get question structure from HTML — get_question_structure","text":"","code":"get_question_structure()"},{"path":"https://jhelvy.github.io/surveydown/reference/get_question_structure.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get question structure from HTML — get_question_structure","text":"list element represents question contains options","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/get_utc_timestamp.html","id":null,"dir":"Reference","previous_headings":"","what":"Get Current UTC Timestamp — get_utc_timestamp","title":"Get Current UTC Timestamp — get_utc_timestamp","text":"function returns current timestamp UTC format.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/get_utc_timestamp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get Current UTC Timestamp — get_utc_timestamp","text":"","code":"get_utc_timestamp()"},{"path":"https://jhelvy.github.io/surveydown/reference/get_utc_timestamp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get Current UTC Timestamp — get_utc_timestamp","text":"character string representing current UTC timestamp.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/handle_basic_show_if_logic.html","id":null,"dir":"Reference","previous_headings":"","what":"Handle basic show-if logic — handle_basic_show_if_logic","title":"Handle basic show-if logic — handle_basic_show_if_logic","text":"Handle basic show-logic","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/handle_basic_show_if_logic.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Handle basic show-if logic — handle_basic_show_if_logic","text":"","code":"handle_basic_show_if_logic(input, show_if)"},{"path":"https://jhelvy.github.io/surveydown/reference/handle_basic_show_if_logic.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Handle basic show-if logic — handle_basic_show_if_logic","text":"input Shiny input object show_if Data frame show-conditions","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/handle_basic_skip_logic.html","id":null,"dir":"Reference","previous_headings":"","what":"Handle basic skip logic — handle_basic_skip_logic","title":"Handle basic skip logic — handle_basic_skip_logic","text":"Handle basic skip logic","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/handle_basic_skip_logic.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Handle basic skip logic — handle_basic_skip_logic","text":"","code":"handle_basic_skip_logic(input, skip_if, current_page, next_page)"},{"path":"https://jhelvy.github.io/surveydown/reference/handle_basic_skip_logic.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Handle basic skip logic — handle_basic_skip_logic","text":"input Shiny input object skip_if Data frame skip-conditions current_page Current page identifier next_page Next page identifier","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/handle_basic_skip_logic.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Handle basic skip logic — handle_basic_skip_logic","text":"Updated next page identifier","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/handle_custom_show_if_logic.html","id":null,"dir":"Reference","previous_headings":"","what":"Handle custom show-if logic — handle_custom_show_if_logic","title":"Handle custom show-if logic — handle_custom_show_if_logic","text":"Handle custom show-logic","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/handle_custom_show_if_logic.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Handle custom show-if logic — handle_custom_show_if_logic","text":"","code":"handle_custom_show_if_logic(input, show_if_custom)"},{"path":"https://jhelvy.github.io/surveydown/reference/handle_custom_show_if_logic.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Handle custom show-if logic — handle_custom_show_if_logic","text":"input Shiny input object show_if_custom List custom show-conditions","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/handle_custom_skip_logic.html","id":null,"dir":"Reference","previous_headings":"","what":"Handle custom skip logic — handle_custom_skip_logic","title":"Handle custom skip logic — handle_custom_skip_logic","text":"Handle custom skip logic","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/handle_custom_skip_logic.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Handle custom skip logic — handle_custom_skip_logic","text":"","code":"handle_custom_skip_logic(input, skip_if_custom, current_page, next_page)"},{"path":"https://jhelvy.github.io/surveydown/reference/handle_custom_skip_logic.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Handle custom skip logic — handle_custom_skip_logic","text":"input Shiny input object skip_if_custom List custom skip-conditions current_page Current page identifier next_page Next page identifier","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/handle_custom_skip_logic.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Handle custom skip logic — handle_custom_skip_logic","text":"Updated next page identifier","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/handle_skip_logic.html","id":null,"dir":"Reference","previous_headings":"","what":"Handle overall skip logic — handle_skip_logic","title":"Handle overall skip logic — handle_skip_logic","text":"Handle overall skip logic","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/handle_skip_logic.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Handle overall skip logic — handle_skip_logic","text":"","code":"handle_skip_logic(input, skip_if, skip_if_custom, current_page, next_page)"},{"path":"https://jhelvy.github.io/surveydown/reference/handle_skip_logic.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Handle overall skip logic — handle_skip_logic","text":"input Shiny input object skip_if Data frame basic skip-conditions skip_if_custom List custom skip-conditions current_page Current page identifier next_page Next page identifier","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/handle_skip_logic.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Handle overall skip logic — handle_skip_logic","text":"Updated next page identifier","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/initialize_timestamps.html","id":null,"dir":"Reference","previous_headings":"","what":"Initialize Timestamps for Pages and Questions — initialize_timestamps","title":"Initialize Timestamps for Pages and Questions — initialize_timestamps","text":"function initializes timestamps pages questions survey.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/initialize_timestamps.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Initialize Timestamps for Pages and Questions — initialize_timestamps","text":"","code":"initialize_timestamps(page_ids, question_ids)"},{"path":"https://jhelvy.github.io/surveydown/reference/initialize_timestamps.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Initialize Timestamps for Pages and Questions — initialize_timestamps","text":"page_ids vector page IDs. question_ids vector question IDs.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/initialize_timestamps.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Initialize Timestamps for Pages and Questions — initialize_timestamps","text":"list initialized timestamps pages questions.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/is_question_visible.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if a question is visible — is_question_visible","title":"Check if a question is visible — is_question_visible","text":"Check question visible","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/is_question_visible.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if a question is visible — is_question_visible","text":"","code":"is_question_visible(q, show_if, input)"},{"path":"https://jhelvy.github.io/surveydown/reference/is_question_visible.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if a question is visible — is_question_visible","text":"q Question identifier show_if Data frame show-conditions input Shiny input object","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/is_question_visible.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if a question is visible — is_question_visible","text":"Logical indicating question visible","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/list_name_md_to_html.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert List Names from Markdown to HTML — list_name_md_to_html","title":"Convert List Names from Markdown to HTML — list_name_md_to_html","text":"function converts names list markdown HTML format. works mc_buttons mc_multiple_buttons.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/list_name_md_to_html.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert List Names from Markdown to HTML — list_name_md_to_html","text":"","code":"list_name_md_to_html(list)"},{"path":"https://jhelvy.github.io/surveydown/reference/list_name_md_to_html.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert List Names from Markdown to HTML — list_name_md_to_html","text":"list list whose names markdown format.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/list_name_md_to_html.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert List Names from Markdown to HTML — list_name_md_to_html","text":"list names converted HTML format.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/make_next_button_id.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate Next Button ID — make_next_button_id","title":"Generate Next Button ID — make_next_button_id","text":"internal function generates unique ID 'Next' button based next page ID.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/make_next_button_id.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate Next Button ID — make_next_button_id","text":"","code":"make_next_button_id(next_page)"},{"path":"https://jhelvy.github.io/surveydown/reference/make_next_button_id.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate Next Button ID — make_next_button_id","text":"next_page Character string. ID next page.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/make_next_button_id.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate Next Button ID — make_next_button_id","text":"character string representing button ID.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/make_ts_name.html","id":null,"dir":"Reference","previous_headings":"","what":"Make Timestamp Name — make_ts_name","title":"Make Timestamp Name — make_ts_name","text":"function creates standardized name timestamps based type ID.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/make_ts_name.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Make Timestamp Name — make_ts_name","text":"","code":"make_ts_name(type, id)"},{"path":"https://jhelvy.github.io/surveydown/reference/make_ts_name.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Make Timestamp Name — make_ts_name","text":"type character string, either \"page\" \"question\". id ID page question.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/make_ts_name.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Make Timestamp Name — make_ts_name","text":"character string representing timestamp name.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/markdown_to_html.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert Markdown to HTML — markdown_to_html","title":"Convert Markdown to HTML — markdown_to_html","text":"function converts markdown text HTML.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/markdown_to_html.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert Markdown to HTML — markdown_to_html","text":"","code":"markdown_to_html(text)"},{"path":"https://jhelvy.github.io/surveydown/reference/markdown_to_html.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert Markdown to HTML — markdown_to_html","text":"text character string containing markdown text.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/markdown_to_html.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert Markdown to HTML — markdown_to_html","text":"HTML string converted input markdown text.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/r_to_sql_type.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert R data type to SQL data type — r_to_sql_type","title":"Convert R data type to SQL data type — r_to_sql_type","text":"Convert R data type SQL data type","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/r_to_sql_type.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert R data type to SQL data type — r_to_sql_type","text":"","code":"r_to_sql_type(r_type)"},{"path":"https://jhelvy.github.io/surveydown/reference/r_to_sql_type.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert R data type to SQL data type — r_to_sql_type","text":"r_type String representing R data type","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/r_to_sql_type.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert R data type to SQL data type — r_to_sql_type","text":"String representing corresponding SQL data type","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/sd_check_versions.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Surveydown Versions — sd_check_versions","title":"Check Surveydown Versions — sd_check_versions","text":"function checks local surveydown R package Quarto extension --date latest online version. compares local versions latest versions available GitHub provides information whether updates needed.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/sd_check_versions.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Surveydown Versions — sd_check_versions","text":"","code":"sd_check_versions()"},{"path":"https://jhelvy.github.io/surveydown/reference/sd_check_versions.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Surveydown Versions — sd_check_versions","text":"return value, called side effects (prints version information update status console).","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/sd_check_versions.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Surveydown Versions — sd_check_versions","text":"","code":"sd_check_versions() #> surveydown R package (local): 0.0.9 #> surveydown R package (latest): 0.0.8 #> surveydown Quarto ext (local): Not found #> surveydown Quarto ext (latest): 0.0.9 #> #> Updates are available. To update both the package and extension to the latest version, run: surveydown::sd_update_surveydown()"},{"path":"https://jhelvy.github.io/surveydown/reference/sd_config.html","id":null,"dir":"Reference","previous_headings":"","what":"Configuration Function for surveydown Surveys — sd_config","title":"Configuration Function for surveydown Surveys — sd_config","text":"function sets configuration surveydown survey, including page question structures, conditional display settings, navigation options.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/sd_config.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Configuration Function for surveydown Surveys — sd_config","text":"","code":"sd_config( skip_if = NULL, skip_if_custom = NULL, show_if = NULL, show_if_custom = NULL, required_questions = NULL, all_questions_required = FALSE, start_page = NULL, show_all_pages = FALSE, admin_page = FALSE )"},{"path":"https://jhelvy.github.io/surveydown/reference/sd_config.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Configuration Function for surveydown Surveys — sd_config","text":"skip_if list conditions certain pages skipped. Defaults NULL. skip_if_custom custom function handle conditions certain pages skipped. Defaults NULL. show_if list conditions certain pages shown. Defaults NULL. show_if_custom custom function handle conditions certain pages shown. Defaults NULL. required_questions Vector character strings. IDs questions must answered respondent can continue survey survey can submitted. Defaults NULL. all_questions_required Logical. TRUE, questions survey required. overrides required_questions parameter. Defaults FALSE. start_page Character string. ID page start . Defaults NULL. show_all_pages Logical. Whether show pages initially. Defaults FALSE. admin_page Logical. Whether include admin page viewing downloading survey data. Defaults FALSE.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/sd_config.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Configuration Function for surveydown Surveys — sd_config","text":"list containing configuration settings survey, including page question structures, conditional display settings, navigation options, admin page settings.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/sd_config.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Configuration Function for surveydown Surveys — sd_config","text":"function retrieves survey metadata, checks validity conditional display settings, ensures specified start page () exists. stores settings configuration list. admin_page set TRUE, admin page included survey. page allows viewing downloading survey data upon entering correct survey password (set using sd_set_password()). all_questions_required set TRUE, override required_questions parameter set questions survey required.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/sd_config.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Configuration Function for surveydown Surveys — sd_config","text":"","code":"if (FALSE) { # \\dontrun{ config <- sd_config( skip_if = list(), skip_if_custom = NULL, show_if = list(), show_if_custom = NULL, required_questions = c(\"q1\", \"q2\"), all_questions_required = FALSE, start_page = \"page1\", show_all_pages = FALSE, admin_page = TRUE ) } # }"},{"path":"https://jhelvy.github.io/surveydown/reference/sd_create_survey.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a Survey Template — sd_create_survey","title":"Create a Survey Template — sd_create_survey","text":"function creates survey template specified directory. can use different templates, \"simple\" default. function prompts user confirm use current working directory path specified.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/sd_create_survey.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a Survey Template — sd_create_survey","text":"","code":"sd_create_survey(path = getwd(), template = \"simple\")"},{"path":"https://jhelvy.github.io/surveydown/reference/sd_create_survey.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a Survey Template — sd_create_survey","text":"path character string specifying directory create survey template. Defaults current working directory. template character string specifying survey template use. Defaults \"simple\". Currently, \"simple\" template available.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/sd_create_survey.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a Survey Template — sd_create_survey","text":"Invisibly returns TRUE survey template successfully created.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/sd_create_survey.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create a Survey Template — sd_create_survey","text":"function downloads latest version surveydown extension GitHub, uses create new survey project. copies necessary files directories specified path, excluding files like README.md .gitignore.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/sd_create_survey.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a Survey Template — sd_create_survey","text":"","code":"if (FALSE) { # \\dontrun{ sd_create_survey() sd_create_survey(path = \"path/to/survey\", template = \"simple\") } # }"},{"path":"https://jhelvy.github.io/surveydown/reference/sd_database.html","id":null,"dir":"Reference","previous_headings":"","what":"Connect to a supabase Database — sd_database","title":"Connect to a supabase Database — sd_database","text":"function establishes connection supabase database using provided connection details.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/sd_database.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Connect to a supabase Database — sd_database","text":"","code":"sd_database( host = NULL, db_name = NULL, port = NULL, user = NULL, table_name = NULL, password = Sys.getenv(\"SURVEYDOWN_PASSWORD\"), gssencmode = \"prefer\", pause = FALSE )"},{"path":"https://jhelvy.github.io/surveydown/reference/sd_database.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Connect to a supabase Database — sd_database","text":"host Character string. host address supabase database. db_name Character string. name supabase database. port Integer. port number supabase database connection. user Character string. username supabase database connection. table_name Character string. name table interact supabase database. password Character string. password supabase database connection. Defaults value SURVEYDOWN_PASSWORD environment variable. gssencmode Character string. GSS encryption mode database connection. Defaults \"prefer\". pause Logical. TRUE, data saved local CSV file instead database. Defaults FALSE.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/sd_database.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Connect to a supabase Database — sd_database","text":"list containing database connection object (db) table name (table_name), NULL pause mode.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/sd_database.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Connect to a supabase Database — sd_database","text":"function checks presence required parameters attempts establish connection supabase database. successful, returns list containing database connection object table name. user must created specified table supabase beforehand. pause mode enabled, function returns NULL data saved local CSV file. password obtained SURVEYDOWN_PASSWORD environment variable default, can overridden explicitly passing value.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/sd_database.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Connect to a supabase Database — sd_database","text":"user must create table inside supabase order make additions.","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/sd_database.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Connect to a supabase Database — sd_database","text":"","code":"if (FALSE) { # \\dontrun{ # Assuming SURVEYDOWN_PASSWORD is set in .Renviron db_connection <- sd_database( host = \"aws-0-us-west-1.pooler.supabase.com\", db_name = \"postgres\", port = \"6---\", user = \"postgres.k----------i\", table_name = \"your-table-name\", pause = FALSE ) # Explicitly providing the password db_connection <- sd_database( host = \"aws-0-us-west-1.pooler.supabase.com\", db_name = \"postgres\", port = \"6---\", user = \"postgres.k----------i\", table_name = \"your-table-name\", password = \"your-password\", pause = FALSE ) } # }"},{"path":"https://jhelvy.github.io/surveydown/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.","code":""},{"path":"https://jhelvy.github.io/surveydown/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 = \"Next\")"},{"path":"https://jhelvy.github.io/surveydown/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 \"Next\".","code":""},{"path":"https://jhelvy.github.io/surveydown/reference/sd_next.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a 'Next' Button for Page Navigation — sd_next","text":"Shiny action button UI element.","code":""},{"path":"https://jhelvy.github.io/surveydown/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, sets input value specified next page ID, facilitating page navigation within Shiny application. button styled appear centered page.","code":""},{"path":"https://jhelvy.github.io/surveydown/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":"sd_next(\"page2\", \"Continue to Next Section\") #>