Mentions légales du service

Skip to content
Snippets Groups Projects
Commit a3ea88e6 authored by VIAUD Nathan's avatar VIAUD Nathan
Browse files

feat: add data injection to custom questions

parent db35e23e
No related branches found
No related tags found
1 merge request!127Resolve "Add values injection to question plugins"
Pipeline #963678 passed
......@@ -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",
......
......@@ -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: [
......
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment