Skip to content
Snippets Groups Projects
Select Git revision
  • main default protected
1 result

survey-quizgets

  • Clone with SSH
  • Clone with HTTPS
  • Eliott Sammier's avatar
    Eliott Sammier authored
    18ca7610
    History
    Name Last commit Last update
    screenshots
    src
    LICENSE
    README.md

    SurveyJS Quiz Widgets

    A repository of custom SurveyJS widgets used for quizzes.

    Available widgets

    Screenshot of gapfill-select widget

    Screenshot of gapfill-select widget

    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.