| Survey {limonaid} | R Documentation |
R6 Class representing a LimeSurvey survey
Description
R6 Class representing a LimeSurvey survey
R6 Class representing a LimeSurvey survey
Details
Create and work with a Survey to programmatically (or interactively) create a survey, export it to a tab separated values file, and import it to LimeSurvey.
Public fields
titlesThe title of the survey in the primary language and any additional languages
descriptionsThe descriptions of the survey in the primary language and any additional languages
welcomeTextsThe welcome texts of the survey in the primary language and any additional languages
endTextsThe end texts of the survey in the primary language and any additional languages
endURLsThe end URLs of the survey in the primary language and any additional languages
endURLdescriptionsThe end URL descriptions of the survey in the primary language and any additional languages
dateformatsThe date format to use in the primary language and any additional languages; the index of the option from the dropdown in LimeSurvey (6 is the ISO standard, "YYYY-MM-DD").
numberformatsThe number format to use in the primary language and any additional languages (for periods as decimal marks,
0; for commas as decimal marks,1).sidThe unique survey identifier; if this is free when importing the survey, this will be used.
gsidThe Survey Group identifier.
adminThe name of the survey administrator
adminemailThe email address of the survey administrator
anonymizedWhether the survey uses anonymized responses (
YorN).faxtoThe contents of the "Fax to" field
formatHow to present the survey (
Qfor question by question;Gfor group by group; andAfor all in one).savetimingsWhether to save timings of responses (
YorN).templateThe name of the LimeSurvey theme to use.
languageThe primary language of the survey.
additional_languagesAny additional languages the survey uses.
datestampWhether to datestamp responses (
YorN).usecookieWhether to use cookies to enable answer persistence.
allowregisterWhether to allow public registration (
YorN).allowsaveWhether to allow users to save their responses and returning later (
YorN).autonumber_startWhere to start autonumbering
autoredirectWhether to automatically redirect users to a URL (
YorN).allowprevWhether to allow users to return to previous pages (
YorN).printanswersWhether to allow printing of answer (
YorN).ipaddrWhether to store IP addresses (
YorN).refurlWhether to store the referring URL (
YorN).showsurveypolicynoticeWhether to show the data policy notice (
YorN).publicstatisticsWhether to have public statistics (
YorN).publicgraphsWhether to show graphs in public statistics (
YorN).listpublicWhether to list the survey publicly (
YorN).htmlemailWhether to use HTML format for token emails (
YorN).sendconfirmationWhether to send confirmation emails (
YorN).tokenanswerspersistenceWhether to use token-based response persistence (
YorN).assessmentsWhether to use assessments (
YorN).usecaptchaWhether to use CAPTCHA's (
YorN).usetokensWhether to use tokens (
YorN).bounce_emailWhere bouncing emails should be sent.
emailresponsetoWhere detailed admin notifications emails should be sent.
emailnotificationtoWhere a notification should be sent for new responses.
tokenlengthThe token length.
showxquestionsWhether to show "There are X questions in this survey" (
YorN).showgroupinfoWhether to show group name and info (
Bfor both,?, orXto show nothing).shownoanswerWhether to show the "No answer" option (
YorN).showqnumcodeWhether to show answer codes or numbers (
Y,N, orXto show nothing).bounceprocessingWhether to process bouncing emails? (
YorN).showwelcomeWhether to show the welcome page (
YorN).showprogressWhether to show the progress bar (
YorN).questionindexWhether to show the question index (
0to disable; can also be set to incremental or full (1and2?)).navigationdelayThe navigation delay in seconds
nokeyboardWhether to show the on-screen keyboard (
YorN).alloweditaftercompletionWhether to allow multiple reponses (
N) or to allow updating responses with one token (Y)?googleanalyticsstyleThe google analytics settings;
0for None, other values for other settings.googleanalyticsapikeyThe google analytics API key.
groupsThe groups in the survey.
tsvDataUsed to store the dataframe saved to a file as tab separated values.
Active bindings
get_group_idsA list of all group ids.
get_group_titlesA list of all group ids.
Methods
Public methods
Method new()
Create a new survey object.
Usage
Survey$new( titles, descriptions = "", welcomeTexts = "", endTexts = "", endURLs = "", endURLdescriptions = "", dateformats = 6, numberformats = 0, sid = 1, gsid = 1, admin = "Admin Name", adminemail = "email@add.ress", anonymized = "Y", faxto = "", format = "G", savetimings = "Y", template = "vanilla", language = "en", additional_languages = "", datestamp = "Y", usecookie = "N", allowregister = "N", allowsave = "N", autonumber_start = 0, autoredirect = "Y", allowprev = "N", printanswers = "N", ipaddr = "N", refurl = "N", showsurveypolicynotice = "0", publicstatistics = "N", publicgraphs = "N", listpublic = "N", htmlemail = "Y", sendconfirmation = "N", tokenanswerspersistence = "N", assessments = "N", usecaptcha = "N", usetokens = "N", bounce_email = "", emailresponseto = "", emailnotificationto = "", tokenlength = 15, showxquestions = "N", showgroupinfo = "X", shownoanswer = "N", showqnumcode = "X", bounceprocessing = "N", showwelcome = "N", showprogress = "N", questionindex = "0", navigationdelay = "0", nokeyboard = "N", alloweditaftercompletion = "N", googleanalyticsstyle = 0, googleanalyticsapikey = "" )
Arguments
titlesThe titles of the survey in the primary language and optionally any addiitonal languages.
descriptionsThe descriptions of the survey in the primary language and any additional languages
welcomeTextsThe welcome texts of the survey in the primary language and any additional languages
endTextsThe end texts of the survey in the primary language and any additional languages
endURLsThe end URLs of the survey in the primary language and any additional languages
endURLdescriptionsThe end URL descriptions of the survey in the primary language and any additional languages
dateformatsThe date formats to use in the primary language and any additional languages; the index of the option from the dropdown in LimeSurvey (6 is the ISO standard, "YYYY-MM-DD").
numberformatsThe number formats to use in the primary language and any additional languages (for periods as decimal marks,
0; for commas as decimal marks,1).sidThe unique survey identifier; if this is free when importing the survey, this will be used.
gsidThe Survey Group identifier.
adminThe name of the survey administrator
adminemailThe email address of the survey administrator
anonymizedWhether the survey uses anonymized responses (
YorN).faxtoThe contents of the "Fax to" field
formatHow to present the survey (
Qfor question by question;Gfor group by group; andAfor all in one).savetimingsWhether to save timings of responses (
YorN).templateThe name of the LimeSurvey theme to use.
languageThe primary language of the survey.
additional_languagesAny additional languages the survey uses.
datestampWhether to datestamp responses (
YorN).usecookieWhether to use cookies to enable answer persistence.
allowregisterWhether to allow public registration (
YorN).allowsaveWhether to allow users to save their responses and returning later (
YorN).autonumber_startWhere to start autonumbering
autoredirectWhether to automatically redirect users to a URL (
YorN).allowprevWhether to allow users to return to previous pages (
YorN).printanswersWhether to allow printing of answer (
YorN).ipaddrWhether to store IP addresses (
YorN).refurlWhether to store the referring URL (
YorN).showsurveypolicynoticeWhether to show the data policy notice (
YorN).publicstatisticsWhether to have public statistics (
YorN).publicgraphsWhether to show graphs in public statistics (
YorN).listpublicWhether to list the survey publicly (
YorN).htmlemailWhether to use HTML format for token emails (
YorN).sendconfirmationWhether to send confirmation emails (
YorN).tokenanswerspersistenceWhether to use token-based response persistence (
YorN).assessmentsWhether to use assessments (
YorN).usecaptchaWhether to use CAPTCHA's (
YorN).usetokensWhether to use tokens (
YorN).bounce_emailWhere bouncing emails should be sent.
emailresponsetoWhere detailed admin notifications emails should be sent.
emailnotificationtoWhere a notification should be sent for new responses.
tokenlengthThe token length.
showxquestionsWhether to show "There are X questions in this survey" (
YorN).showgroupinfoWhether to show group name and info (
Y,N, orXto show nothing).shownoanswerWhether to show the "No answer" option (
YorN).showqnumcodeWhether to show answer codes or numbers (
Y,N, orXto show nothing).bounceprocessingWhether to process bouncing emails? (
YorN).showwelcomeWhether to show the welcome page (
YorN).showprogressWhether to show the progress bar (
YorN).questionindexWhether to show the question index (
0to disable; can also be set to incremental or full (1and2?)).navigationdelayThe navigation delay in seconds
nokeyboardWhether to show the on-screen keyboard (
YorN).alloweditaftercompletionWhether to allow multiple reponses (
N) or to allow updating responses with one token (Y)?googleanalyticsstyleThe google analytics settings;
0for None, other values for other settings.googleanalyticsapikeyThe google analytics API key.
Returns
A new Survey object.
Method add_group()
Add a group to a survey object.
Usage
Survey$add_group(titles, descriptions = "", relevance = 1, random_group = "")
Arguments
titlesThe group's title, either as a named character vector where each element is the group title in a different language, and every element's name is the language code; or as a single character value, in which case the survey's primary language is used.
descriptionsThe group description, either as a named character vector where each element is the group description in a different language, and every element's name is the language code; or as a single character value, in which case the survey's primary language is used.
relevanceThe group's relevance equation.
random_groupThe group's randomization group.
Returns
Invisibly, the Survey object.
Method add_question()
Add a question to a survey object.
Usage
Survey$add_question(groupId, code, type = NULL, lsType = NULL, ...)
Arguments
groupIdThe id of the group to add the question to.
codeThe question code.
typeThe question type.
lsTypeThe question type, as LimeSurvey question type.
...Additional arguments are used to create the Question using
Question$new.
Returns
Invisibly, the Survey object.
Method export_to_tsv()
Export the survey as a tab separated values file (see https://manual.limesurvey.org/Tab_Separated_Value_survey_structure).
Usage
Survey$export_to_tsv(
file,
preventOverwriting = limonaid::opts$get("preventOverwriting"),
parallel = TRUE,
encoding = limonaid::opts$get("encoding"),
silent = limonaid::opts$get("silent"),
backupLanguage = self$language
)Arguments
fileThe filename to which to save the file.
preventOverwritingWhether to prevent overwritting.
parallelWhether to work serially or in parallel.
encodingThe encoding to use
silentWhether to be silent or chatty.
backupLanguageThe language to get content from if not from the primary langage.
Returns
Invisibly, the Survey object.
Method find_group_id()
Find the numeric group identifier by group title.
Usage
Survey$find_group_id(title, titleLanguage = NULL)
Arguments
titleThe survey title.
titleLanguageThe language in which to search.
Returns
Invisibly, the Survey object.
Method clone()
The objects of this class are cloneable with this method.
Usage
Survey$clone(deep = FALSE)
Arguments
deepWhether to make a deep clone.