Adding a new question type
- 1.
- 2.
- 3.
- 1.Implement a
MyTypeValidationPredicates
class onMyTypeQuestionDefinition
- 2.
- 1.
- 2.
- 3.Add a new
MyTypeQuestionRenderer
that uses j2Html to render the question. SeeTextQuestionRenderer
for an example - 4.
- 5.Check for validation errors and display them
- 1.Update
MyTypeQuestion
to check for errors - 2.Add field errors to
MyTypeQuestionRenderer
- 1.
- 2.
- 1.Update
QuestionConfig
to handle the new type. If the new question type has custom validation or configuration options, add logic for rendering those inputs here.
- 1.Add unit tests for the new types
- 2.Run the app locally and test the following:
- 1.Admin flow
- 1.Can you add a new question of this type?
- 2.Can you edit the question?
- 3.Does the icon look as intended?
- 2.Applicant flow
- 1.Can you fill out the question?
- 2.Do error messages render correctly
- 3.Add a helper function in the browser tests for the new question type:
admin_question.ts
andapplicant_questions.ts
- 4.
Last modified 8mo ago