-
+
+ -
+ - @author John Molakvoæ
+ -
+ - @license GNU AGPL version 3 or any later version
+ -
+ - This program is free software: you can redistribute it and/or modify
+ - it under the terms of the GNU Affero General Public License as
+ - published by the Free Software Foundation, either version 3 of the
+ - License, or (at your option) any later version.
+ -
+ - This program is distributed in the hope that it will be useful,
+ - but WITHOUT ANY WARRANTY; without even the implied warranty of
+ - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ - GNU Affero General Public License for more details.
+ -
+ - You should have received a copy of the GNU Affero General Public License
+ - along with this program. If not, see .
+ -
+ -->
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/Questions/QuestionMultiple.vue b/src/components/Questions/QuestionMultiple.vue
index 423d682..82cc0f6 100644
--- a/src/components/Questions/QuestionMultiple.vue
+++ b/src/components/Questions/QuestionMultiple.vue
@@ -69,6 +69,7 @@
:answer="answer"
:index="index"
:is-unique="isUnique"
+ :is-dropdown="false"
:max-option-length="maxStringLengths.optionText"
@add="addNewEntry"
@delete="deleteOption"
diff --git a/src/models/AnswerTypes.js b/src/models/AnswerTypes.js
index 999a857..f8b4631 100644
--- a/src/models/AnswerTypes.js
+++ b/src/models/AnswerTypes.js
@@ -20,14 +20,16 @@
*
*/
-import QuestionLong from '../components/Questions/QuestionLong'
-import QuestionShort from '../components/Questions/QuestionShort'
import QuestionMultiple from '../components/Questions/QuestionMultiple'
+import QuestionDropdown from '../components/Questions/QuestionDropdown'
+import QuestionShort from '../components/Questions/QuestionShort'
+import QuestionLong from '../components/Questions/QuestionLong'
/**
* @typedef {Object} AnswerTypes
- * @property {string} multiple_unique
* @property {string} multiple
+ * @property {string} multiple_unique
+ * @property {string} dropdown
* @property {string} short
* @property {string} long
*/
@@ -46,6 +48,16 @@ export default {
* @prop warningInvalid The warning users see in edit mode, if the question is invalid.
*/
+ multiple: {
+ component: QuestionMultiple,
+ icon: 'icon-answer-checkbox',
+ label: t('forms', 'Checkboxes'),
+ validate: question => question.options.length > 0,
+
+ titlePlaceholder: t('forms', 'Checkbox question title'),
+ warningInvalid: t('forms', 'This question needs a title and at least one answer!'),
+ },
+
multiple_unique: {
component: QuestionMultiple,
icon: 'icon-answer-multiple',
@@ -59,13 +71,15 @@ export default {
unique: true,
},
- multiple: {
- component: QuestionMultiple,
- icon: 'icon-answer-checkbox',
- label: t('forms', 'Checkboxes'),
+ dropdown: {
+ component: QuestionDropdown,
+ icon: 'icon-answer-dropdown',
+ label: t('forms', 'Dropdown'),
validate: question => question.options.length > 0,
- titlePlaceholder: t('forms', 'Checkbox question title'),
+ titlePlaceholder: t('forms', 'Dropdown question title'),
+ createPlaceholder: t('forms', 'People can pick one option'),
+ submitPlaceholder: t('forms', 'Pick an option'),
warningInvalid: t('forms', 'This question needs a title and at least one answer!'),
},