NO PRODUCT SETTINGS FOUND FOR:
documentation

Gentle remainder that the product name comes from the `origin` first subfolder (after `/pms` ).

number_input – PM Fragment Guide

The number_input fragment (f_type: number_) lets you define numeric questions with bounds, step, units, tolerance, and feedback using a YAML block embedded in Markdown. The backend parses it into a number_ fragment; the frontend renders it with a Lit component.

Authoring (YAML)

Use a fenced code block with yaml:

Fields

FieldTypeRequiredDescription
NumberInputPCAstringyesVersion tag (e.g., v0.0.1)
idstringrecommendedUnique identifier
typestringyesMust be number
labelstringrecommendedPrompt shown above input
minnumberoptionalMinimum allowed value
maxnumberoptionalMaximum allowed value
stepnumberoptionalUI increment/decrement step
unitstringoptionalDisplayed next to the input
correctnumberoptionalExpected answer
tolerancenumberoptional± margin around correct
correct_valuesarrayoptionalList of { value, tolerance } accepted ranges
flagnumberoptionali‑radio compatibility (20=correct, 21=wrong, 29=explain)
feedback_correctstringoptionalMessage shown on success
feedback_incorrectstringoptionalMessage shown on failure
hintstringoptionalAlways-visible hint below input

Notes: - Use either correct (+ tolerance) or correct_values. - All numeric values may be integers or floats.

Quick Examples

Integer exact:

Decimal with unit + tolerance:

Multiple acceptable ranges:

Rendering behavior

  • Server parses YAML → number_ fragment.
  • Template renders <pm-number-input> and injects the data.
  • Component shows:
  • A parameter table (id, min, max, step, unit, correct, tolerance, etc.)
  • A numeric input with unit
  • A live value preview (KaTeX font for aesthetic alignment with math)
  • A Check button and feedback region

Styling

The pm-number-input component inherits theme colors from the PM container.

  • Text size: larger (approx. text-lg) for input value
  • Font stack includes KaTeX_Main for a math-friendly look
  • Success/Error colors flow from CSS variables exposed on .pm-container

Relevant CSS (already shipped in @core/css/pm.css):

.fragment-wrapper[data-f_type="number_"] { margin: 1.25rem 0 1.5rem; }
pm-number-input { --ok: var(--pm-ok); --err: var(--pm-err); }

Live Examples

  • PM route: /pm/examples/number_input_example.md?format=html
  • Standalone component demo: /static/js/examples/pm-number-input-example.html

See Also

  • pms/documentation/interactive_fragments_guide.md (section: NumberInputPCA)
  • pms/documentation/fragments_quick_reference.md
  • pms/examples/number_input_example.md
Maths.pm ne collecte aucune donnée.
Aucun cookie collecté, aucune ligne de log d'écrite, pas l'ombre d'une base de données distante - nihil omnino.
Toutes les exécutions de code se font localement. Nous expliquons notre démarche sur cette page.

Limites de confidentialité (impact de l'hébergeur)
Aspects technologiques
Chez Pointcarre.app, nous nous engageons en faveur des communs numériques.

Ressources pédagogiques
Logiciels Libres & Infrastructure 🇫🇷

Codes sources
Logo licence AGPLv3
Contenus
Logo licence Creative Commons

Maths.pm, par

pointcarre.app