How to add learners as Honor mode by default

By default learners are added as audit and certificate is not available for audit mode…
I would like to add learners as honor mode by default or any other way to change user to Honor mode??
Add learners as Honor Mode while adding from bash
tutor local createuser xxx xxx…

1 Like

We got it done by following this guide https://discuss.openedx.org/t/how-to-convert-all-the-enrollments-from-audit-to-professional/1127

I am just getting my head around using the plugins to make changes to the config files. I created plugin today to set the default enrollment to honor, following the docs https://docs.tutor.overhang.io/plugins/gettingstarted.html#yaml-file and using the config variables recommended by @tuananh-pham.

If the plugin directory does not exist make it

$ mkdir “$(tutor plugins printroot)”

Create your .yml plugin

$ vim set_default_enrollement.yml

With the following content

name: set_default_enrollment
version: 0.1.0
patches:
 lms-env: |
  "COURSE_MODE_DEFAULTS": {
    "name": "Honor",
    "slug": "honor",
    "bulk_sku": null,
    "currency": "eur",
    "description": null,
    "expiration_datetime": null,
    "min_price": 0,
    "sku": null,
    "suggested_prices": ""
  }

Check your plugin is in the list

$ tutor plugins list

Enable the plugin

$ tutor plugins enable set_default_enrollment
$ tutor config save

Restart your platform

$ tutor local quickstart

or just the lms

$ tutor local exec lms reload-gunicorn

1 Like

@dancasey @regis do we know if this should still work in Koa? I did all these steps using exactly the above values.

tutor@ip-123-123-123-123:~$ mkdir .local/share/tutor-plugins
tutor@ip-123-123-123-123:~$ nano $(tutor plugins printroot)/set_default_enrollement.yml
tutor@ip-123-123-123-123:~$ tutor plugins list
discovery==11.0.0
ecommerce==11.0.0
license==11.0.0 (disabled)
minio==11.0.0 (disabled)
notes==11.0.0
xqueue==11.0.0 (disabled)
set_default_enrollment==0.1.0 (disabled)
tutor@ip-123-123-123-123:~$ tutor plugins enable set_default_enrollment
Plugin set_default_enrollment enabled
Configuration saved to /home/tutor/.local/share/tutor/config.yml
You should now re-generate your environment with `tutor config save`.
tutor@ip-123-123-123-123:~$ tutor config save
Configuration saved to /home/tutor/.local/share/tutor/config.yml
Environment generated in /home/tutor/.local/share/tutor/env
tutor@ip-123-123-123-123:~$ tutor local quickstart
SNIP
tutor@ip-123-123-123-123:~$ grep -ir COURSE_MODE_DEFAULTS $(tutor config printroot)/env/apps/openedx/settings/tutor@ip-123-123-123-123:~$ grep -ir set_default_enrollment $(tutor config printroot)/env/apps/openedx/settings/

But when “tutor local quickstart” finished, I didn’t see any relevant grep hits in my configuration, despite it saying the above plugin was enabled.

tutor plugins list
discovery==11.0.0
ecommerce==11.0.0
license==11.0.0 (disabled)
minio==11.0.0 (disabled)
notes==11.0.0
xqueue==11.0.0 (disabled)
set_default_enrollment==0.1.0

tutor@ip-123-123-123-123:~$ grep -ir COURSE_MODE_DEFAULTS $(tutor config printroot)/env/apps/openedx/settings/
tutor@ip-123-123-123-123:~$ grep -ir set_default_enrollment $(tutor config printroot)/env/apps/openedx/settings/
tutor@ip-123-123-123-123:~$

The “lms-env” patch affects the values from the lms.env.json template, in apps/openedx/config. (not in …/settings) What is the output of the following command:

grep -ir COURSE_MODE_DEFAULTS "$(tutor config printroot)/env/apps/openedx/config/"
1 Like

That does have a grep hit:
/home/tutor/.local/share/tutor/env/apps/openedx/config/lms.env.json: “COURSE_MODE_DEFAULTS”: {

So I force-unenrolled and force-enrolled two test accounts, and it looks like they did indeed show up as honor-mode enrollment. Thanks!

1 Like