Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13615,8 +13615,14 @@ paths:
**Search the library**. Besides `id`, `type`, `name` and `owner`:

- **survey**: `description`, `intervals` (its Shared Intervals in order), `question_grids`
(`{outcome_id, heading, questions}`), `scoring` (`{questions, verdicts}` when it is scored) and `questions` in
the order the Survey shows them. A question has `question` (its wording), `mandatory` and
(`{outcome_id, heading, questions}`), `scoring` (`{questions, verdicts}` when it is scored), `outcomes` and
`questions` in the order the Survey shows them. `outcomes` lists each Outcome the Survey's
Metrics are in as `{id, name, catch_all, other_metric_count, warning}`: every Project using
the Survey gets all the Metrics in these Outcomes, and `other_metric_count` is how many of
them the Survey doesn't ask about. `warning` is `true` when that is more than 5, or when the
Outcome is a catch-all (an organisation's Becoming Able, Influencing Behaviour or Achieving
Growth, or a person's Not Yet Categorised Outcome) holding any other Metric, so you can show
the same hint as the Survey editor. A question has `question` (its wording), `mandatory` and
`item` (the Metric, List, Field or Activity tracker behind it, with `metric_type`, `unit`
and `choices` where they apply), `by_interval` when it is reworded or hidden in an
Interval, and `display_if` (a list) and `skip_to` when it has those rules (see **Create a
Expand Down Expand Up @@ -14012,6 +14018,11 @@ paths:
yes/no, use a scale Metric on a Yes - No List, not a binary Metric. A Survey can't skip to its
end. Anything else is `422`, naming the question.

**Choosing an Outcome.** Every Project using the Survey gets all the Metrics in its questions'
Outcomes. The response's `outcomes` says how many other Metrics each Outcome adds
(`other_metric_count`) and sets `warning` when that is a lot; create a right-sized Outcome
with `POST /outcomes` rather than using a catch-all.

**Question Grids.** `question_grids: [{outcome_id, questions}]` shows scale questions that
measure one Outcome first and share one List as one table, headed by the Outcome's title.
Every scale question of that Outcome in the Survey must be in the grid, on the same List, and
Expand Down
6 changes: 3 additions & 3 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -2857,7 +2857,7 @@ function buildDocsPage() {
{ name: "item_type", in: "path", type: "string", required: true, desc: "The item's type, as returned by Search the library" },
{ name: "id", in: "path", type: "integer", required: true, desc: "The item's id" }
], [
{ code: "200", cls: "response-2xx", desc: "The item: a Survey's questions in order with the Metric, List or Field behind each, its <code>intervals</code> and any <code>by_interval</code> wording; a Metric's type, default question, Unit, List and Outcomes; a List's choices; a form's fields; a framework's stages; a toolkit's contents" },
{ code: "200", cls: "response-2xx", desc: "The item: a Survey's questions in order with the Metric, List or Field behind each, its <code>intervals</code>, any <code>by_interval</code> wording and its <code>outcomes</code> with how many other Metrics each adds to Projects using it (<code>other_metric_count</code>, <code>warning</code>); a Metric's type, default question, Unit, List and Outcomes; a List's choices; a form's fields; a framework's stages; a toolkit's contents" },
{ code: "404", cls: "response-4xx", desc: "Not found, or not visible to you" },
{ code: "422", cls: "response-4xx", desc: "Unknown <code>item_type</code>" }
])}
Expand Down Expand Up @@ -2963,7 +2963,7 @@ function buildDocsPage() {
{ name: "approved", in: "body", type: "boolean", required: false, desc: "Makerble staff only: show it to every organisation and approve its new Metrics and Lists" },
{ name: "force", in: "body", type: "boolean", required: false, desc: "<code>true</code> to create new items even though near-identical ones exist (see 409)" }
], [
{ code: "201", cls: "response-2xx", desc: "Created: <code>data</code> is the Survey as Get a library item shows it, with its <code>intervals</code> and questions in order (each with any <code>by_interval</code> wording), plus <code>approved</code>" },
{ code: "201", cls: "response-2xx", desc: "Created: <code>data</code> is the Survey as Get a library item shows it, with its <code>intervals</code>, questions in order (each with any <code>by_interval</code> wording) and <code>outcomes</code> (each Outcome's <code>other_metric_count</code> and <code>warning</code>), plus <code>approved</code>" },
{ code: "401", cls: "response-4xx", desc: "Missing or invalid token" },
{ code: "403", cls: "response-4xx", desc: "You may not create Surveys, as in the Makerble app" },
{ code: "404", cls: "response-4xx", desc: "The organisation, or an id in a question, isn't one you can use; the error names the question" },
Expand Down Expand Up @@ -2995,7 +2995,7 @@ function buildDocsPage() {
{ name: "changes", in: "body", type: "array", required: true, desc: "In order, each applied to the questions as the changes before it left them. Each has an <code>action</code>: <code>add</code> (<code>question</code>, optional <code>number</code>), <code>remove</code> (<code>number</code>), <code>replace</code> (<code>number</code>, <code>question</code>) or <code>move</code> (<code>number</code>, <code>to</code>). A <code>question</code> is as in Create a Survey with its questions" },
{ name: "force", in: "body", type: "boolean", required: false, desc: "<code>true</code> to create new items even though near-identical ones exist" }
], [
{ code: "200", cls: "response-2xx", desc: "Changed: <code>data</code> is the Survey as Get a library item shows it, with its questions in their new order" },
{ code: "200", cls: "response-2xx", desc: "Changed: <code>data</code> is the Survey as Get a library item shows it, with its questions in their new order and <code>outcomes</code> saying how many other Metrics each Outcome adds to Projects using it" },
{ code: "401", cls: "response-4xx", desc: "Missing or invalid token" },
{ code: "403", cls: "response-4xx", desc: "You can see it but may not change it, e.g. another organisation's public item" },
{ code: "404", cls: "response-4xx", desc: "Not one you can see" },
Expand Down
Loading