How to add fields to the enrollment form

Hi @campusedxud , I’d recommend that you:

  1. Read the Tutor plugin tutorial: Creating a Tutor plugin — Tutor documentation
  2. Create a new tutor plugin using GitHub - overhangio/cookiecutter-tutor-plugin: Cookiecutter for tutor plugins
  3. Add a file to your repo under tutor-<your-plugin>/patches/ called common-env-features, which contains the following content:
    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',
    }
    
  4. Install your plugin to your Tutor’s requirements by installing it in tutor’s virtual environment:
    (tutor) $> pip install git+https://github.com/<your-plugin>
    
  5. Check that your plugin is listed when you run:
    (tutor) $> tutor plugins list
    
  6. Enable your plugin
    (tutor) $> tutor plugin enable <yourplugin>
    
1 Like