Loading editor/html/js/survey-manager.js +11 −1 Changes for editor/html/js/survey-manager.js: 11 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -52,6 +52,7 @@ var SurveyManager = (function() { question_type: n.getAttribute('type') || 'text', label: n.getAttribute('label') || '', order_idx: parseInt(n.getAttribute('order_idx') || '0', 10), required: n.getAttribute('required') === 'true', options: opts, accept_types: n.getAttribute('accept') || '', max_file_size_mb: maxsizeAttr ? Math.round(parseInt(maxsizeAttr, 10) / 104857.6) / 10 : 5, Loading @@ -68,7 +69,8 @@ var SurveyManager = (function() { + ' parent_id="' + escAttr(q.parent_id || '') + '"' + ' type="' + escAttr(q.question_type) + '"' + ' label="' + escAttr(q.label) + '"' + ' order_idx="' + (q.order_idx || 0) + '"'; + ' order_idx="' + (q.order_idx || 0) + '"' + ' required="' + (q.required ? 'true' : 'false') + '"'; if (q.question_type === 'image') { if (q.accept_types) attrs += ' accept="' + escAttr(q.accept_types) + '"'; if (q.max_file_size_mb) attrs += ' maxsize="' + Math.round(q.max_file_size_mb * 1048576) + '"'; Loading Loading @@ -403,6 +405,12 @@ var SurveyManager = (function() { }); addField('Typ', selType); var inpRequired = document.createElement('input'); inpRequired.type = 'checkbox'; inpRequired.id = 'sm-q-required'; inpRequired.checked = !!q.required; addField('Pflichtfeld', inpRequired); // Options (for radio/checkbox/select) var optsWrap = document.createElement('div'); optsWrap.id = 'sm-q-opts-wrap'; Loading Loading @@ -687,6 +695,7 @@ var SurveyManager = (function() { question_type: 'text', label: 'Neue Frage', order_idx: (_current.questions || []).length, required: false, options: [] }; if (!_current.questions) _current.questions = []; Loading Loading @@ -737,6 +746,7 @@ var SurveyManager = (function() { var q = _editingQ; q.label = label; q.question_type = type; q.required = el('sm-q-required').checked; q.options = options; if (type === 'image') { Loading editor/src/webedit_api.cpp +2 −1 Changes for editor/src/webedit_api.cpp: 2 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -5318,6 +5318,7 @@ json_object* webedit::Api::surveyXmlToJson(const std::string &name, const char *qid = qEl->Attribute("id"); const char *qtype = qEl->Attribute("type"); const char *qlabel = qEl->Attribute("label"); const char *qreq = qEl->Attribute("required"); int qorder = orderIdx; qEl->QueryIntAttribute("order_idx", &qorder); Loading @@ -5325,7 +5326,7 @@ json_object* webedit::Api::surveyXmlToJson(const std::string &name, json_object_object_add(jq, "id", json_object_new_string(qid ? qid : "")); json_object_object_add(jq, "type", json_object_new_string(qtype ? qtype : "text")); json_object_object_add(jq, "text", json_object_new_string(qlabel ? qlabel : "")); json_object_object_add(jq, "required", json_object_new_boolean(false)); json_object_object_add(jq, "required", json_object_new_boolean(qreq && std::string(qreq) == "true")); json_object_object_add(jq, "order", json_object_new_int(qorder)); json_object *jopts = json_object_new_array(); Loading Loading
editor/html/js/survey-manager.js +11 −1 Changes for editor/html/js/survey-manager.js: 11 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -52,6 +52,7 @@ var SurveyManager = (function() { question_type: n.getAttribute('type') || 'text', label: n.getAttribute('label') || '', order_idx: parseInt(n.getAttribute('order_idx') || '0', 10), required: n.getAttribute('required') === 'true', options: opts, accept_types: n.getAttribute('accept') || '', max_file_size_mb: maxsizeAttr ? Math.round(parseInt(maxsizeAttr, 10) / 104857.6) / 10 : 5, Loading @@ -68,7 +69,8 @@ var SurveyManager = (function() { + ' parent_id="' + escAttr(q.parent_id || '') + '"' + ' type="' + escAttr(q.question_type) + '"' + ' label="' + escAttr(q.label) + '"' + ' order_idx="' + (q.order_idx || 0) + '"'; + ' order_idx="' + (q.order_idx || 0) + '"' + ' required="' + (q.required ? 'true' : 'false') + '"'; if (q.question_type === 'image') { if (q.accept_types) attrs += ' accept="' + escAttr(q.accept_types) + '"'; if (q.max_file_size_mb) attrs += ' maxsize="' + Math.round(q.max_file_size_mb * 1048576) + '"'; Loading Loading @@ -403,6 +405,12 @@ var SurveyManager = (function() { }); addField('Typ', selType); var inpRequired = document.createElement('input'); inpRequired.type = 'checkbox'; inpRequired.id = 'sm-q-required'; inpRequired.checked = !!q.required; addField('Pflichtfeld', inpRequired); // Options (for radio/checkbox/select) var optsWrap = document.createElement('div'); optsWrap.id = 'sm-q-opts-wrap'; Loading Loading @@ -687,6 +695,7 @@ var SurveyManager = (function() { question_type: 'text', label: 'Neue Frage', order_idx: (_current.questions || []).length, required: false, options: [] }; if (!_current.questions) _current.questions = []; Loading Loading @@ -737,6 +746,7 @@ var SurveyManager = (function() { var q = _editingQ; q.label = label; q.question_type = type; q.required = el('sm-q-required').checked; q.options = options; if (type === 'image') { Loading
editor/src/webedit_api.cpp +2 −1 Changes for editor/src/webedit_api.cpp: 2 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -5318,6 +5318,7 @@ json_object* webedit::Api::surveyXmlToJson(const std::string &name, const char *qid = qEl->Attribute("id"); const char *qtype = qEl->Attribute("type"); const char *qlabel = qEl->Attribute("label"); const char *qreq = qEl->Attribute("required"); int qorder = orderIdx; qEl->QueryIntAttribute("order_idx", &qorder); Loading @@ -5325,7 +5326,7 @@ json_object* webedit::Api::surveyXmlToJson(const std::string &name, json_object_object_add(jq, "id", json_object_new_string(qid ? qid : "")); json_object_object_add(jq, "type", json_object_new_string(qtype ? qtype : "text")); json_object_object_add(jq, "text", json_object_new_string(qlabel ? qlabel : "")); json_object_object_add(jq, "required", json_object_new_boolean(false)); json_object_object_add(jq, "required", json_object_new_boolean(qreq && std::string(qreq) == "true")); json_object_object_add(jq, "order", json_object_new_int(qorder)); json_object *jopts = json_object_new_array(); Loading