Skip to content
This repository has been archived by the owner on Sep 21, 2024. It is now read-only.

Question Schemas

Noah Piraino edited this page Dec 12, 2018 · 6 revisions

JScout Questions

Question Templates

The scouting form in the JScout frontend is built dynamically, to allow for easy modification. Each question is based on a core template, which is used to fill in a templated block of HTML for the final page. These core templates can be found at jscout/src/app/question-types/ from the root of the repository, and contain the available properties for each available type of question.

Base Question

class QuestionBase from question-base.ts

The base question class contains properties required for all types of questions, and is not itself an actual question. Each of these proeprties are inherited by all other question types.

Required Properties:

  • key: (string) Specifies the property name to be used in the final JSON formatted submission
  • label: (string) Specifies the name of the field that will appear on the form to the end user/scouter
  • order: (number) Specifies the order in which this question will appear in it's section of questions
    • NOTE: You MUST NOT skip a number for the order proeprties, or the form will not render properly!

Optional Properties:

  • value: Specifies the default value of the question
  • required: (boolean) Specifies whether or not a question is required

Checkbox Question

class CheckboxQuestion from question-checkbox.ts

This class is used for a checkbox. There are no additional properties needed.

Dropdown Question

class DropdownQuestion from question-dropdown.ts

This class is used for dropdown questions (selects).

Required Properties:

  • options: (array) Specifies an array of objects that make up each of the options for the dropdown.

    Required Options Object Properties:

    • value: (string) Specifies the selected value of the option
    • name: (string) Specifies the name of the option in the dropdown

    Optional Options Object Properties:

    • disable: (boolean) Specifies whether or not the option should be disabled

Number Question

class NumberQuestion from question-number.ts

This class is used for number questions.

Optional Properties:

  • min: (number) Specifies the minimum possible value of the question
  • max: (number) Specifies the maximum possible value of the question
  • tickers: (boolean) Specifies whether the question should have the red/green plus and minus buttons on the sides of the input box

Text Question

class TextQuestion from question-text.ts

This class is used for small text questions. There are no additional properties needed.

Textarea Question

class TextareaQuestion from question-textarea.ts

This class is used for large textbox questions (textareas).

Optional Properties:

  • rows: (number) Specifies the number of rows the textarea will have.
    • NOTE: Specifying columns is not supported due to the fixed width nature of the form.

GoScout Schemas

Clone this wiki locally