Read a survey, group or question as a description
limesurvey_get_survey_specRead a survey, one group or one question as a survey description (spec), with read methods only. With survey_id alone the whole survey is read (level survey); with group_id one group (level group); with question_id one question (level…
Instructions
Read a survey, one group or one question as a survey description (spec), with read methods only. With survey_id alone the whole survey is read (level survey); with group_id one group (level group); with question_id one question (level question); group_id and question_id exclude each other. Returns { level, survey_id, group_id (level group), question_id (level question), languages, active, spec, ids, position, fingerprint, unreadable [{ code, detail }], missing_translations [{ path, language }] }. spec has the format of limesurvey_create_survey_from_spec: level survey { survey, groups }, level group one group, level question one question; every text is a map per language, line breaks are \n and HTML entities are decoded except the markup characters; attribute values equal to the default of the question theme are left out; subquestions and answers come ordered by scale, and scale_id appears only for scale 1 (the columns of : and ;, the second answer scale of 1). spec holds no IDs: ids lists them by path (level survey: groups [{ path, group_id }] and questions [{ path, code, question_id }]; level group: group_id and questions; level question: question_id and group_id) and position gives the 1-based place of a group in the survey or of a question in its group. fingerprint is the SHA-256 of the spec. unreadable lists what RemoteControl cannot read and the spec therefore lacks (conditions of the old condition table, quota members, URL parameter assignments, stored attributes that the type, theme or a plugin does not define, archived response columns, at level survey the survey settings outside the spec, the default of the "Other" option of M and P questions, texts of a question that has no text row in a language); an entry that belongs to an element also has path and language. missing_translations lists the texts that have no row in a survey language, which the map then lacks. The spec can be checked with limesurvey_validate_spec and, at level survey, creates a copy with limesurvey_create_survey_from_spec. The tool never shortens the answer: if it would exceed LIMESURVEY_MAX_RESPONSE_CHARS it answers SPEC_TOO_LARGE with an outline (level survey: group_id, title, questions and estimated_chars per group) so that groups can be read one by one. An ID of another survey answers GROUP_SURVEY_MISMATCH or QUESTION_SURVEY_MISMATCH. The tool changes nothing and needs no write scope.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| group_id | No | Optional ID of a group of this survey: read this group only. | |
| survey_id | Yes | Numeric LimeSurvey survey ID. | |
| question_id | No | Optional ID of a main question of this survey: read this question only. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes | ||
| workflow | Yes |