| Movements |
This page regroups all rules, guidelines and behaviors related to an entity's movement.
Currently the main entities with complex and specific movement rules are Questions and Elements.
Questions Movement
Questions are one of the core entity of a survey, and thus have multiple rules and guidelines defining their behavior.
These rules can be separated in different categories depending on the action executed.
Page related rules
- All questions can be merged but loops have special rules.
- Merge with the previous sibling question when created between two questions of the same page otherwise make it single page.
- Moving questions should retain merged questions as much as possible.
- When moving one question without any children between two merged questions, merge it with its previous sibling question in list-view.
-
When moving multiple questions between two merged questions, try to retain their page structure by default.
If specified otherwise merge all of them with the previous sibling question in list-view.
- When removing a question, apply page logic.
Indent and Unindent
- Only consider the topmost parent even if children are selected.
- Indent consecutive siblings questions only if the first selected question has a previous sibling in tree-view.
- Append consecutive siblings questions to the previous sibling of the first selected question in tree-view during indent.
- No page logic applies during indent.
- Unindent consecutive siblings questions only if the first selected question has a parent in tree-view.
- Insert questions after the parent question of the first selected one during unindent.
- Apply page logic during unindent.
Direct movement
- Only consider the topmost parent even if children are selected.
- Make moved questions siblings.
- When inserted before or after a question, insert selected questions as sibling of the targeted question.
- When inserted before or after a question, apply page logic.
- When over a question, append selected questions to the targeted question.
- When over a question, apply page logic.
Loops special cases
- If there is nothing to display at loop level, it is automatically merged down to it's first visible child.
- Nothing to display at loop level means that either the the loop itself is not visible or if it is a grid.
Elements Movements
The general idea of element movements is to keep the hierarchy of questions related elements unchanged while allowing to to add custom Container elements nearly everywhere.
It must then be possible to move those Container elements freely and also move other elements freely relatively to those custom Container elements.
Every element type has a different set of rules associated to its movement.
Page
- Page elements cannot be moved.
- Page elements cannot have siblings.
MergingPage
- MergingPage elements cannot be moved.
- MergingPage elements cannot have siblings.
Question
- Question elements must stay within the same Page or MergingPage element they are in (whether as a direct or indirect child).
- They can only be moved into a Container element or back to their original Page or MergingPage element (the one sharing the same QuestionId) as a direct child.
- Its position can be swapped with potential sibling Container elements.
Caption
- Caption elements cannot have children.
- Caption elements must stay within the same Question element they are created in (whether as a direct or indirect child).
- They can only be moved into a Container element or back to their original Question element (the one sharing the same QuestionId) as a direct child.
- Its position can be swapped with its sibling elements.
Control
- Control elements cannot have children.
- Control elements must stay within the same Question element they are created in (whether as a direct or indirect child).
- They can only be moved into a Container element or back to their original Question element (the one sharing the same QuestionId) as a direct child.
- Its position can be swapped with its sibling elements.
Container
- Container elements must be within a Page or MergingPage element (wether as a direct or indirect child).
-
If a Container element has children, a movement is only allowed if it does not break the movement rules of its children
(e.g if a Container element has a Control element as its child it cannot be moved outside of the Question element containing that Control element).