Skip to contents

Reads the survey object's questions and returns one row per data column the export would produce, carrying the item wording and the coded response options – the same shape as the other parse_codebook() back-ends, so the rows join the codebook / scale pipeline unchanged. The group column holds each question's DataExportTag stem, a high-confidence scale-block signal.

Usage

parse_qsf(path)

Arguments

path

path to a .qsf file

Value

a data.frame of variable definitions (codebook_variable, label, codebook_source, group, value_labels, missing_values, question, parse_method), or NULL when the file is not a parseable QSF or yields no questions.

Details

Column-name reconstruction: simple questions use the DataExportTag; matrix and multi-answer questions expand to <DataExportTag>_<choiceCode> (honouring ChoiceDataExportTags when present). For a matrix (Likert) question the Choices are the items (one column each) and the Answers are the shared response scale points (the value labels); for single/multiple choice the Choices are themselves the value labels.

Examples

# a minimal Qualtrics survey file with one question
qsf <- tempfile(fileext = ".qsf")
writeLines('{"SurveyEntry": {"SurveyName": "Demo"}, "SurveyElements": [{"Element": "SQ",
  "PrimaryAttribute": "QID1", "Payload": {"QuestionText": "How old are you?",
  "DataExportTag": "age", "QuestionType": "TE", "QuestionID": "QID1"}}]}', qsf)
parse_qsf(qsf)
#>   codebook_variable            label      codebook_source group value_labels
#> 1               age How old are you? file1b581a51a6ca.qsf  <NA>         <NA>
#>   missing_values         question coding_instructions scale_group parse_method
#> 1           <NA> How old are you?                <NA>         age          qsf