User:Andreyf/work/documentation/flat survey

This section describes the markup used to describe flattened surveys.

Overview
This markup supports three kinds of questions: simple questions, which have radio buttons or check boxes next to answers, grid questions, which have radio buttons grouped horizontally providing responses, and open-ended questions, which let the user provide their own answer text, as either a line or a paragraph.

A simple question begins with a title line, followed by the response lines, followed by an empty line.

Grid questions begin with a title line, followed by response lines, an empty line, and specially named simple questions, which are interpreted as lines in the grid.

Open-ended questions use the `_' character to represent text boxes.

The Title Line
Each question begins with a title line. This is a line beginning with an alphanumeric string, or the question identifier, followed by a period, then a space, and the text of the quote.

In other words, matching the regex expression.

Example:

Response lines
The responses are represented differently in simple questions than they are in grid questions.

Simple questions
In simple questions, the title line is followed by several response lines, which specify what the responses to the question are going to be. These are lines which start with an alphanumeric string, or the response identifier, followed by a separating character: either a `]' or a `)' , followed by a space, and the response text . The question may or may not end with an `_' character to signify a text box for a custom response.

In other words, matching the regex expression.

All response lines belonging to a question must have the same separating character: `]' and `)' specify check boxes or radio buttons as answers, respectively.

Example:

Grid questions
Grid questions have no single answer. Instead, each row of the grid is treated as a separate consecutive question. The grid question's responses must have a `)' as the separating character, and will be interpreted to be the vertical columns of the grid. The relation between the questions that forms a grid is defined by a schema of the question identifiers. If the grid question identifier ends with a number, the rows questions must have identifiers which are named

a, b, c, etc.

If it ends with a letter, the rows questions must have identifiers which are named

1, 2, 3, etc.

The questions themselves can have any responses, as they will be ignored. It's good style to keep them same as the grid question's responses.