Skip to contents

Opens an instrument as a respondent would meet it, either as a standalone page in the browser or on SurveyStudio's preview screen. The preview has its collector removed, so trying it is safe: no answer is sent anywhere.

Usage

preview_survey(x, where = c("browser", "studio"), open = interactive())

Arguments

x

An sframe instrument, or a demo name from sframe_list_demos(). A demo is shown with the standard demo branding, as sframe_demo(name, branded = TRUE) applies it.

where

One of "browser", a standalone HTML page written by export_survey(), or "studio", the preview screen of launch_studio().

open

Logical. Whether to open the browser. Defaults to interactive().

Value

For "browser", the path of the HTML page, invisibly. For "studio", what launch_studio() returns.

See also

export_survey() for the page you send to respondents, launch_studio(), sframe_demo()

Other Preview functions: run_survey()

Examples

# A demo by name
path <- preview_survey("two_group", open = FALSE)
sframe_show(path)

# Your own instrument
ins <- sframe_demo("first_survey")$instrument
path <- preview_survey(ins, open = FALSE)
sframe_show(path)