diff --git a/js/app/main.js b/js/app/main.js index 9489ba2..d778741 100644 --- a/js/app/main.js +++ b/js/app/main.js @@ -438,6 +438,7 @@ define(['lib/i18n.min!nls/resources.js', 'prepareAppConfigInfo', 'handleUserSign // Provide the i18n strings to the survey survey.flag_important_question = i18n.tooltips.flag_important_question; survey.error_text = i18n.messages.error_text; + survey.domain_error_text = i18n.messages.domain_error_text; diff --git a/js/app/survey.js b/js/app/survey.js index efb7981..fd56f83 100644 --- a/js/app/survey.js +++ b/js/app/survey.js @@ -312,6 +312,22 @@ define([], function () { return surveyQuestions; }, + /** + * Creates a survey form in the specified element. + * @param {object} questionInfo Survey question, which contains question, field, style, domain, important + */ + _checkDomain: function(questionInfo){ + var reqDomain = ["button", "list", "dropdown"]; + if (!isNaN(questionInfo.domain) && (reqDomain.includes(questionInfo.style))){ + return false; + } + else{ + return true; + } + }, + + + /** * Creates a survey form in the specified element. * @param {div} surveyContainer Element containing survey form @@ -323,7 +339,7 @@ define([], function () { _addQuestion: function (surveyContainer, iQuestion, questionInfo, isReadOnly) { var question = survey._startQuestion(iQuestion, questionInfo); //Question Object Needs to exist in order for HTML element to be created - if (questionInfo){ + if (questionInfo && survey._checkDomain(questionInfo)){ //Create parent flags if question type is parent (domain value 0) var primeQFlag = questionInfo.questionType === 0 ? "prime" : " contingent"; primeQFlag = questionInfo.style === "dropdown" ? "primeD" : primeQFlag; @@ -384,17 +400,25 @@ define([], function () { //Check for question info object if (questionInfo){ - // Determine whether to show question on first load. Applies to questions with no parents - var initDisplay = !questionInfo.parent ? "" : " style='display: none;'"; - var start = - "