Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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();
}
};
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');
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);
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);
});
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
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);
});