Skip to content
Snippets Groups Projects
Select Git revision
1 result Searching

VideoViewer.js

Blame
  • index.js 913 B
    import {json} from "./json.js"
    import {gapfillSelectWidget} from "./gapfill-select.js";
    
    window.addEventListener('load', main)
    
    function main() {
        // Register our custom question types
        Survey.CustomWidgetCollection.Instance.add(gapfillSelectWidget, gapfillSelectWidget.name);
    
        let survey = new Survey.Model(json);
    
        // Add "Check answers" button
        survey.addNavigationItem({
            id: "sv-nav-check",
            title: "Check",
            action: () => {
                survey.currentPage.questions.forEach((question) => {
                    console.log("%o: correct = %o\n\tvalue         = %o\n\tcorrectAnswer = %o", question.name, question.isAnswerCorrect(), question.value, question.correctAnswer);
                });
            },
            css: "nav-button",
            innerCss: "sd-btn sd-btn--action nav-input"
        });
    
        // Inflate the survey in the page
        $("#surveyContainer").Survey({model: survey});
    }