How to add fields to the enrollment form

Hi @campusedxud Welcome to Open edX!

This topic is a little confusing, because we used to have the ability to add arbitrary fields to the registration form using a custom plugin app. However now, we can only enable a predefined list of optional fields: see REGISTRATION_EXTRA_FIELDS for details. If you want more fields than these, you’ll need to write some code.

But to add the predefined extra fields to the registration form, you just need to change some settings used to run your Open edX application.

  1. Create a small Tutor plugin like this example repo.

  2. Update your custom repo to provide settings like this:

    ENABLE_DYNAMIC_REGISTRATION_FIELDS = True
    # Mark the fields you want to add to be required / optional / optional-exposed
    REGISTRATION_EXTRA_FIELDS = {
        'confirm_email': 'hidden',
        'level_of_education': 'optional',
        'gender': 'optional',
        'year_of_birth': 'optional',
        'mailing_address': 'optional',
        'goals': 'optional',
        'honor_code': 'required',
        'terms_of_service': 'hidden',
        'city': 'hidden',
        'country': 'hidden',
    }