LINCnil / pia

Version web front office de l’application PIA à déployer sur un serveur afin d’en donner l’accès via un navigateur web | Front office of the PIA application to be deployed on a server in order to access it through a web browser.
GNU General Public License v3.0
263 stars 271 forks source link

Edit existing questions #771

Open voxan-dev opened 1 month ago

voxan-dev commented 1 month ago

Votre demande est-elle liée à un problème rencontré ? Si oui, décrivez-le. / Is your feature request related to a problem? Please describe. Donner une description claire et concise du problème. Ex. Je suis toujours frustré lorsque [...] / A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

I want to create a full new base of questions. Actually some questions are fixed to a section and cant be deleted or changed. Even the hints are not editable.

Décrivez la solution que vous aimeriez / Describe the solution you'd like Donner une description claire et concise de ce que vous aimeriez voir se produire. / A clear and concise description of what you want to happen.

I want to delete (or change) every question and their hints. I want also to add new hints.

kevin-atnos commented 1 month ago

Hello,

You can create a "PIA template" to add new questions (+ their hints) to the sections and sub-sections you which, and then assign to your PIA this template so that you can answer to these new questions during the editing process.

image

image

image

image

But you can't change the default questions (the ones integrated by default on each section/sub-section). You can't change their hints either.

Have a good day!

Kevin

voxan-dev commented 1 month ago

Hi Kevin, thanks for your reply. I found a way to change them and their placeholders. I can change the json structure and reimport the new structure. But with that a few more questions came up. Maybe u can answer them?

f.e. this is the first question in the first section. i can edit the title, which is the shown question, and the placeholder. works fine.

{
                                    "id": 111,
                                    "title": "sections.1.items.1.questions.1.title",
                                    "link_knowledge_base": [
                                        "PIA_LGL_DESC",
                                        "PIA_DEF_FIN",
                                        "PIA_CUSTOM_11"
                                    ],
                                    "placeholder": "sections.1.items.1.questions.1.placeholder",
                                    "answer_type": "text",
                                    "answer": "",
                                    "active": true
                                },

But i also want to edit links to the knowledgebase, because we want to create our own knowledgebase and use it. How can i get the key to the correkt knowledgebase entry? I cant export the CNIL knowledgebase, so i cant get a look to the structure. if i look at my own knowledgebase, i dont find a similar entry.


            "items": [
                11,
                12
            ],
            "name": "Berechtigtes Interesse",
            "description": "Im Unterschied zum Zweck ist das Interesse der Nutzen oder das Bestreben des Verantwortlichen.\nZu den möglichen berechtigten Interessen zählen folgende Interessen:\n-\trechtliche: z.B. Geltendmachung, Ausübung oder Verteidigung von Rechtsansprüchen\n-\ttatsächliche: Gesundheit der Mitarbeiter\n-\twirtschaftliche: z.B. Direktwerbung\n-\tideelle: Nachhaltigkeit, Spendenaufrufe\n",
            "slug": "berechtigtes-interesse",
            "category": "knowledge_base.category.definition",
            "filters": "measure.definition",
            "created_at": "2024-10-31T12:24:53.602Z",
            "updated_at": "2024-10-31T12:24:53.602Z",
            "knowledge_base_id": 1,
            "id": 2
        },```

I am also interested, if there are more answer types than "text" and "gauge".

If this is the wrong place, i would be happy about a proper way to ask them.

Have a nice day.
kevin-atnos commented 4 weeks ago

Hello,

Indeed, you can try to customize the pia.json file manually to change titles and related placeholders, then import it as you are doing. But you will have issues with knowledge base links, as you state here.


I don't think you will be able to directly customize the official integrated CNIL knowledge base, as it it working differently and also related to some code directly inside the project. You might be able to do something, you could theorically fork the pia project and also fork pia-i18n project and then directly customize the code from both projects, but it might takes more time and more technical knowledge.

See:


An easier approach would be to create a custom knowledge base and then assign it to your customized PIA.

I would try something like this:

  1. Export and customize your PIA with the pia.json file

  2. Create a custom knowledge base with different customized entries Example: image image

  3. Import pour customized PIA and assign your customized knowledge base to it (in the right section of the page) Example: image

This way you will see your customized entries from your customized knowledge base, on your customized PIA. Once the custom knowledge base is selected, it will keep it (on the same desktop / browser), so you don't have to select it each time.


I can't see any other solution for now. Either you use a custom knowledge base, or you fork the projects and directly adapt the code and then run your own "version" of the PIA tool.


About the answer types, there are 3 of them:


I hope this can help.

Regards,

Kevin