ls_add_participants: Add Participant(s) to the Survey

View source: R/limesurvey.R

ls_add_participantsR Documentation

Add Participant(s) to the Survey

Description

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.

Usage

ls_add_participants(survey_id, part_data, create_token = TRUE)

Arguments

survey_id

integer, ID of the survey (as found with ls_surveys, e.g.).

part_data

tibble / data.frame / list, object with participant(s) data, i.e., firstname, lastname, email etc.

create_token

logical, whether to create token outright. Defaults to TRUE).

Details

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.

Value

Called for a side effect, but returns the inserted data including additional new information like the token string.

See Also

Other LimeSurvey functions: ls_call(), ls_export(), ls_get_attrs(), ls_invite(), ls_login(), ls_participants(), ls_responses(), ls_set_participant_properties(), ls_surveys()

Examples

## 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)


scholaempirica/reschola documentation built on Oct. 16, 2024, 6:43 a.m.