eduNEXT / eox-hooks

GNU Affero General Public License v3.0
3 stars 0 forks source link

feat: add action that creates enrollments for course programs #19

Closed mariajgrimaldi closed 3 years ago

mariajgrimaldi commented 3 years ago

Description

This PR adds a new action that can be executed after the user's enrollment in a course, triggered by the post_enrollment signal. When executed, enrolls the user in a list of courses defined in the course advanced settings.

How to test

Course configuration In your course advanced settings*, add:

    "EDNX_TRIGGER_FOLLOWUP_ENROLLMENTS": [
        {
            "course_id": "course-v1:Demo+CSTest+2020",  
            "mode": "honor"
        }
    ]  # List of enrollment information used after the main enrollment 

To enable course advanced settings, turn on this feature: cms/envs/common.py 'ENABLE_OTHER_COURSE_SETTINGS': True,

Microsite configuration In your microsite settings:

"EOX_HOOKS_DEFINITIONS": {
        "post_enrollment": {
            "action": "trigger_enrollments_creation",
            "fail_silently": false,
            "module": "eox_hooks.actions"
        }
    },
   "USE_EOX_HOOKS": true,

Supporting information

https://edunext.atlassian.net/browse/PS2021-916?atlOrigin=eyJpIjoiMTFlNTdiN2JmYmVjNDZjMWE2MTk2MjBiNzFjNzMxNTQiLCJwIjoiaiJ9