Skip to content

[QTI] Delay validation messages until the author has engaged with the question #6107

Description

@AlexVelezLl

This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.

Overview

Validation runs on every state change, so a question that has just been created shows its error messages immediately — before the author has had a chance to fill anything in. Validation should keep running as it does; what should change is when its messages are shown. An author should see a message only once they have engaged with the thing it is about, or once they have finished with the question.

Complexity: Medium
Target branch: unstable

Context

Every interaction editor validates on each state change and renders the resulting messages inline — under the question prompt, under an individual answer row, and under the answer list. Because a newly created question is empty, it is also invalid, so the messages are on screen from the moment the card opens.

A question that was saved empty earlier is a different case: its author already had the chance to fill it in, so its messages are not premature.

The Change

Messages should be revealed rather than suppressed — validation still runs, and an author who has engaged with a field still sees what is wrong with it immediately.

For a question created in the current session, each message waits for the author to touch what it is about:

  • "Question is required" appears once the question prompt editor has been blurred.
  • The answer-list messages — "Choose a correct answer" for choice questions, "At least 2 items are required for an ordering question." for ordering — appear once any answer row's editor has been blurred.
  • A row's own messages — the blank and duplicate errors on a choice, an ordering item, or a text entry answer — appear once that row's editor has been blurred.

Closing the question card reveals every message the question has, whether or not anything was touched. Once a message has been revealed it stays revealed while the error lasts.

A question that already existed before the author opened it shows all of its messages from the first render. Only a question created in the current session starts out quiet.

How to Get There

Open a channel for editing and go to /channels/<channel_id>/#/qti-demo. Adding a question exercises the new-question case; the fixture items, which are already saved, exercise the existing-question case.

Acceptance Criteria

  • A question created in the current session shows no validation messages when it opens
  • "Question is required" appears after the question prompt editor is blurred
  • "Choose a correct answer" appears after any answer row's editor is blurred, for choice questions
  • "At least 2 items are required for an ordering question." appears after any item row's editor is blurred
  • A row's blank and duplicate messages appear after that row's own editor is blurred, and not before — for choices, ordering items and text entry answers
  • Blurring one row does not reveal another row's messages
  • Closing the question card reveals every message the question has
  • A message that has been revealed stays revealed while its error lasts
  • A question that existed before the author opened it shows all its messages from the first render
  • Tests cover that a newly created question starts with no messages and that each blur reveals the messages it should

AI usage

I used Claude Code to draft this issue. It read the validation strings and interaction editors to confirm the current messages; I defined the reveal behavior and reviewed every section.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions