Create a survey from a description
limesurvey_create_survey_from_specCreate a new survey from a survey description (spec { survey, groups }). The spec is checked first: an invalid spec answers SPEC_INVALID with errors [{ path, message, fix }] and sends nothing to LimeSurvey.
Instructions
Create a new survey from a survey description (spec { survey, groups }). The spec is checked first: an invalid spec answers SPEC_INVALID with errors [{ path, message, fix }] and sends nothing to LimeSurvey. A valid spec becomes a LimeSurvey structure file (.lss) that import_survey imports; the new survey stays inactive and is not activated. The tool then reads the survey back (read methods only) and compares it with the spec. Returns { survey_id, title, languages, groups, questions, active, verification { ok, differences [{ path, expected, actual, and for a subquestion or answer its code and, on scale 1, scale_id }], differences_total, truncated }, truncated }, plus warnings, missing_translations and unreadable (each with a _total) when there are any. A list shows at most 200 entries and is cut further to stay within LIMESURVEY_MAX_RESPONSE_CHARS; the _total fields hold the full numbers and truncated says whether a list was cut. A difference is a finding of the comparison, not an error of the call. If LimeSurvey answers the import with an error, the tool answers CREATE_SURVEY_FAILED with LimeSurvey's message and details.created false (nothing was created). If the import call itself fails (transport or JSON-RPC error, or no survey ID in the answer), details.created is "unknown" with manual_cleanup, the title and a recovery that names limesurvey_find_surveys: look for the survey before calling again. If only the read-back fails, CREATE_SURVEY_FAILED names the created survey_id. The tool takes no file path, adds nothing to existing surveys, activates nothing and deletes nothing. A spec can be checked beforehand with limesurvey_validate_spec; limesurvey_get_survey_spec returns the spec of an existing survey in this format. A text is one string (for every language) or a map per language. A spec with a Ranking question makes the tool read the generation of the instance once (get_group_properties for group 0): on LimeSurvey 7 the entries are written as subquestions of type R (code up to 20 characters, with relevance), on LimeSurvey 6 as answers (code up to 5 characters, no relevance). The second scale of the types 1 (answers) and : and ; (subquestions, the columns) is given with scale_id 1. Needs the write scope content.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| spec | Yes | The survey description. Its fields depend on kind; unknown fields are reported by the check, not rejected. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes | ||
| workflow | Yes |