Questionnaire Creation Process

Administrators can upload questions in the admin panel using a YAML file (.yml or .yaml) and download existing questions in YAML format.

For more details about the manifest schema, see Manifest JSON Schema.

How It Works

  1. File Parsing: The upload handler reads the YAML file, which lists questions and their associated fields, such as question text, type, and any additional properties.

  2. Versioning: Each file must include a version number indicating which questionnaire version the questions come from.

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

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

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

  6. Feedback: The upload handler provides feedback in the admin interface to inform the administrator about the updates and newly created questions, making it clear which changes were applied.

Expected Input Format

The uploaded YAML file 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: "authors"
        question: "Add Contributor"
        type: "authors"
        required: false
        manifest_section: "context"
        manifest_properties:
          fields: ["first_name", "last_name", "affiliation", "orcid"]

      - name: "license"
        question: "What license is associated with the RDMC?"
        required: true
        type: "dropdown"
        options: [ "MIT License", "Apache License 2.0", "Creative Commons Attribution 4.0 International", "BSD 3-Clause", "Proprietary", "Other" ]
        manifest_properties: "license"
        manifest_section: "legal"

      - name: "keywords"
        question: "Enter the relevant keywords for the RDMC (Add one by one)"
        required: false
        type: "text"
        manifest_properties: "keywords"
        manifest_section: "context"

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

The YAML file should contain the following fields:

  • version: Version number of the questionnaire.

    Inside the questions list:
    • 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 to which this question belongs.

Outputs and Messages

After processing, the upload handler 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.