-
-
-
-
-
diff --git a/src/mixins/QuestionMixin.js b/src/mixins/QuestionMixin.js
new file mode 100644
index 0000000..ded955a
--- /dev/null
+++ b/src/mixins/QuestionMixin.js
@@ -0,0 +1,54 @@
+/**
+ * @copyright Copyright (c) 2020 John Molakvoæ
+ *
+ * @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 .
+ */
+import Question from '../components/Questions/Question'
+
+export default {
+ inheritAttrs: false,
+ props: {
+ title: {
+ type: String,
+ required: true,
+ },
+ values: {
+ type: Array,
+ required: true,
+ },
+ },
+
+ components: {
+ Question,
+ },
+
+ data() {
+ return {
+ edit: false,
+ }
+ },
+
+ methods: {
+ onTitleChange(title) {
+ this.$emit('update:title', title)
+ },
+ onValuesChange(values) {
+ this.$emit('update:values', values)
+ },
+ },
+}
diff --git a/src/models/AnswerTypes.js b/src/models/AnswerTypes.js
index cdfdb06..9d356de 100644
--- a/src/models/AnswerTypes.js
+++ b/src/models/AnswerTypes.js
@@ -24,7 +24,7 @@ export default [
{
label: t('forms', 'Multiple choice'),
value: 'radiogroup',
- icon: 'icon-forms',
+ icon: 'icon-answer-multiple',
},
{
label: t('forms', 'Checkboxes'),
diff --git a/src/utils/GenRandomId.js b/src/utils/GenRandomId.js
new file mode 100644
index 0000000..aa0d6fc
--- /dev/null
+++ b/src/utils/GenRandomId.js
@@ -0,0 +1,31 @@
+
+/**
+ * @copyright Copyright (c) 2018 John Molakvoæ
+ *
+ * @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 .
+ *
+ */
+
+const GenRandomId = (length) => {
+ return Math.random()
+ .toString(36)
+ .replace(/[^a-z]+/g, '')
+ .substr(0, length || 5)
+}
+
+export default GenRandomId
diff --git a/src/views/Create.vue b/src/views/Create.vue
index dd2cf60..9f27cf2 100644
--- a/src/views/Create.vue
+++ b/src/views/Create.vue
@@ -3,6 +3,7 @@
-
- @author René Gieling
- @author Nick Gallo
+ - @author John Molakvoæ
-
- @license GNU AGPL version 3 or any later version
-
@@ -33,7 +34,9 @@
{{ t('forms', 'Show results') }}
-