Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

Is it possible to create custom question types? If so, is there a recommended way to add a custom question type when using this package for individual projects?

For example if I wanted to included a drag and drop sortable question in my project, is it possible to extend the base question type component and create a new question component which can then be added to QuestionType object to then use in the FlowForm?

You must be logged in to vote

This would currently be only possible by using the source from GitHub and modifying it to suit your needs. You'd need to create your new question component by extending QuestionTypes/BaseType.vue and adding your new question type to the QuestionType object (in QuestionModel.js). Just be careful to implement/extend any necessary methods to make sure your answers are saved and validated. We're also planning to make and document an official way to do this in the future.

Replies: 1 comment · 1 reply

Comment options

This would currently be only possible by using the source from GitHub and modifying it to suit your needs. You'd need to create your new question component by extending QuestionTypes/BaseType.vue and adding your new question type to the QuestionType object (in QuestionModel.js). Just be careful to implement/extend any necessary methods to make sure your answers are saved and validated. We're also planning to make and document an official way to do this in the future.

You must be logged in to vote
1 reply
@coxlr
Comment options

Thanks! I tried out this method over the weekend and was able to successfully add and use a new question type.
When you mention you are planning to make and document an official way to do this in the future, do you mean you plan to make a way to do this when using it as an included package instead of using it from the source? I noticed there is a stale branch 'experimental/custom-question-type' would it be something similar to that?
Thanks again!

Answer selected by spinn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.