diff --git a/api/app_questionnaires.php b/api/app_questionnaires.php index 0eb139b..0813d4b 100644 --- a/api/app_questionnaires.php +++ b/api/app_questionnaires.php @@ -74,6 +74,7 @@ if ($qnID) { if (isset($config['hint1'])) $q['hint1'] = $config['hint1']; if (isset($config['hint2'])) $q['hint2'] = $config['hint2']; if (isset($config['symptoms'])) $q['symptoms'] = $config['symptoms']; + if (isset($config['scaleType'])) $q['scaleType'] = $config['scaleType']; if (isset($config['range'])) $q['range'] = $config['range']; if (isset($config['constraints'])) $q['constraints'] = $config['constraints']; if (isset($config['precision'])) $q['precision'] = $config['precision']; diff --git a/handlers/app_questionnaires.php b/handlers/app_questionnaires.php index e17e15b..1be6431 100644 --- a/handlers/app_questionnaires.php +++ b/handlers/app_questionnaires.php @@ -265,6 +265,7 @@ if ($qnID) { if (isset($config['hint1'])) $q['hint1'] = $config['hint1']; if (isset($config['hint2'])) $q['hint2'] = $config['hint2']; if (isset($config['symptoms'])) $q['symptoms'] = $config['symptoms']; + if (isset($config['scaleType'])) $q['scaleType'] = $config['scaleType']; if (isset($config['range'])) $q['range'] = $config['range']; if (isset($config['constraints'])) $q['constraints'] = $config['constraints']; if (isset($config['precision'])) $q['precision'] = $config['precision']; diff --git a/import_questionnaires.php b/import_questionnaires.php index a4b4a86..55db515 100644 --- a/import_questionnaires.php +++ b/import_questionnaires.php @@ -83,6 +83,7 @@ try { if (isset($q['hint1'])) $config['hint1'] = $q['hint1']; if (isset($q['hint2'])) $config['hint2'] = $q['hint2']; if (isset($q['symptoms'])) $config['symptoms'] = $q['symptoms']; + if (isset($q['scaleType'])) $config['scaleType'] = $q['scaleType']; if (isset($q['range'])) $config['range'] = $q['range']; if (isset($q['constraints'])) $config['constraints'] = $q['constraints']; if (isset($q['precision'])) $config['precision'] = $q['precision']; @@ -92,7 +93,7 @@ try { if (isset($q['otherNextQuestionId'])) $config['otherNextQuestionId'] = $q['otherNextQuestionId']; if (isset($q['otherOptionKey'])) $config['otherOptionKey'] = $q['otherOptionKey']; if (isset($q['config']) && is_array($q['config'])) { - foreach (['otherNextQuestionId', 'otherOptionKey', 'hint', 'maxLength', 'multiline', 'textKey', 'precision'] as $ck) { + foreach (['otherNextQuestionId', 'otherOptionKey', 'hint', 'maxLength', 'multiline', 'textKey', 'precision', 'scaleType'] as $ck) { if (isset($q['config'][$ck])) { $config[$ck] = $q['config'][$ck]; } diff --git a/website/js/pages/editor.js b/website/js/pages/editor.js index a6ba455..07e3ec1 100644 --- a/website/js/pages/editor.js +++ b/website/js/pages/editor.js @@ -123,13 +123,22 @@ function configFormHTML(layout, config, prefix) { `; break; - case 'glass_scale_question': + case 'glass_scale_question': { + const scaleType = config.scaleType || 'glass'; html = ` +