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 diff --git a/LICENSE-text.html b/LICENSE-text.html index 10c6f4ec..48b1f7a2 100644 --- a/LICENSE-text.html +++ b/LICENSE-text.html @@ -7,7 +7,7 @@ surveydown - 0.0.8 + 0.0.9 diff --git a/LICENSE.html b/LICENSE.html index 3df3cbb7..2d0a041d 100644 --- a/LICENSE.html +++ b/LICENSE.html @@ -7,7 +7,7 @@ surveydown - 0.0.8 + 0.0.9 diff --git a/articles/content.html b/articles/content.html index 9e628add..f31dc7ea 100644 --- a/articles/content.html +++ b/articles/content.html @@ -26,7 +26,7 @@ surveydown - 0.0.8 + 0.0.9 @@ -281,9 +281,9 @@ Adding questions The above code chunk will create a multiple choice question that looks like this: - + -Which is your favorite type of penguin? +Which is your favorite type of penguin? * diff --git a/articles/control.html b/articles/control.html index d57707b6..608d5b62 100644 --- a/articles/control.html +++ b/articles/control.html @@ -26,7 +26,7 @@ surveydown - 0.0.8 + 0.0.9 diff --git a/articles/database.html b/articles/database.html index 6502d962..86e67cc9 100644 --- a/articles/database.html +++ b/articles/database.html @@ -26,7 +26,7 @@ surveydown - 0.0.8 + 0.0.9 diff --git a/articles/deploy.html b/articles/deploy.html index f9b44b93..18102e6b 100644 --- a/articles/deploy.html +++ b/articles/deploy.html @@ -26,7 +26,7 @@ surveydown - 0.0.8 + 0.0.9 diff --git a/articles/formatting.html b/articles/formatting.html index 737efd5f..98d5d441 100644 --- a/articles/formatting.html +++ b/articles/formatting.html @@ -26,7 +26,7 @@ surveydown - 0.0.8 + 0.0.9 diff --git a/articles/index.html b/articles/index.html index 8ac4ee75..8b832efa 100644 --- a/articles/index.html +++ b/articles/index.html @@ -7,7 +7,7 @@ surveydown - 0.0.8 + 0.0.9 diff --git a/articles/install.html b/articles/install.html index 17ea306e..0120dd36 100644 --- a/articles/install.html +++ b/articles/install.html @@ -26,7 +26,7 @@ surveydown - 0.0.8 + 0.0.9 diff --git a/articles/questions.html b/articles/questions.html index fe165c83..669ef2fc 100644 --- a/articles/questions.html +++ b/articles/questions.html @@ -26,7 +26,7 @@ surveydown - 0.0.8 + 0.0.9 diff --git a/articles/surveydown.html b/articles/surveydown.html index a20b5c4b..17c5b39f 100644 --- a/articles/surveydown.html +++ b/articles/surveydown.html @@ -32,7 +32,7 @@ surveydown - 0.0.8 + 0.0.9 diff --git a/authors.html b/authors.html index ab7477bd..5a4c8fd1 100644 --- a/authors.html +++ b/authors.html @@ -7,7 +7,7 @@ surveydown - 0.0.8 + 0.0.9 diff --git a/index.html b/index.html index 042345c0..6882a97b 100644 --- a/index.html +++ b/index.html @@ -30,7 +30,7 @@ surveydown - 0.0.8 + 0.0.9 diff --git a/news/index.html b/news/index.html index 0156a322..d2b0ccdf 100644 --- a/news/index.html +++ b/news/index.html @@ -7,7 +7,7 @@ surveydown - 0.0.8 + 0.0.9 @@ -52,6 +52,15 @@ surveydown (development version) +surveydown 0.0.9 +Required questions are now moved to sd_config() as a separate required_questions argument, instead of being defined in sd_question(). +Two new functions for supporting reactive questions: sd_question_reactive() and sd_reactive_output(). + +sd_store_value() function to store variables into the database. For example, sd_store_value(respondentID, "respID") will store the value of respondentID into a column named "respID". If the name is not provided, the column will be named as its original variable name, in this case, respondentID. +Enhanced robustness for progress bar. Now the progress bar will update based on user’s input. +Updated all roxygen2 documentation texts. + + surveydown 0.0.8 sd_database() function added with pause argument default to FALSE. If pause = FALSE, database will be properly connected; if pause = TRUE, a local CSV will be generated and survey results will be stored there. diff --git a/pkgdown.yml b/pkgdown.yml index 5ecc6910..37c863c3 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -10,7 +10,7 @@ articles: install: install.html questions: questions.html surveydown: surveydown.html -last_built: 2024-08-13T13:57Z +last_built: 2024-08-15T03:16Z urls: reference: https://jhelvy.github.io/surveydown/reference article: https://jhelvy.github.io/surveydown/articles diff --git a/reference/check_all_required.html b/reference/check_all_required.html new file mode 100644 index 00000000..6bffbcdf --- /dev/null +++ b/reference/check_all_required.html @@ -0,0 +1,105 @@ + +Check if all required questions are answered — check_all_required • surveydown + Skip to contents + + + + + surveydown + + 0.0.9 + + + + + + + + Get started +Reference + + Articles + Installation + Survey Content + Question Types + Formatting Your Survey + Control Logic + Database Setup + Deploying Your Survey + +Changelog + + + + + + Light + Dark + Auto + + + + + + + + + Check if all required questions are answered + Source: R/server.R + check_all_required.Rd + + + + 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 + + + + + surveydown + + 0.0.9 + + + + + + + + Get started +Reference + + Articles + Installation + Survey Content + Question Types + Formatting Your Survey + Control Logic + Database Setup + Deploying Your Survey + +Changelog + + + + + + Light + Dark + Auto + + + + + + + + + Check if a single question is answered + Source: R/server.R + check_answer.Rd + + + + 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 + + + + + surveydown + + 0.0.9 + + + + + + + + Get started +Reference + + Articles + Installation + Survey Content + Question Types + Formatting Your Survey + Control Logic + Database Setup + Deploying Your Survey + +Changelog + + + + + + Light + Dark + Auto + + + + + + + + + Check skip and show conditions + Source: R/config.R + check_skip_show.Rd + + + + 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 + + + + + surveydown + + 0.0.9 + + + + + + + + Get started +Reference + + Articles + Installation + Survey Content + Question Types + Formatting Your Survey + Control Logic + Database Setup + Deploying Your Survey + +Changelog + + + + + + Light + Dark + Auto + + + + + + + + + Create a new table in the database + Source: R/db.R + create_table.Rd + + + + 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 + + + + + surveydown + + 0.0.9 + + + + + + + + Get started +Reference + + Articles + Installation + Survey Content + Question Types + Formatting Your Survey + Control Logic + Database Setup + Deploying Your Survey + +Changelog + + + + + + Light + Dark + Auto + + + + + + + + + Upload data to the database + Source: R/db.R + database_uploading.Rd + + + + 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 diff --git a/reference/get_extension_version.html b/reference/get_extension_version.html index a4cad0cd..92ac2505 100644 --- a/reference/get_extension_version.html +++ b/reference/get_extension_version.html @@ -9,7 +9,7 @@ surveydown - 0.0.8 + 0.0.9 diff --git a/reference/get_latest_version_from_url.html b/reference/get_latest_version_from_url.html index 63f1885e..e653db12 100644 --- a/reference/get_latest_version_from_url.html +++ b/reference/get_latest_version_from_url.html @@ -7,7 +7,7 @@ surveydown - 0.0.8 + 0.0.9 diff --git a/reference/get_page_nodes.html b/reference/get_page_nodes.html new file mode 100644 index 00000000..9b2b91da --- /dev/null +++ b/reference/get_page_nodes.html @@ -0,0 +1,85 @@ + +Get page nodes from HTML — get_page_nodes • surveydown + Skip to contents + + + + + surveydown + + 0.0.9 + + + + + + + + Get started +Reference + + Articles + Installation + Survey Content + Question Types + Formatting Your Survey + Control Logic + Database Setup + Deploying Your Survey + +Changelog + + + + + + Light + Dark + Auto + + + + + + + + + Get page nodes from HTML + Source: R/config.R + get_page_nodes.Rd + + + + 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 + + + + + surveydown + + 0.0.9 + + + + + + + + Get started +Reference + + Articles + Installation + Survey Content + Question Types + Formatting Your Survey + Control Logic + Database Setup + Deploying Your Survey + +Changelog + + + + + + Light + Dark + Auto + + + + + + + + + Get page structure from HTML + Source: R/config.R + get_page_structure.Rd + + + + 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 + + + + + surveydown + + 0.0.9 + + + + + + + + Get started +Reference + + Articles + Installation + Survey Content + Question Types + Formatting Your Survey + Control Logic + Database Setup + Deploying Your Survey + +Changelog + + + + + + Light + Dark + Auto + + + + + + + + + Get question nodes from HTML + Source: R/config.R + get_question_nodes.Rd + + + + 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 + + + + + surveydown + + 0.0.9 + + + + + + + + Get started +Reference + + Articles + Installation + Survey Content + Question Types + Formatting Your Survey + Control Logic + Database Setup + Deploying Your Survey + +Changelog + + + + + + Light + Dark + Auto + + + + + + + + + Get question structure from HTML + Source: R/config.R + get_question_structure.Rd + + + + 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 + + + + + surveydown + + 0.0.9 + + + + + + + + Get started +Reference + + Articles + Installation + Survey Content + Question Types + Formatting Your Survey + Control Logic + Database Setup + Deploying Your Survey + +Changelog + + + + + + Light + Dark + Auto + + + + + + + + + Get Current UTC Timestamp + Source: R/util.R + get_utc_timestamp.Rd + + + + 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 + + + + + surveydown + + 0.0.9 + + + + + + + + Get started +Reference + + Articles + Installation + Survey Content + Question Types + Formatting Your Survey + Control Logic + Database Setup + Deploying Your Survey + +Changelog + + + + + + Light + Dark + Auto + + + + + + + + + Handle basic show-if logic + Source: R/server.R + handle_basic_show_if_logic.Rd + + + + 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 + + + + + surveydown + + 0.0.9 + + + + + + + + Get started +Reference + + Articles + Installation + Survey Content + Question Types + Formatting Your Survey + Control Logic + Database Setup + Deploying Your Survey + +Changelog + + + + + + Light + Dark + Auto + + + + + + + + + Handle basic skip logic + Source: R/server.R + handle_basic_skip_logic.Rd + + + + 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 + + + + + surveydown + + 0.0.9 + + + + + + + + Get started +Reference + + Articles + Installation + Survey Content + Question Types + Formatting Your Survey + Control Logic + Database Setup + Deploying Your Survey + +Changelog + + + + + + Light + Dark + Auto + + + + + + + + + Handle custom show-if logic + Source: R/server.R + handle_custom_show_if_logic.Rd + + + + 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 + + + + + surveydown + + 0.0.9 + + + + + + + + Get started +Reference + + Articles + Installation + Survey Content + Question Types + Formatting Your Survey + Control Logic + Database Setup + Deploying Your Survey + +Changelog + + + + + + Light + Dark + Auto + + + + + + + + + Handle custom skip logic + Source: R/server.R + handle_custom_skip_logic.Rd + + + + 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 + + + + + surveydown + + 0.0.9 + + + + + + + + Get started +Reference + + Articles + Installation + Survey Content + Question Types + Formatting Your Survey + Control Logic + Database Setup + Deploying Your Survey + +Changelog + + + + + + Light + Dark + Auto + + + + + + + + + Handle overall skip logic + Source: R/server.R + handle_skip_logic.Rd + + + + 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 @@ -79,7 +79,7 @@ Functions for setting up Survey Components - Functions for defining survey questions and navigation + Functions for defining survey questions, navigation, and storing values @@ -95,10 +95,28 @@ Survey Componentssd_question_reactive() + + + Create a reactive survey question + + + sd_reactive_output() + + + Create a placeholder for a reactive survey question + + sd_next() Create a 'Next' Button for Page Navigation + + + sd_store_value() + + + Store a custom value for the survey Configuration and Server diff --git a/reference/initialize_timestamps.html b/reference/initialize_timestamps.html new file mode 100644 index 00000000..6c1be09d --- /dev/null +++ b/reference/initialize_timestamps.html @@ -0,0 +1,97 @@ + +Initialize Timestamps for Pages and Questions — initialize_timestamps • surveydown + Skip to contents + + + + + surveydown + + 0.0.9 + + + + + + + + Get started +Reference + + Articles + Installation + Survey Content + Question Types + Formatting Your Survey + Control Logic + Database Setup + Deploying Your Survey + +Changelog + + + + + + Light + Dark + Auto + + + + + + + + + Initialize Timestamps for Pages and Questions + Source: R/util.R + initialize_timestamps.Rd + + + + 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 + + + + + surveydown + + 0.0.9 + + + + + + + + Get started +Reference + + Articles + Installation + Survey Content + Question Types + Formatting Your Survey + Control Logic + Database Setup + Deploying Your Survey + +Changelog + + + + + + Light + Dark + Auto + + + + + + + + + Check if a question is visible + Source: R/server.R + is_question_visible.Rd + + + + 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 + + + + + surveydown + + 0.0.9 + + + + + + + + Get started +Reference + + Articles + Installation + Survey Content + Question Types + Formatting Your Survey + Control Logic + Database Setup + Deploying Your Survey + +Changelog + + + + + + Light + Dark + Auto + + + + + + + + + Convert List Names from Markdown to HTML + Source: R/util.R + list_name_md_to_html.Rd + + + + 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 + + + + + surveydown + + 0.0.9 + + + + + + + + Get started +Reference + + Articles + Installation + Survey Content + Question Types + Formatting Your Survey + Control Logic + Database Setup + Deploying Your Survey + +Changelog + + + + + + Light + Dark + Auto + + + + + + + + + Generate Next Button ID + Source: R/ui.R + make_next_button_id.Rd + + + + 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 + + + + + surveydown + + 0.0.9 + + + + + + + + Get started +Reference + + Articles + Installation + Survey Content + Question Types + Formatting Your Survey + Control Logic + Database Setup + Deploying Your Survey + +Changelog + + + + + + Light + Dark + Auto + + + + + + + + + Make Timestamp Name + Source: R/util.R + make_ts_name.Rd + + + + 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 + + + + + surveydown + + 0.0.9 + + + + + + + + Get started +Reference + + Articles + Installation + Survey Content + Question Types + Formatting Your Survey + Control Logic + Database Setup + Deploying Your Survey + +Changelog + + + + + + Light + Dark + Auto + + + + + + + + + Convert Markdown to HTML + Source: R/util.R + markdown_to_html.Rd + + + + 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 + + + + + surveydown + + 0.0.9 + + + + + + + + Get started +Reference + + Articles + Installation + Survey Content + Question Types + Formatting Your Survey + Control Logic + Database Setup + Deploying Your Survey + +Changelog + + + + + + Light + Dark + Auto + + + + + + + + + Convert R data type to SQL data type + Source: R/db.R + r_to_sql_type.Rd + + + + 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 @@ -53,7 +57,9 @@ This function checks if the local surveydown R package and Quarto extension -are up-to-date with the latest online version. +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. @@ -63,16 +69,17 @@ Usage Value - No return value, called for side effects (prints version information). + No return value, called for side effects (prints version information +and update status to the console). Examples sd_check_versions() -#> surveydown R package (local): 0.0.8 +#> 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.8 +#> 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() diff --git a/reference/sd_config.html b/reference/sd_config.html index cc9d6f7b..22cb16e5 100644 --- a/reference/sd_config.html +++ b/reference/sd_config.html @@ -9,7 +9,7 @@ surveydown - 0.0.8 + 0.0.9 @@ -63,6 +63,8 @@ Usage 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 @@ -89,6 +91,17 @@ Argumentsrequired_questions +Vector of character strings. The IDs of questions that must +be answered before the respondent can continue in the survey or survey can be +submitted. Defaults to NULL. + + +all_questions_required +Logical. If TRUE, all questions in the survey will be required. +This overrides the required_questions parameter. Defaults to FALSE. + + start_page Character string. The ID of the page to start on. Defaults to NULL. @@ -113,6 +126,8 @@ Details these settings in a configuration list. If admin_page is set to TRUE, an admin page will be included in the survey. This page allows viewing and downloading of survey data upon entering the correct survey password (set using sd_set_password()). +If all_questions_required is set to TRUE, it will override the required_questions parameter +and set all questions in the survey as required. @@ -123,6 +138,8 @@ Examples 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 diff --git a/reference/sd_create_survey.html b/reference/sd_create_survey.html index 3e2af67d..58bb7579 100644 --- a/reference/sd_create_survey.html +++ b/reference/sd_create_survey.html @@ -13,7 +13,7 @@ surveydown - 0.0.8 + 0.0.9 @@ -78,20 +78,27 @@ Argumentstemplate A character string specifying the survey template to use. -Defaults to "simple". +Defaults to "simple". Currently, only the "simple" template is available. Value - A message indicating the successful creation of the survey template. + Invisibly returns TRUE if the survey template was successfully created. + + + Details + This function downloads the latest version of the surveydown extension from GitHub, +and uses it to create a new survey project. It copies all necessary files and +directories to the specified path, excluding some files like README.md and .gitignore. Examples if (FALSE) { # \dontrun{ sd_create_survey() -sd_create_survey(path = "path/to/package", template = "simple") +sd_create_survey(path = "path/to/survey", template = "simple") } # } + - This function creates a 'Next' button for navigating to the specified next page in a surveydown survey. + This function creates a 'Next' button for navigating to the specified next page in a Surveydown survey. @@ -77,24 +77,14 @@ Value Details The function generates a Shiny action button that, when clicked, sets the input value -to the specified next page ID, facilitating page navigation within the Shiny application. +to the specified next page ID, facilitating page navigation within the Shiny application. +The button is styled to appear centered on the page. Examples - 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) -} # } + sd_next("page2", "Continue to Next Section") +#> <button id="next-page2" type="button" class="btn btn-default action-button" style="display: block; margin: auto;" onclick="Shiny.setInputValue('next_page', 'page2');">Continue to Next Section</button> diff --git a/reference/sd_question.html b/reference/sd_question.html index 8fc8750b..79716aa7 100644 --- a/reference/sd_question.html +++ b/reference/sd_question.html @@ -1,5 +1,5 @@ -Create a survey question — sd_question • surveydown +Create a survey question — sd_question • surveydown Skip to contents @@ -7,7 +7,7 @@ surveydown - 0.0.8 + 0.0.9 @@ -50,7 +50,7 @@ - This function creates various types of survey questions. + This function creates various types of survey questions for use in a Surveydown survey. @@ -72,7 +72,6 @@ Usage force_edges = TRUE, option = NULL, placeholder = NULL, - required = FALSE, resize = NULL ) @@ -82,7 +81,7 @@ Argumentstype -Specifies the type of question. Possible values are "select", "mc", "mc_multiple", "mc_buttons", "mc_multiple_buttons", "text", "textarea", "numeric", "slider", "date", and "daterange". See "Details" section for more about each type. +Specifies the type of question. Possible values are "select", "mc", "mc_multiple", "mc_buttons", "mc_multiple_buttons", "text", "textarea", "numeric", "slider", "date", and "daterange". id @@ -145,10 +144,6 @@ Argumentsrequired -Logical. Whether the input is required. Defaults to FALSE. - - resize Character string. Resize option for textarea input. Defaults to NULL. @@ -159,13 +154,57 @@ Value Details - Insert any detailed information here, such as more details on the types of questions - + The function supports various question types:"select": A dropdown selection +"mc": Multiple choice (single selection) +"mc_multiple": Multiple choice (multiple selections allowed) +"mc_buttons": Multiple choice with button-style options (single selection) +"mc_multiple_buttons": Multiple choice with button-style options (multiple selections allowed) +"text": Single-line text input +"textarea": Multi-line text input +"numeric": Numeric input +"slider": Slider input +"date": Date input +"daterange": Date range input + Examples - # Insert examples here - + sd_question("text", "name", "What is your name?") +#> <div id="container- name" data-question-id="name" class="question-container"> +#> <div class="form-group shiny-input-container" style="width:100%;"> +#> <label class="control-label" id="name-label" for="name"><p>What is your name? <span class='required-asterisk' style='display:none; color: red; font-size: 1.5em; vertical-align: middle; position: relative; top: 0.1em;'>*</span></p> +#> </label> +#> <input id="name" type="text" class="shiny-input-text form-control" value=""/> +#> </div> +#> </div> +sd_question("mc", "color", "What is your favorite color?", option = c("Red", "Blue", "Green")) +#> <div id="container- color" data-question-id="color" class="question-container"> +#> <div id="color" style="width:100%;" class="form-group shiny-input-radiogroup shiny-input-container" role="radiogroup" aria-labelledby="color-label"> +#> <label class="control-label" id="color-label" for="color"><p>What is your favorite color? <span class='required-asterisk' style='display:none; color: red; font-size: 1.5em; vertical-align: middle; position: relative; top: 0.1em;'>*</span></p> +#> </label> +#> <div class="shiny-options-group"> +#> <div class="radio"> +#> <label> +#> <input type="radio" name="color" value="Red"/> +#> <span>Red</span> +#> </label> +#> </div> +#> <div class="radio"> +#> <label> +#> <input type="radio" name="color" value="Blue"/> +#> <span>Blue</span> +#> </label> +#> </div> +#> <div class="radio"> +#> <label> +#> <input type="radio" name="color" value="Green"/> +#> <span>Green</span> +#> </label> +#> </div> +#> </div> +#> </div> +#> </div> +
The above code chunk will create a multiple choice question that looks like this:
Which is your favorite type of penguin?
Which is your favorite type of penguin? *
sd_config()
required_questions
sd_question()
sd_question_reactive()
sd_reactive_output()
sd_store_value()
sd_store_value(respondentID, "respID")
respondentID
"respID"
sd_database()
pause
FALSE
pause = FALSE
pause = TRUE
R/server.R
check_all_required.Rd
Check if all required questions are answered
check_all_required(questions, questions_required, input, show_if)
Vector of question identifiers
Vector of required question identifiers
Shiny input object
Data frame of show-if conditions
Logical indicating if all required questions are answered
check_answer.Rd
Check if a single question is answered
check_answer(q, input)
Question identifier
Logical indicating if the question is answered
R/config.R
check_skip_show.Rd
This function validates the skip_if and show_if conditions provided in the configuration.
check_skip_show(config, skip_if, skip_if_custom, show_if, show_if_custom)
The survey configuration list
Data frame of skip conditions
Custom skip function
Data frame of show conditions
Custom show function
TRUE if all checks pass, otherwise stops with an error message
R/db.R
create_table.Rd
Create a new table in the database
create_table(db, table_name, df)
Database connection object
String name of the table to create
Data frame used to determine table structure
None (called for side effects)
database_uploading.Rd
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.
database_uploading(df, db, table_name)
Data frame of survey data to upload
String name of the table to upload to
get_page_nodes.Rd
Get page nodes from HTML
get_page_nodes()
A list of page nodes from the HTML document
get_page_structure.Rd
Get page structure from HTML
get_page_structure()
A list where each element represents a page and contains the question IDs on that page
get_question_nodes.Rd
Get question nodes from HTML
get_question_nodes()
A list of question nodes from the HTML document
get_question_structure.Rd
Get question structure from HTML
get_question_structure()
A list where each element represents a question and contains its options
R/util.R
get_utc_timestamp.Rd
This function returns the current timestamp in UTC format.
get_utc_timestamp()
A character string representing the current UTC timestamp.
handle_basic_show_if_logic.Rd
Handle basic show-if logic
handle_basic_show_if_logic(input, show_if)
handle_basic_skip_logic.Rd
Handle basic skip logic
handle_basic_skip_logic(input, skip_if, current_page, next_page)
Data frame of skip-if conditions
Current page identifier
Next page identifier
Updated next page identifier
handle_custom_show_if_logic.Rd
Handle custom show-if logic
handle_custom_show_if_logic(input, show_if_custom)
List of custom show-if conditions
handle_custom_skip_logic.Rd
Handle custom skip logic
handle_custom_skip_logic(input, skip_if_custom, current_page, next_page)
List of custom skip-if conditions
handle_skip_logic.Rd
Handle overall skip logic
handle_skip_logic(input, skip_if, skip_if_custom, current_page, next_page)
Data frame of basic skip-if conditions
Functions for defining survey questions and navigation
Functions for defining survey questions, navigation, and storing values
sd_next()
initialize_timestamps.Rd
This function initializes timestamps for pages and questions in a survey.
initialize_timestamps(page_ids, question_ids)
A vector of page IDs.
A vector of question IDs.
A list of initialized timestamps for pages and questions.
is_question_visible.Rd
Check if a question is visible
is_question_visible(q, show_if, input)
Logical indicating if the question is visible
list_name_md_to_html.Rd
This function converts the names of a list from markdown to HTML format. +It only works for mc_buttons and mc_multiple_buttons.
list_name_md_to_html(list)
A list whose names are in markdown format.
A list with names converted to HTML format.
R/ui.R
make_next_button_id.Rd
This internal function generates a unique ID for the 'Next' button based on the next page ID.
make_next_button_id(next_page)
Character string. The ID of the next page.
A character string representing the button ID.
make_ts_name.Rd
This function creates a standardized name for timestamps based on the type and ID.
make_ts_name(type, id)
A character string, either "page" or "question".
The ID of the page or question.
A character string representing the timestamp name.
markdown_to_html.Rd
This function converts markdown text to HTML.
markdown_to_html(text)
A character string containing markdown text.
An HTML string converted from the input markdown text.
r_to_sql_type.Rd
Convert R data type to SQL data type
r_to_sql_type(r_type)
String representing R data type
String representing corresponding SQL data type
This function checks if the local surveydown R package and Quarto extension -are up-to-date with the latest online version.
No return value, called for side effects (prints version information).
No return value, called for side effects (prints version information +and update status to the console).
sd_check_versions() -#> surveydown R package (local): 0.0.8 +#> 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.8 +#> 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()
Vector of character strings. The IDs of questions that must +be answered before the respondent can continue in the survey or survey can be +submitted. Defaults to NULL.
Logical. If TRUE, all questions in the survey will be required. +This overrides the required_questions parameter. Defaults to FALSE.
Character string. The ID of the page to start on. Defaults to NULL.
admin_page
sd_set_password()
If all_questions_required is set to TRUE, it will override the required_questions parameter +and set all questions in the survey as required.
all_questions_required
A character string specifying the survey template to use. -Defaults to "simple".
"simple"
A message indicating the successful creation of the survey template.
Invisibly returns TRUE if the survey template was successfully created.
This function downloads the latest version of the surveydown extension from GitHub, +and uses it to create a new survey project. It copies all necessary files and +directories to the specified path, excluding some files like README.md and .gitignore.
if (FALSE) { # \dontrun{ sd_create_survey() -sd_create_survey(path = "path/to/package", template = "simple") +sd_create_survey(path = "path/to/survey", template = "simple") } # } +
This function creates a 'Next' button for navigating to the specified next page in a surveydown survey.
This function creates a 'Next' button for navigating to the specified next page in a Surveydown survey.
The function generates a Shiny action button that, when clicked, sets the input value -to the specified next page ID, facilitating page navigation within the Shiny application.
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) -} # } + sd_next("page2", "Continue to Next Section") +#> <button id="next-page2" type="button" class="btn btn-default action-button" style="display: block; margin: auto;" onclick="Shiny.setInputValue('next_page', 'page2');">Continue to Next Section</button>
sd_next("page2", "Continue to Next Section") +#> <button id="next-page2" type="button" class="btn btn-default action-button" style="display: block; margin: auto;" onclick="Shiny.setInputValue('next_page', 'page2');">Continue to Next Section</button>
This function creates various types of survey questions.
This function creates various types of survey questions for use in a Surveydown survey.
Specifies the type of question. Possible values are "select", "mc", "mc_multiple", "mc_buttons", "mc_multiple_buttons", "text", "textarea", "numeric", "slider", "date", and "daterange". See "Details" section for more about each type.
Specifies the type of question. Possible values are "select", "mc", "mc_multiple", "mc_buttons", "mc_multiple_buttons", "text", "textarea", "numeric", "slider", "date", and "daterange".
Logical. Whether the input is required. Defaults to FALSE.
Character string. Resize option for textarea input. Defaults to NULL.
Insert any detailed information here, such as more details on the types of questions
The function supports various question types:
"select": A dropdown selection
"mc": Multiple choice (single selection)
"mc_multiple": Multiple choice (multiple selections allowed)
"mc_buttons": Multiple choice with button-style options (single selection)
"mc_multiple_buttons": Multiple choice with button-style options (multiple selections allowed)
"text": Single-line text input
"textarea": Multi-line text input
"numeric": Numeric input
"slider": Slider input
"date": Date input
"daterange": Date range input
# Insert examples here - + sd_question("text", "name", "What is your name?") +#> <div id="container- name" data-question-id="name" class="question-container"> +#> <div class="form-group shiny-input-container" style="width:100%;"> +#> <label class="control-label" id="name-label" for="name"><p>What is your name? <span class='required-asterisk' style='display:none; color: red; font-size: 1.5em; vertical-align: middle; position: relative; top: 0.1em;'>*</span></p> +#> </label> +#> <input id="name" type="text" class="shiny-input-text form-control" value=""/> +#> </div> +#> </div> +sd_question("mc", "color", "What is your favorite color?", option = c("Red", "Blue", "Green")) +#> <div id="container- color" data-question-id="color" class="question-container"> +#> <div id="color" style="width:100%;" class="form-group shiny-input-radiogroup shiny-input-container" role="radiogroup" aria-labelledby="color-label"> +#> <label class="control-label" id="color-label" for="color"><p>What is your favorite color? <span class='required-asterisk' style='display:none; color: red; font-size: 1.5em; vertical-align: middle; position: relative; top: 0.1em;'>*</span></p> +#> </label> +#> <div class="shiny-options-group"> +#> <div class="radio"> +#> <label> +#> <input type="radio" name="color" value="Red"/> +#> <span>Red</span> +#> </label> +#> </div> +#> <div class="radio"> +#> <label> +#> <input type="radio" name="color" value="Blue"/> +#> <span>Blue</span> +#> </label> +#> </div> +#> <div class="radio"> +#> <label> +#> <input type="radio" name="color" value="Green"/> +#> <span>Green</span> +#> </label> +#> </div> +#> </div> +#> </div> +#> </div> +
sd_question("text", "name", "What is your name?") +#> <div id="container- name" data-question-id="name" class="question-container"> +#> <div class="form-group shiny-input-container" style="width:100%;"> +#> <label class="control-label" id="name-label" for="name"><p>What is your name? <span class='required-asterisk' style='display:none; color: red; font-size: 1.5em; vertical-align: middle; position: relative; top: 0.1em;'>*</span></p> +#> </label> +#> <input id="name" type="text" class="shiny-input-text form-control" value=""/> +#> </div> +#> </div> +sd_question("mc", "color", "What is your favorite color?", option = c("Red", "Blue", "Green")) +#> <div id="container- color" data-question-id="color" class="question-container"> +#> <div id="color" style="width:100%;" class="form-group shiny-input-radiogroup shiny-input-container" role="radiogroup" aria-labelledby="color-label"> +#> <label class="control-label" id="color-label" for="color"><p>What is your favorite color? <span class='required-asterisk' style='display:none; color: red; font-size: 1.5em; vertical-align: middle; position: relative; top: 0.1em;'>*</span></p> +#> </label> +#> <div class="shiny-options-group"> +#> <div class="radio"> +#> <label> +#> <input type="radio" name="color" value="Red"/> +#> <span>Red</span> +#> </label> +#> </div> +#> <div class="radio"> +#> <label> +#> <input type="radio" name="color" value="Blue"/> +#> <span>Blue</span> +#> </label> +#> </div> +#> <div class="radio"> +#> <label> +#> <input type="radio" name="color" value="Green"/> +#> <span>Green</span> +#> </label> +#> </div> +#> </div> +#> </div> +#> </div> +