saveParticipant: Saves information about a single participant.

View source: R/saveParticipant.R

saveParticipantR Documentation

Saves information about a single participant.

Description

This function allows the participant attributes and the ID of a given participant to be updated.

Usage

saveParticipant(labbcat.url, id, label = id, attributes = NULL)

Arguments

labbcat.url

URL to the LaBB-CAT instance

id

The participant ID - either the unique internal database ID, or their name.

label

The new ID (name) for the participant

attributes

A named list of participant attribute values - the names are the participant attribute layer IDs, and the values are the corresponding new attribute values. The pass phrase for participant access can also be set by specifying a "_password" attribute.

Details

To change the ID of an existing participant, pass the old/current ID as the id, and pass the new ID as the label.

If the participant ID does not already exist in the database, a new participant record is created.

Value

TRUE if the participant's record was updated, FALSE if there were no changes detected.

See Also

getParticipant

deleteParticipant

Examples

## Not run: 
## define the LaBB-CAT URL
labbcat.url <- "https://labbcat.canterbury.ac.nz/demo/"

## Create a new participant record
saveParticipant(labbcat.url, "Juan Perez", attributes=list(participant_gender="M"))

## Change the name and the gender of the participant record
saveParticipant(labbcat.url, "Juan Perez", "Maria Perez", list(participant_gender="F"))

### Delete the participant we just created
deleteParticipant(labbcat.url, "Maria Perez")

## End(Not run)


nzilbb.labbcat documentation built on July 26, 2023, 6:08 p.m.