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

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"

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-4.1.1.tar.gz (36.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

eox_hooks-4.1.1-py3-none-any.whl (44.3 kB view details)

Uploaded Python 3

File details

Details for the file eox-hooks-4.1.1.tar.gz.

File metadata

  • Download URL: eox-hooks-4.1.1.tar.gz
  • Upload date:
  • Size: 36.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for eox-hooks-4.1.1.tar.gz
Algorithm Hash digest
SHA256 c487de9289fd2f8f37734d0f976a9d03a95c3837f04861ebb4d361afd82ddd9e
MD5 70a7a671abe511dcf04156a2c71a8b0a
BLAKE2b-256 d67bb19238b81665ad64ea0a8b1b2203e79498d90c154e7f8ccad6ec429560b2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: eox_hooks-4.1.1-py3-none-any.whl
  • Upload date:
  • Size: 44.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for eox_hooks-4.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9067dac638d5036b0c2d5956e12c66348e40a88ecea95c638d0fd2e71ccaa967
MD5 b896f7d541436d84499b5925cb912cfb
BLAKE2b-256 497fdfb7006de9ae896eb4544879f1f56a1cb58633824e1062d76862267ac8aa

See more details on using hashes here.

Supported by

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