How to change the "Support education research..." fields of the registration page?

I successfully followed the steps from this thread:

and installed the plugin from here:

But that ultimately just adds new fields which are mandatory. I’d like to

  1. Change the wording of “Support education research by providing additional information” (to something more like “Help us provide better education by telling us about yourself”.)
  2. Change the optional fields that are shown when someone clicks that “Support education research by providing additional information” area, to remove the request for address (I don’t want people’s home addresses in my data!) and add other fields like “age” instead of “date of birth” (which is too invasive.)
  3. Make a “nationality” pull down menu where I let them select from a list of countries, rather than taking freeform text input.

Any pointers to how those things can be done? There doesn’t seem like there would be anything Tutor-specific about this, which is why I’m asking about it on these forums rather than those. The OpenCraft example is kind of too complicated for me to understand unfortunately.

1 Like

Hey @knoise,

I have not experimented with tutor but on the docker devstack and also on normal installation these requirements you mentioned can be achieved.

We can do this by making a custom theme and overriding the register.underscore file and you can put any custom messages you want to put there.

You can hide the fields that you don’t want by editing the configuration in your lms.yml.

REGISTRATION_EXTRA_FIELDS:
        city: hidden
        confirm_email: hidden
        country: required
        gender: optional
        goals: optional
        honor_code: required
        level_of_education: optional
        mailing_address: hidden
        terms_of_service: hidden
        year_of_birth: optional

You can make any field required/optional/hidden as per your convenience. For adding new field you need to use custom-registration-form.

You can first try to install and use custom-form-app and then you can start changing the field to age and area.

Hope this answer helps you. Let me know how it went.

OK, I ended up having to ask about how to get the syntax right for REGISTRATION_EXTRA_FIELDS over on the Tutor forums… (How to change the “Support education research…” fields of the registration page? - Tutor - Overhang.IO)

But for the custom registration form options, and making the Nationality a pull down form, there’s no current examples in there that can be easily edited.

I tried to make a simple gender selector form by editing the template like:

GENDER_CHOICES = [
(‘MALE’, ‘Male’),
(‘FEMALE’, ‘Female’),
(‘OTHER’, ‘Other’),
]

operations = [
    migrations.CreateModel(
        name='ExtraInfo',
        fields=[
                     ('gender', models.CharField(verbose_name="Gender", max_length=6, choices=GENDER_CHOICES)),

cut

Based on the TITLE_CHOICES example here:
https://docs.djangoproject.com/en/3.2/topics/forms/modelforms/

But that field just straight up didn’t show up. Any thoughts on what I’m doing wrong? I have no idea what I’m doing for django forms unfortunately.

Hi @knoise
The new Gender selector field is not getting displayed because ‘gender’ is already present in the registration extra fields. It should work if you make new ‘gender’ selector field as ‘gender2’ or something like that.

I tried changing it to gender2 and rebuilding everything everywhere but it still doesn’t show up

And actually just now when I was doing “tutor local quickstart” I got the following error related to presumably the gender2 entry, so I had to comment it back out

Traceback (most recent call last):
File “./manage.py”, line 123, in
execute_from_command_line([sys.argv[0]] + django_args)
File “/openedx/venv/lib/python3.8/site-packages/django/core/management/init.py”, line 381, in execute_from_command_line
utility.execute()
File “/openedx/venv/lib/python3.8/site-packages/django/core/management/init.py”, line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File “/openedx/venv/lib/python3.8/site-packages/django/core/management/base.py”, line 323, in run_from_argv
self.execute(*args, **cmd_options)
File “/openedx/venv/lib/python3.8/site-packages/django/core/management/base.py”, line 364, in execute
output = self.handle(*args, **options)
File “/openedx/venv/lib/python3.8/site-packages/django/core/management/base.py”, line 83, in wrapped
res = handle_func(*args, **kwargs)
File “/openedx/venv/lib/python3.8/site-packages/django/core/management/commands/migrate.py”, line 87, in handle
executor = MigrationExecutor(connection, self.migration_progress_callback)
File “/openedx/venv/lib/python3.8/site-packages/django/db/migrations/executor.py”, line 18, in init
self.loader = MigrationLoader(self.connection)
File “/openedx/venv/lib/python3.8/site-packages/django/db/migrations/loader.py”, line 49, in init
self.build_graph()
File “/openedx/venv/lib/python3.8/site-packages/django/db/migrations/loader.py”, line 206, in build_graph
self.load_disk()
File “/openedx/venv/lib/python3.8/site-packages/django/db/migrations/loader.py”, line 108, in load_disk
migration_module = import_module(migration_path)
File “/opt/pyenv/versions/3.8.6/lib/python3.8/importlib/init.py”, line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1014, in _gcd_import
File “”, line 991, in _find_and_load
File “”, line 975, in _find_and_load_unlocked
File “”, line 671, in _load_unlocked
File “”, line 779, in exec_module
File “”, line 916, in get_code
File “”, line 846, in source_to_code
File “”, line 219, in _call_with_frames_removed
File “/openedx/requirements/custom-form-app/custom_reg_form/migrations/0001_initial.py”, line 34
operations = [
^