Skip to content

Feature Request: Sync questionnaire answers with user profile fields (prefill + save)Β #636

@Raza403

Description

@Raza403

We'd like to propose an enhancement to the Questionnaire plugin that enables two-way integration between questionnaire responses and user profile fields:


βœ… Use case

In many organizations and educational contexts, questionnaires are used to collect user information that is already stored---or should be stored---in the user's profile. For example:

  • Job title

  • License or registration number

  • Department or employer

  • Country or region

  • Consent or eligibility-related fields

This leads to duplication of effort and introduces the risk of inconsistent data between the questionnaire and the user's Moodle profile.


βœ… Proposed enhancement

We'd like to introduce a new configuration option for each question in the questionnaire, allowing the question to be associated with a specific user profile field (standard or custom). This enables two key features:

1. Prefill answers from user profile fields

When a user opens the questionnaire, any question that is mapped to a user profile field should be pre-filled with the value from that field (if available).

  • Users can still modify the answer before submitting the form.

  • This reduces friction and avoids repetitive data entry.

2. Save answers to user profile fields after submission

When the questionnaire is submitted, answers for mapped questions should update the corresponding user profile fields.

  • If the field is empty, it should be filled.

  • If the field has data, it can optionally be updated (this behavior could be configurable).

  • This ensures that profile data stays up-to-date and consistent with recent questionnaire responses.


βœ… Additional notes

  • Mapping should be possible for both core and custom profile fields.

  • The feature could be enabled per questionnaire or per question for flexibility.

  • If either the prefill or save option is undesirable for a specific question, admins/teachers can simply leave the mapping blank.

  • A log or admin notification could be considered for changes to profile fields for auditing purposes.


πŸ’¬ Call for interest

Would this feature be useful to others in the community?
We're happy to collaborate on design or testing. If anyone has already implemented something similar or is interested in co-developing this, we'd love to connect.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions