You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e684174
Browse filesBrowse the repository at this point in the historyBrowse files
Once a form has a section, every question belongs to one. Questions
before the first section were an untitled lead-in that the editor
could neither frame nor handle like a section.
The editor creates the first section, with "Untitled section" filled
in as its title, when a section is added below existing questions: a
section inserted between questions splits them into two sections, one
appended at the end follows a section holding all questions before it.
The server rejects new, copied and reordered questions that would add
to the questions before the first section, so API clients cannot bring
them back. Deleting the first section moves the next section up to its
place, so its questions join that section; jumps that become backward
by this are removed and reported in X-Forms-Adjusted.
Forms stored with questions before the first section keep them, and
requests that do not add to them keep working.
Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Copy file name to clipboardExpand all lines: docs/API_v3.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,7 +37,7 @@ Some requests succeed with their usual status, and their payload keeps its shape
37
37
38
38
| Key | Value | Set by | Meaning |
39
39
|-----|-------|--------|---------|
40
-
|`removed-jumps`| Inner list of question ids, e.g. `(3 7)`| Updating, reordering and copying questions; deleting options; changing the bounds of a linear scale | Jumps to the question itself or to an earlier question, jumps of the deleted option or of options that are not options of the question, or jumps for values outside the scale, were removed from the `extraSettings` of these questions, see [Jumps](DataStructure.md#jumps)|
40
+
|`removed-jumps`| Inner list of question ids, e.g. `(3 7)`| Updating, reordering and copying questions; deleting the first section of a form; deleting options; changing the bounds of a linear scale | Jumps to the question itself or to an earlier question, jumps of the deleted option or of options that are not options of the question, or jumps for values outside the scale, were removed from the `extraSettings` of these questions, see [Jumps](DataStructure.md#jumps)|
41
41
42
42
```
43
43
X-Forms-Adjusted: removed-jumps=(3 7)
@@ -395,7 +395,7 @@ Returns the questions and options of the given form (without submissions).
395
395
|_subtype_| String | yes |_Optional_ The sub type, stored as `extraSettings.questionType`: the cell type for `grid` (`checkbox`, `number` or `radio`), `rating` (a 1 to N scale drawn as icons) or `promoter` (a fixed 0 to 10 scale) for `linearscale`. Any other value is rejected. |
396
396
|_text_| String | yes |_Optional_ The text of the new question. |
397
397
|_position_| Integer | yes |_(optional)_ 1-based position to insert the new question. When omitted the question is appended at the end. |
398
-
- Restrictions: A `grid` question needs its cell type as _subtype_. A _subtype_ for a question type without sub types is rejected with **400 Bad Request**.
398
+
- Restrictions: A `grid` question needs its cell type as _subtype_. A _subtype_ for a question type without sub types is rejected with **400 Bad Request**. In a form with sections every question is in a section (see [Sections](DataStructure.md#sections)): a question or section that would add to the questions before the first section, for example a section appended below the questions of a form without sections, is rejected with **400 Bad Request** "Every question must be in a section".
399
399
- Response: The new question object.
400
400
401
401
```
@@ -494,7 +494,7 @@ Reorders all Questions of a single form
494
494
| Parameter | Type | Description |
495
495
|-----------|---------|-------------|
496
496
|_newOrder_| Array | Array of **all** Question-IDs, ordered in the desired order |
497
-
- Restrictions: The Array **must** contain all Question-IDs corresponding to the specified form and **must not** contain any duplicates.
497
+
- Restrictions: The Array **must** contain all Question-IDs corresponding to the specified form and **must not** contain any duplicates. An order that puts more questions before the first section than before is rejected with **400 Bad Request** "Every question must be in a section" (see [Sections](DataStructure.md#sections)).
498
498
- Response: Array of questionIDs and their corresponding order. Jumps that would go to the question itself or to an earlier question are removed (see [Jumps](DataStructure.md#jumps)): the questions concerned also carry their new `extraSettings`, and the response header `X-Forms-Adjusted` then lists their ids, e.g. `X-Forms-Adjusted: removed-jumps=(3 7)`, or holds `removed-jumps` alone for more than 100 questions (see [Adjustments by the server](#adjustments-by-the-server)).
499
499
An id of a deleted question gets a **Not Found** response.
500
500
@@ -521,7 +521,7 @@ Reorders all Questions of a single form
521
521
|-----------|---------|-------------|
522
522
|_formId_| Integer | ID of the form containing the question |
523
523
|_questionId_| Integer | ID of the question to delete |
524
-
- Response: **Status-Code OK**, as well as the id of the deleted question.
524
+
- Response: **Status-Code OK**, as well as the id of the deleted question. Deleting the first section moves the next section up to its place, so its questions stay in a section (see [Sections](DataStructure.md#sections)); jumps that become backward by this are removed, and the response header `X-Forms-Adjusted` then lists their questions, e.g. `X-Forms-Adjusted: removed-jumps=(3 7)` (see [Adjustments by the server](#adjustments-by-the-server)).
Copy file name to clipboardExpand all lines: docs/DataStructure.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -242,6 +242,14 @@ Currently supported Question-Types are:
242
242
|`ranking`| Using pre-defined options, the user ranks them from most to least preferred. Needs at least one option available. Answers are stored in ranked order (one answer row per option). |
243
243
|`section`| A structural element to group questions into sections. It cannot be answered and has no options. |
244
244
245
+
### Sections
246
+
247
+
Once a form has a section, every question is in a section: the form starts with a section, and each question belongs to the section before it.
248
+
249
+
- A request that would put more questions before the first section is rejected, see [Create a new question](API_v3.md#create-a-new-question) and [Reorder questions](API_v3.md#reorder-questions). To add the first section below existing questions, first insert a section at position 1, so that it holds them. The editor does this by itself, with the title "Untitled section" filled in; the title can be changed or cleared like any other.
250
+
- Deleting the first section moves the next section up to its place, so the questions of the deleted section join the next section. Deleting any other section lets its questions join the section before it. Deleting the only section leaves a form without sections.
251
+
- A form whose questions were stored before the first section by an earlier version keeps them there, and requests that do not add to them keep working.
252
+
245
253
## Extra Settings
246
254
247
255
Optional extra settings for some [Question Types](#question-types)
@@ -833,9 +836,11 @@ public function updateQuestion(int $formId, int $questionId, array $keyValuePair
833
836
/**
834
837
* Delete a question
835
838
*
839
+
* Deleting the first section moves the next section up to its place, so its questions stay in a section; jumps that become backward are removed, and the header `X-Forms-Adjusted` then holds `removed-jumps` with the ids of their questions
* Move the next section up to the place of a deleted section that was the first section, so the questions of the deleted section join the next section; jumps that become backward are removed
2359
+
*
2360
+
* @param list<Question> $questions the remaining questions of the form in their order
2361
+
* @param int $order the order of the deleted section
2362
+
* @return array{X-Forms-Adjusted?: string, Access-Control-Expose-Headers?: string} the header listing the questions whose jumps were removed
Copy file name to clipboardExpand all lines: openapi.json
+13-1Lines changed: 13 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -2622,7 +2622,7 @@
2622
2622
"delete": {
2623
2623
"operationId": "api-delete-question",
2624
2624
"summary": "Delete a question",
2625
-
"description": "This endpoint allows CORS requests",
2625
+
"description": "Deleting the first section moves the next section up to its place, so its questions stay in a section; jumps that become backward are removed, and the header `X-Forms-Adjusted` then holds `removed-jumps` with the ids of their questions\nThis endpoint allows CORS requests",
0 commit comments