diff --git a/package-lock.json b/package-lock.json index 08f636772b025fa42a92667dd4f23cd8c520e9db..7570a3f901c775ab72732679d407c1f35f2522f8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -287,9 +287,9 @@ } }, "node_modules/@epoc/epoc-types": { - "version": "2.0.0-beta.10", - "resolved": "https://registry.npmjs.org/@epoc/epoc-types/-/epoc-types-2.0.0-beta.10.tgz", - "integrity": "sha512-KpVnk9w8llcrZb+mZbvAaHxeVDcxM0A8/FrSsORfYb/Fl6eDUWDuZ8Qy7s2Dsn54/9DRGoYAN4ozPBiAMzrgBw==" + "version": "2.0.0-beta.11", + "resolved": "https://registry.npmjs.org/@epoc/epoc-types/-/epoc-types-2.0.0-beta.11.tgz", + "integrity": "sha512-6T0vSUhCRaT9nx2FD8dOYdLDSihjpEucjKZ1mmV6IcTcyEBwD20P+xJhAV707qz0IKnyHpKs5DD+3lv6AFEerQ==" }, "node_modules/@esbuild/android-arm": { "version": "0.17.19", @@ -13427,9 +13427,9 @@ } }, "@epoc/epoc-types": { - "version": "2.0.0-beta.10", - "resolved": "https://registry.npmjs.org/@epoc/epoc-types/-/epoc-types-2.0.0-beta.10.tgz", - "integrity": "sha512-KpVnk9w8llcrZb+mZbvAaHxeVDcxM0A8/FrSsORfYb/Fl6eDUWDuZ8Qy7s2Dsn54/9DRGoYAN4ozPBiAMzrgBw==" + "version": "2.0.0-beta.11", + "resolved": "https://registry.npmjs.org/@epoc/epoc-types/-/epoc-types-2.0.0-beta.11.tgz", + "integrity": "sha512-6T0vSUhCRaT9nx2FD8dOYdLDSihjpEucjKZ1mmV6IcTcyEBwD20P+xJhAV707qz0IKnyHpKs5DD+3lv6AFEerQ==" }, "@esbuild/android-arm": { "version": "0.17.19", diff --git a/src/shared/data/forms/questionsForm.data.ts b/src/shared/data/forms/questionsForm.data.ts index 6d9bc1acb651146418ee74bd31363a5f31e5689c..b1c8f8d922bb91c87762a0e597b14f403f3e0bf6 100644 --- a/src/shared/data/forms/questionsForm.data.ts +++ b/src/shared/data/forms/questionsForm.data.ts @@ -527,6 +527,33 @@ export const customQuestionForm: Form = { } ] }, + { + name: 'Données', + inputs: [ + { + type: 'repeat', + id: 'data', + label: 'Données', + value: [], + inputs: [ + { + id: 'key', + type: 'text', + label: 'Clé', + placeholder: 'Clé', + value: '' + }, + { + id: 'value', + type: 'textarea', + label: 'Valeur', + placeholder: 'Valeur', + value: '' + } + ] + } + ] + }, { name: 'Réponse', inputs: [ diff --git a/src/shared/services/graph.service.ts b/src/shared/services/graph.service.ts index 295feb208e009e62e768a8c26ed8c02288b10be4..9a12bb7cbd32af1bf3f534599da04d793b2b33e3 100644 --- a/src/shared/services/graph.service.ts +++ b/src/shared/services/graph.service.ts @@ -11,7 +11,7 @@ import { SimpleQuestion, uid, Video, -} from '@epoc/epoc-types/src/v1'; +} from '@epoc/epoc-types/dist/v1'; import { questions } from '@/src/shared/data'; import { useEditorStore } from '@/src/shared/stores'; import { @@ -269,6 +269,10 @@ function newQuestion(epoc: EpocV1, questionNode: any): string { if(questionNode.formType === 'custom') { (question as CustomQuestion).template = template; + (question as CustomQuestion).data = {}; + for(const value of questionNode.formValues.data) { + (question as CustomQuestion).data[value.key] = value.value; + } } return epoc.addQuestion(questionNode.contentId, question);