How to use survey-jquery - 6 common examples

To help you get started, we’ve selected a few survey-jquery examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github scify / Crowdsourcing-Platform / resources / assets / js / pages / myQuestionnaireResponses.js View on Github external
let showResponse = function(instance, responseId) {
        let response = getResponseById(instance.responses, responseId);
        if(response) {
            console.log(response);
            instance.responseModal.find("#questionnaireResponse").html("");
            instance.responseModal.find("#questionnaireTitle").html(response.title);
            let survey = new Survey.Model(JSON.parse(response.questionnaire_json));
            survey.data = JSON.parse(response.response_json);
            survey.mode = 'display';
            instance.responseModal.find("#questionnaireResponse").Survey({model: survey});
            instance.responseModal.modal();
        }
    };
github scify / Crowdsourcing-Platform / resources / assets / js / pages / landingPage.js View on Github external
Survey
                .JsonObject
                .metaData
                .addProperty("questionbase", "qnum");

            let json = wrapper.data('content');
            json.questionTitleTemplate = "{qnum}. {title}";
            json.requiredText = "(*)";
            json.showQuestionNumbers = "off";

            json.pages.forEach(function (page) {
                page.elements = setQuestionNumbers(page.elements);
            });

            survey = new Survey.Model(json);
            survey
                .onComplete
                .add(function (result) {
                    $(".loader-wrapper").removeClass('hidden');
                    $("#questionnaire-modal").modal('hide');
                    let button = $('.respond-questionnaire').first();
                    let response = JSON.stringify(result.data);
                    let questionnaire_id = button.data('questionnaire-id');
                    let url = button.data('url');
                    const selectedLanguageCode = $('#questionnaire-lang-selector').val();
                    $.ajax({
                        method: 'post',
                        data: {questionnaire_id, response, selectedLanguageCode},
                        url: url,
                        success: function (response) {
                            $(".loader-wrapper").addClass('hidden');
github scify / Crowdsourcing-Platform / resources / assets / js / pages / landingPage.js View on Github external
let displayQuestionnaire = function () {
        let wrapperId = 'questionnaire-display-section';
        let wrapper = $('#' + wrapperId);
        if (wrapper.length > 0) {

            Survey.StylesManager.applyTheme("darkblue");
            Survey.surveyStrings.emptySurvey = "There is not currently an active survey.";
            Survey.surveyStrings.loadingSurvey = "Please wait. The survey is loading…";

            Survey
                .JsonObject
                .metaData
                .addProperty("questionbase", "qnum");

            let json = wrapper.data('content');
            json.questionTitleTemplate = "{qnum}. {title}";
            json.requiredText = "(*)";
            json.showQuestionNumbers = "off";

            json.pages.forEach(function (page) {
                page.elements = setQuestionNumbers(page.elements);
            });

            survey = new Survey.Model(json);
github scify / Crowdsourcing-Platform / resources / assets / js / pages / landingPage.js View on Github external
let displayQuestionnaire = function () {
        let wrapperId = 'questionnaire-display-section';
        let wrapper = $('#' + wrapperId);
        if (wrapper.length > 0) {

            Survey.StylesManager.applyTheme("darkblue");
            Survey.surveyStrings.emptySurvey = "There is not currently an active survey.";
            Survey.surveyStrings.loadingSurvey = "Please wait. The survey is loading…";

            Survey
                .JsonObject
                .metaData
                .addProperty("questionbase", "qnum");

            let json = wrapper.data('content');
            json.questionTitleTemplate = "{qnum}. {title}";
            json.requiredText = "(*)";
            json.showQuestionNumbers = "off";

            json.pages.forEach(function (page) {
                page.elements = setQuestionNumbers(page.elements);
            });
github scify / Crowdsourcing-Platform / resources / assets / js / pages / landingPage.js View on Github external
let displayQuestionnaire = function () {
        let wrapperId = 'questionnaire-display-section';
        let wrapper = $('#' + wrapperId);
        if (wrapper.length > 0) {

            Survey.StylesManager.applyTheme("darkblue");
            Survey.surveyStrings.emptySurvey = "There is not currently an active survey.";
            Survey.surveyStrings.loadingSurvey = "Please wait. The survey is loading…";

            Survey
                .JsonObject
                .metaData
                .addProperty("questionbase", "qnum");

            let json = wrapper.data('content');
            json.questionTitleTemplate = "{qnum}. {title}";
            json.requiredText = "(*)";
            json.showQuestionNumbers = "off";

            json.pages.forEach(function (page) {
                page.elements = setQuestionNumbers(page.elements);
            });

            survey = new Survey.Model(json);
            survey
                .onComplete
github scify / Crowdsourcing-Platform / resources / assets / js / pages / landingPage.js View on Github external
let displayQuestionnaire = function () {
        let wrapperId = 'questionnaire-display-section';
        let wrapper = $('#' + wrapperId);
        if (wrapper.length > 0) {

            Survey.StylesManager.applyTheme("darkblue");
            Survey.surveyStrings.emptySurvey = "There is not currently an active survey.";
            Survey.surveyStrings.loadingSurvey = "Please wait. The survey is loading…";

            Survey
                .JsonObject
                .metaData
                .addProperty("questionbase", "qnum");

            let json = wrapper.data('content');
            json.questionTitleTemplate = "{qnum}. {title}";
            json.requiredText = "(*)";
            json.showQuestionNumbers = "off";

            json.pages.forEach(function (page) {
                page.elements = setQuestionNumbers(page.elements);
            });

survey-jquery

survey.js is a JavaScript Survey Library. It is a modern way to add a survey to your website. It uses JSON for survey metadata and results.

MIT
Latest version published 5 days ago

Package Health Score

95 / 100
Full package analysis