Question type

textAnnotation

Respondents highlight individual words in a passage of text using a small toolbar of annotation modes. Useful for copy testing, message diagnostics, sentiment-on-passage analysis, and "where-do-they-stop-reading" research.

What textAnnotation is

textAnnotation shows the respondent a passage of text and a small toolbar of annotation modes. The respondent picks a mode (e.g. Positive / Neutral / Negative), then clicks or drags across words to mark them. Each tagged word stores a sentiment value — +1 / 0 / -1 for the standard sentiment codes, or a custom slot integer for non-sentiment codes — and the runtime keeps a companion list visible alongside.

There’s a single canonical style: highlight.

Word codes and storage are handled for you. The runtime gives each word in the passage an internal ID (w1, w2, …) automatically. You don’t have to label words ahead of time, paste in any per-word codes, or set up the storage shape yourself. Just write the passage: as ordinary text — the rest is automatic.
QAdCopy textAnnotation · highlight

Highlight words that stand out — positive or negative — and tell us what jumps out.

We've designed the new model to be the most rewarding, most intuitive, most refined experience we've ever made.

From its all-day battery to its silent operation, every detail rewards your attention and earns its place.

PositiveNeutralNegative Click to annotate · drag for a range
13 words highlighted

The toolbar shows three sentiment modes, Positive is active, the passage has a few words tinted green (positive) and grey (neutral). Click a mode, click or drag across words; the legend strip and counter update as you go.

Properties

PropertyValuesNotes
qidstringRequired. Unique within the survey.
typetextAnnotationRequired.
title, text, instructionrenderableVisible content.
requiredTrue | FalseDefault True.
default.errorsTrue | False | custom stringDefault True.
validationcode blockPython; call fail() to reject.
readonlyTrue | FalseDefault False.
visibilityshow | hideDefault show.
stylehighlightDefault and only canonical style.
passageblock-scalar textRequired. The text the respondent reads and annotates. Multi-paragraph supported via blank lines.
annotationsinline coded listRequired. Defines the annotation modes shown in the toolbar — one button per entry.
minintegerMinimum total words highlighted before Next is enabled.
maxintegerMaximum words highlighted.
exactintegerExact word count required.
ifexpressionVisibility / activation condition.
Forbidden on textAnnotation: options, options.from, group, group.order, scale, scale.from, decimal, decimal.places, label.prefix, label.suffix, input.source, input.size.

Per-annotation entry properties

annotations: entries carry these per-mode properties.

PropertyNotes
labelRequired when expanding the entry to a map. The label shows on the toolbar button.
dataOptional metadata object — not shown to the respondent, attached to the annotation in storage.

Sentiment-aware codes and stored values

The renderer recognises a few annotation codes as sentiment hints and colours them accordingly. The respondent’s tag for each word stores as an integer:

CodeColourStored value
pos / positiveGreen+1
neu / neutralGrey0
neg / negativeRed-1

Other codes get numbered slot styling (slot 2, 3, 4, …) and their stored values are integers ≥ 2. The slot integers skip 1, which is reserved for pos. This means mixing custom codes with pos in the same toolbar is fine — the storage values stay distinct.

If a neu / neutral annotation exists, it becomes the toolbar’s default-active mode; otherwise the first entry is the default.

Examples

Simple sentiment highlighting

- qid: QAdCopy
    type: textAnnotation
    text: Highlight words that stand out — positive or negative — and tell us what jumps out.
    passage: |
        We've designed the new model to be the most rewarding,
        most intuitive, most refined experience we've ever made.

        From its all-day battery to its silent operation, every
        detail rewards your attention and earns its place.
    annotations:
        pos: Positive
        neu: Neutral
        neg: Negative
    min: 3

A toolbar with three buttons. The neu entry is auto-selected on load. The respondent picks a mode, then clicks or drags across words. min: 3 enforces at least three words highlighted before Next.

Storage shape — wordId → sentiment value:

{
  "words": {
    "w7":  1,
    "w8":  1,
    "w9":  1,
    "w24": 1,
    "w34": 0,
    "w35": 0
  }
}

w7 etc. are word identifiers (counted from the start of the passage). The values are the sentiment integers: +1 for Positive words, 0 for Neutral, -1 for Negative. The same value scheme is used by imageAnnotation’s emoji style — sentiment storage stays consistent across question types.

Beyond sentiment — labelled themes

- qid: QMessage
    type: textAnnotation
    text: Highlight the parts of this email that drove your decision.
    passage: |
        We've reviewed your request and we're pleased to confirm
        your renewal at the standard rate. Your benefits remain
        unchanged, and we'll bill you on the 15th of next month.

        If anything looks off, reply to this message and our
        support team will respond within 24 hours.
    annotations:
        clear: Clear
        unclear: Unclear
        important: Important
        boilerplate: Boilerplate

Four custom labels. None of the codes match the sentiment shortcuts, so each gets a numbered-slot colour and a slot integer for storage (2, 3, 4, 5 — 1 stays reserved for pos). The first entry (clear) is the toolbar’s default-active mode since there’s no neu / neutral.

Word-count constraints

- qid: QExcerpt
    type: textAnnotation
    text: Pick the 5 most important words in this passage.
    passage: |
        Long-form passage of text here...
    annotations:
        important: Important
    exact: 5

exact: 5 forces precisely five words highlighted — useful for forced-choice exercises.

Methods & accessors

ExpressionReturnsMeaning
Q.answeredboolTrue once at least one word is annotated.
Q.notAnsweredboolInverse.
Q.reset()—Clear all word annotations.

The full word map is stored in the runtime answer state but isn’t surfaced through canonical question-level accessors — analysis happens downstream from the export.

Export

textAnnotation exports the word map under the qid as a JSON column or, in long format, as one row per highlighted word with word_id, word_text, and the sentiment value (+1 / 0 / -1) or custom slot integer. Long-format export is preferred for analysis tools that aggregate words by mode (e.g. count of positive words, ratio of positive to negative, frequency map).

See Long format for the export shape.

See also