Learn R Programming

surveydown (version 1.0.1)

sd_is_answered: Check if a question is answered

Description

This function checks if a given question has been answered by the user. For matrix questions, it checks if all sub-questions (rows) are answered.

Usage

sd_is_answered(question_id)

Value

A logical value: TRUE if the question is answered, FALSE

otherwise.

Arguments

question_id

The ID of the question to check.

Examples

Run this code
if (interactive()) {
  library(surveydown)

  # Use sd_is_answered() to conditionally execute code:
  # server <- function(input, output, session) {
  #   observe({
  #     if (sd_is_answered(input$age)) {
  #       message("Age question answered!")
  #     }
  #   })
  #   sd_server()
  # }

  # Find a working directory and start from a template:
  sd_create_survey(template = "default")
  # This creates survey.qmd and app.R - launch the survey using app.R
}

Run the code above in your browser using DataLab