Questionnaire Creation Process

Admin can upload questions in the admin panel through a yml or yaml file. Also download the existing questions to a yml or yaml file format.

For more details about schema of manifest, go to the Schema and about database of manifest, go to the Database.

How It Works

  1. File Parsing: The function takes in a YAML file, which lists questions and their associated fields, such as question text, type, and any additional properties.

  2. Versioning*: For each file there must be a version and it indicates that from which version the question comes.

  3. Dynamic Comparison: For each question in the YAML file, the function first checks if it already exists in the database. If it does, the function compares each field (like the question text or type) to determine if an update is needed.

  4. Field-by-Field Updates: Using a dynamic approach, the function reviews each relevant field to spot changes. If any differences are found, it updates the existing question with new information from the YAML file.

  5. New Question Creation: If a question in the YAML file does not exist in the database, the function automatically creates it with all the specified fields.

  6. Feedback: The function provides feedback in the admin interface to inform the user about the updates and new questions created, making it clear what changes were applied.

Expected Input Format

The YAML file uploaded should follow a specific structure to ensure that each question is processed correctly. Here is an example of the expected format:

version: "1.0.1"
questions:
    - name: "owner"
      question: "Who is the legal owner (institution or individual) of the RDMC?"
      required: true
      type: "text"
      manifest_properties: "legal_ownership"
      manifest_section: "context"
    - name: "sensitive_data"
      question: "Does the RDMC contain any sensitive or personal data?"
      required: false
      type: "radio"
      manifest_properties: "data_protection"
      manifest_section: "security"

To download the example question.yaml file, click the link below:

Each question should contain the following fields:

  • version: Version number of the questionnaires.

    Inside the questions:
    • name: A unique identifier for the question.

    • question: The text of the question as it should appear in the system.

    • required: Specifies if answering the question is mandatory.

    • type: The type of input expected (e.g., text, multiple choice).

    • manifest_properties: Relevant properties associated with the question.

    • manifest_section: The section in which this question belongs.

Outputs and Messages

After processing, the function provides feedback to the administrator on the results. Possible outputs include:

  • Updated Questions: If any existing questions were modified, a list of changes is shown, specifying which fields were updated.

  • New Questions: Any questions newly created from the YAML file are listed.