diff --git a/DESCRIPTION b/DESCRIPTION index 60cc9a11..e5459fcf 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: surveydown Title: Markdown-Based Surveys Using Quarto Shiny Documents -Version: 0.3.4 +Version: 0.3.5 Authors@R: c( person(given = "John Paul", family = "Helveston", diff --git a/NEWS.md b/NEWS.md index 624c15ca..f17b0870 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,7 +1,11 @@ # surveydown (development version) +# surveydown 0.3.5 + - The database updating is simplified to only write to the database on each page turn and after the survey closes. - Bug fix: if you added new questions or values to the survey after creating the initial database table, those new values would not have been added to the table. Now they are added. +- Now the server will only update the data upon page flip and survey closure in order to decrease data traffic. +- `auto_scroll` changed to `FALSE` by default. # surveydown 0.3.4 diff --git a/R/server.R b/R/server.R index 76646add..c04e63a6 100644 --- a/R/server.R +++ b/R/server.R @@ -6,17 +6,17 @@ #' page navigation, database updates for survey responses, and exit survey functionality. #' #' @param db A list containing database connection information created using -#' \code{\link{sd_database}} function. Defaults to \code{NULL}. +#' \code{\link{sd_database}} function. Defaults to `NULL`. #' @param use_html Logical. By default, the `"survey.qmd"` file will be #' rendered when the app launches, which can be slow. Users can render it #' first into a html file and set `use_html = TRUE` to use the pre-rendered #' file, which is faster when the app loads. Defaults to `FALSE`. -#' @param required_questions Vector of character strings. The IDs of questions that must be answered. Defaults to NULL. +#' @param required_questions Vector of character strings. The IDs of questions that must be answered. Defaults to `NULL`. #' @param all_questions_required Logical. If TRUE, all questions in the survey will be required. Defaults to FALSE. #' @param start_page Character string. The ID of the page to start on. Defaults to NULL. #' @param admin_page Logical. Whether to include an admin page for viewing and downloading survey data. Defaults to `FALSE`. -#' @param auto_scroll Logical. Whether to enable auto-scrolling to the next question after answering. Defaults to TRUE. -#' @param rate_survey Logical. If TRUE, shows a rating question when exiting the survey. If FALSE, shows a simple confirmation dialog. Defaults to FALSE. +#' @param auto_scroll Logical. Whether to enable auto-scrolling to the next question after answering. Defaults to `FALSE`. +#' @param rate_survey Logical. If TRUE, shows a rating question when exiting the survey. If FALSE, shows a simple confirmation dialog. Defaults to `FALSE`. #' #' @import shiny #' @import shinyWidgets @@ -86,7 +86,7 @@ sd_server <- function( all_questions_required = FALSE, start_page = NULL, admin_page = FALSE, - auto_scroll = TRUE, + auto_scroll = FALSE, rate_survey = FALSE ) { diff --git a/man/sd_server.Rd b/man/sd_server.Rd index ecdec7e3..4a487160 100644 --- a/man/sd_server.Rd +++ b/man/sd_server.Rd @@ -11,7 +11,7 @@ sd_server( all_questions_required = FALSE, start_page = NULL, admin_page = FALSE, - auto_scroll = TRUE, + auto_scroll = FALSE, rate_survey = FALSE ) } @@ -24,7 +24,7 @@ rendered when the app launches, which can be slow. Users can render it first into a html file and set \code{use_html = TRUE} to use the pre-rendered file, which is faster when the app loads. Defaults to \code{FALSE}.} -\item{required_questions}{Vector of character strings. The IDs of questions that must be answered. Defaults to NULL.} +\item{required_questions}{Vector of character strings. The IDs of questions that must be answered. Defaults to \code{NULL}.} \item{all_questions_required}{Logical. If TRUE, all questions in the survey will be required. Defaults to FALSE.} @@ -32,9 +32,9 @@ file, which is faster when the app loads. Defaults to \code{FALSE}.} \item{admin_page}{Logical. Whether to include an admin page for viewing and downloading survey data. Defaults to \code{FALSE}.} -\item{auto_scroll}{Logical. Whether to enable auto-scrolling to the next question after answering. Defaults to TRUE.} +\item{auto_scroll}{Logical. Whether to enable auto-scrolling to the next question after answering. Defaults to \code{FALSE}.} -\item{rate_survey}{Logical. If TRUE, shows a rating question when exiting the survey. If FALSE, shows a simple confirmation dialog. Defaults to FALSE.} +\item{rate_survey}{Logical. If TRUE, shows a rating question when exiting the survey. If FALSE, shows a simple confirmation dialog. Defaults to \code{FALSE}.} } \value{ This function does not return a value; it sets up the server-side logic for the Shiny application.