Skip to main content

EoxHooks

Project description

Eox-hooks (A.K.A. Edunext Open extensions) is an openedx plugin, for the edx-platform that allows extending edx-platform through Django configurations and Open edX Events.

Compatibility Notes

Open edX Release

Version

Juniper

<= 1.0

Koa

> 1.0

Lilac

> 1.0 < 2.0

Maple

>= 2.0 < 3.0

Nutmeg

>= 3.0

Olive

>= 4.0

Palm

>= 5.0

Quince

>= 6.0

Redwood

>= 6.3.0

The following changes to the plugin settings are necessary. If the release you are looking for is not listed, then the accumulation of changes from previous releases is enough.

Juniper

EOX_HOOKS_ENROLLMENTS_BACKEND: "eox_hooks.edxapp_wrapper.backends.enrollments_l_v1"
EOX_HOOKS_COURSES_BACKEND: "eox_hooks.edxapp_wrapper.backends.courses_l_v1"
EOX_HOOKS_COURSE_MODES_BACKEND: "eox_hooks.edxapp_wrapper.backends.course_modes_l_v1"
EOX_HOOKS_MODELS_BACKEND: "eox_hooks.edxapp_wrapper.backends.models_l_v1"

Koa

EOX_HOOKS_ENROLLMENTS_BACKEND: "eox_hooks.edxapp_wrapper.backends.enrollments_l_v1"
EOX_HOOKS_COURSES_BACKEND: "eox_hooks.edxapp_wrapper.backends.courses_l_v1"
EOX_HOOKS_COURSE_MODES_BACKEND: "eox_hooks.edxapp_wrapper.backends.course_modes_l_v1"
EOX_HOOKS_MODELS_BACKEND: "eox_hooks.edxapp_wrapper.backends.models_l_v1"

Lilac

EOX_HOOKS_ENROLLMENTS_BACKEND: "eox_hooks.edxapp_wrapper.backends.enrollments_l_v1"
EOX_HOOKS_COURSES_BACKEND: "eox_hooks.edxapp_wrapper.backends.courses_l_v1"
EOX_HOOKS_COURSE_MODES_BACKEND: "eox_hooks.edxapp_wrapper.backends.course_modes_l_v1"
EOX_HOOKS_MODELS_BACKEND: "eox_hooks.edxapp_wrapper.backends.models_l_v1"

Maple

EOX_HOOKS_ENROLLMENTS_BACKEND: "eox_hooks.edxapp_wrapper.backends.enrollments_l_v1"
EOX_HOOKS_COURSES_BACKEND: "eox_hooks.edxapp_wrapper.backends.courses_l_v1"
EOX_HOOKS_COURSE_MODES_BACKEND: "eox_hooks.edxapp_wrapper.backends.course_modes_l_v1"
EOX_HOOKS_MODELS_BACKEND: "eox_hooks.edxapp_wrapper.backends.models_l_v1"

Nutmeg

EOX_HOOKS_ENROLLMENTS_BACKEND: "eox_hooks.edxapp_wrapper.backends.enrollments_l_v1"
EOX_HOOKS_COURSES_BACKEND: "eox_hooks.edxapp_wrapper.backends.courses_l_v1"
EOX_HOOKS_COURSE_MODES_BACKEND: "eox_hooks.edxapp_wrapper.backends.course_modes_l_v1"
EOX_HOOKS_MODELS_BACKEND: "eox_hooks.edxapp_wrapper.backends.models_l_v1"

Olive

EOX_HOOKS_ENROLLMENTS_BACKEND: "eox_hooks.edxapp_wrapper.backends.enrollments_l_v1"
EOX_HOOKS_COURSES_BACKEND: "eox_hooks.edxapp_wrapper.backends.courses_l_v1"
EOX_HOOKS_COURSE_MODES_BACKEND: "eox_hooks.edxapp_wrapper.backends.course_modes_l_v1"
EOX_HOOKS_MODELS_BACKEND: "eox_hooks.edxapp_wrapper.backends.models_l_v1"

Palm and Quince

EOX_HOOKS_ENROLLMENTS_BACKEND: "eox_hooks.edxapp_wrapper.backends.enrollments_l_v1"
EOX_HOOKS_COURSES_BACKEND: "eox_hooks.edxapp_wrapper.backends.courses_p_v1"
EOX_HOOKS_COURSE_MODES_BACKEND: "eox_hooks.edxapp_wrapper.backends.course_modes_l_v1"
EOX_HOOKS_MODELS_BACKEND: "eox_hooks.edxapp_wrapper.backends.models_l_v1"

These settings can be changed in eox_hooks/settings/common.py or, for example, in ansible configurations.

NOTE:

  • The current common.py works with Open edX Lilac version.

  • Koa and Lilac work with PR (backports) 28266 and 28640 from Maple release.

Open edX devstack

  • Clone this repo in the src folder of your devstack.

  • Open a new Lms/Devstack shell.

  • Install the plugin as follows: pip install -e /path/to/your/src/folder

  • Restart Lms/Studio services.

Usage

Before using eox-hooks, this plugin must be configured using EOX_HOOKS_DEFINITIONS:

{
    "trigger_event": {
        "module": "path_to_module",
        "action": "action_name",
        "fail_silently": True,
    },
}

Where:

  • trigger_event: is the name of the event sent by the platform. For example: pre_enrollment_trigger.

  • module: path to the module where the action to be executed is defined. For example: eox_hooks.tests.tests_utils.

  • action: name of the action to be executed. For example: custom_action.

  • fail_silently: defines what happens if an exception raises while executing the action. If False, then the exception is raised.

Examples

"EOX_HOOKS_DEFINITIONS": {
    "post_certificate_creation": {
        "action": "post_to_webhook_url",
        "config": {
            "send_certificate_data": true,
            "url": "https://webhook.site"
        },
        "fail_silently": true,
        "module": "eox_hooks.actions"
    }
}
"EOX_HOOKS_DEFINITIONS": {
    "post_register": {
        "action": "post_to_webhook_url",
        "fail_silently": true,
        "module": "eox_hooks.actions",
        "config" : {
            "send_certificate_data": false,
            "url": "https://webhook.site",
            "fields": {
                    "recipient_email": "user.pii.email"
            }
        }
    }
}
"EOX_HOOKS_DEFINITIONS": {
    "post_certificate_creation": {
        "action": "trigger_grades_assignment",
        "fail_silently": true,
        "module": "eox_hooks.actions"
    }
}
"EOX_HOOKS_DEFINITIONS": {
    "post_enrollment": {
        "action": "trigger_enrollments_creation",
        "fail_silently": false,
        "module": "eox_hooks.actions"
    }
}

How to Contribute

Contributions are welcome! See our CONTRIBUTING file for more information – it also contains guidelines for how to maintain high code quality, which will make your contribution more likely to be accepted.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

eox_hooks-6.3.0.tar.gz (37.4 kB view details)

Uploaded Source

Built Distribution

eox_hooks-6.3.0-py3-none-any.whl (46.4 kB view details)

Uploaded Python 3

File details

Details for the file eox_hooks-6.3.0.tar.gz.

File metadata

  • Download URL: eox_hooks-6.3.0.tar.gz
  • Upload date:
  • Size: 37.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for eox_hooks-6.3.0.tar.gz
Algorithm Hash digest
SHA256 f3c58e6d87bb120607bc2a07661981e2193ea00eb9832e13c1e95a1a9b519963
MD5 a6f8864fe81ad05f3434674942f6be70
BLAKE2b-256 88d81e89ed207d3cca2d7bf80755258fef2d900443c778e14b89ea817fe630bf

See more details on using hashes here.

File details

Details for the file eox_hooks-6.3.0-py3-none-any.whl.

File metadata

  • Download URL: eox_hooks-6.3.0-py3-none-any.whl
  • Upload date:
  • Size: 46.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for eox_hooks-6.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c6c0c2a53b13abfebcdae5ad99e31add99273e932347fca26e31948c67c736e5
MD5 e8204ec3afddef66634b85ff7e5a375d
BLAKE2b-256 313cd11281664235de0b65c1d2070a872f43e521ef5af42332c3ef2c2a78cc74

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page