-
Notifications
You must be signed in to change notification settings - Fork 1
Question Schemas
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.
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
class CheckboxQuestion
from question-checkbox.ts
This class is used for a checkbox. There are no additional properties needed.
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
-
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
class TextQuestion
from question-text.ts
This class is used for small text questions. There are no additional properties needed.
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.
Thanks for using the StrangeScout system! Remember that under the GNU AGPL license of this project, users are required to make source code available to modified versions they host on the net, so make sure you're forks are set to public and you're good to go! Of course, contributions to upstream are always welcome!
StrangeScout is brought to you by the members of FRC Team #1533 at ECG Robotics, Inc, a 501(c)(3) nonprofit organization. Consider donating to us if this software helps your team succeed!