ls_add_participants | R Documentation |
The function takes a tibble
(or any object that is internally represented
as a (named) list
by R
) of participant(s) data and adds them to the
LimeSurvey participant database of the selected survey.
ls_add_participants(survey_id, part_data, create_token = TRUE)
survey_id |
integer, ID of the survey (as found with |
part_data |
tibble / data.frame / list, object with participant(s)
data, i.e., |
create_token |
logical, whether to create token outright. Defaults to
|
Generally, your part_data
object have to contain three variables:
firstname
, lastname
, and email
. That is something like a bare minimum,
but you may add any attribute recognized by LimeSurvey – even custom
attributes like attribute_1
or so. For the human-readable list of custom
attributes being held in the LimeSurvey participant database of the selected
survey, use ls_get_attrs()
. However, do not use the "semantic" form, as
ls_add_participants()
recognizes only raw, i.e. attribute_1
notation.
Called for a side effect, but returns the inserted data including additional new information like the token string.
Other LimeSurvey functions:
ls_call()
,
ls_export()
,
ls_get_attrs()
,
ls_invite()
,
ls_login()
,
ls_participants()
,
ls_responses()
,
ls_set_participant_properties()
,
ls_surveys()
## Not run:
# create participant table
part_data <- tibble(
firstname = "John",
lastname = "Doe",
email = "john@example.com",
language = "cs",
attribute_1 = "Example School"
)
# insert participant into the LimeSurvey database
ls_add_participants(123456, part_data)
# check if OK
ls_participants(123456)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.