Skip to main content

Number Question

A number question component.

Options#

  • question | (string|node): number question. Default: ''.
  • hintPlacement | string: placement of the hints (either top, left, right, or bottom). Default: 'top'.
  • hints | array<(string|node)>: hints providing guidance on how to answer the question. Default: [].
  • feedback | boolean: controls whether to display feedback buttons. Default: true.
  • solution | (number|array<number>): a numeric answer to the problem (or multiple correct answers if an array is supplied). Default: none.
  • digits | number: number of digits for which the answer supplied by the student must match the solution to be considered correct. Set to 0 to match as an integer. If set to null it will search for an exact match.. Default: 3.
  • max | number: maximum allowed input value. Default: null.
  • min | number: minimum allowed input value. Default: null.
  • defaultValue | number: pre-selected value of number input. Default: 0.
  • provideFeedback | boolean: indicates whether feedback including the correct answer should be displayed after learners submit their answers. Default: true.
  • nTries | number: after how many tries feedback should be supplied (if provideFeedback is true). Default: 1.
  • disableSubmitNotification | boolean: controls whether to disable submission notifications. Default: false.
  • chat | boolean: controls whether the element should have an integrated chat. Default: false.
  • until | Date: time until students should be allowed to submit answers. Default: none.
  • points | number: maximum number of points awarded in grading. Default: 10.
  • style | object: CSS inline styles. Default: {}.
  • onChange | function: callback which is triggered after the value of the number field changes; receives the current value as its sole argument. Default: onChange() {}.
  • onSubmit | function: callback invoked when answer is submitted; has as first parameter a boolean indicating whether the answer was correctly answered (if applicable, null otherwise) and the supplied answer as the second parameter. Default: onSubmit() {}.

Examples#

Live Editor
Result
Last updated on by Planeshifter