SurveyJS Quiz Widgets
A repository of custom SurveyJS widgets used for quizzes.
Available widgets
Usage
Each widget is its standalone file in src/widgets
, as a
JavaScript module.
You can simply add it to your source files and import
the widget object :
import {gapfillSelectWidget} from "./widgets/gapfill-select.js";
(If you don't want to use JS modules, you can also remove the export
keywords
and use it as a classic script file)
Then, before loading your survey's model, register the widget into SurveyJS's custom widgets collection :
Survey.CustomWidgetCollection.Instance.add(gapfillSelectWidget, gapfillSelectWidget.name);
And voilà! You have a new question type, which can be used in your survey's JSON model just like a built-in type.
The rest of the src
directory is a simple example of how to use these widgets.
For more info on custom widgets, see the SurveyJS documentation.