Skip to content

eduNEXT/openedx-filters-samples

Repository files navigation

Open edX Filters Samples

CI License

A ready-to-use repository illustrating how to use Open edX Filters to modify the behavior of the Open edX platform. It serves as a starting point for more advanced use cases. Explore Real-Life Use Cases for Open edX Filters to see more complex implementations from the Open edX Community.

Purpose

This repository demonstrates how to use Open edX Filters to modify the behavior of the Open edX platform. Filters are a powerful feature that allows developers to modify the behavior of the platform without directly changing the Open edX core. This can be useful for a variety of use cases, such as:

  • Customizing the user experience
  • Implementing custom business logic
  • Etc.

Getting Started with Development

Please see the Open edX documentation for guidance on Python development in this repo.

Deploying

See the Usage section below for instructions on how to deploy this plugin. Also, see the Tutor documentation for more information on deploying extra requirements.

Getting Help

Documentation

Refer to the Open edX Filters documentation to learn about implementing and working with filters. This documentation details how to use the repository as a testing tool for Open edX filters, they are not meant to be used in production environments.

You can review the rendered documentation at https://edunext.github.io/openedx-filters-samples/.

Features

  • Pipeline Steps: Available pipeline steps are listed in the pipeline.py file.
  • Different Use Cases: The repository includes a variety of use cases to illustrate how filters can be used.
  • Customizable: Easily extend the repository to handle additional use cases.
  • Ready-to-Use: Install the repository in your Open edX image and start using filters right away.

Supported Filters

These are the filters that are currently supported in this repository: Pipeline Steps

How Does it Work?

This repository provides a set of pipeline steps that can be used to modify the behavior of the Open edX platform. Each pipeline step is a Python class that implements a specific behavior. The pipeline steps are then added to the filter configuration in the Open edX settings which are later executed when the filter is triggered.

Usage

To use this plugin, follow these steps:

  1. Install the plugin in your Open edX image using Tutor's OPENEDX_EXTRA_PIP_REQUIREMENTS configuration setting:
OPENEDX_EXTRA_PIP_REQUIREMENTS:
- git+https://github.com/edunext/[email protected]
  1. Launch the Open edX platform to apply the changes:
tutor local launch
  1. Create and enable an Inline Tutor plugin to configure the filter you want to use. For example, to enable the StopEnrollment pipeline step for the org.openedx.learning.course.enrollment.started.v1 filter, add the following code to the plugin:
# Location plugins/openedx-filters.py
from tutor import hooks

hooks.Filters.ENV_PATCHES.add_item(
    (
        "openedx-lms-common-settings",
"""
OPEN_EDX_FILTERS_CONFIG = {
        "org.openedx.learning.course.enrollment.started.v1": {
            "fail_silently": False,
            "pipeline": [
                "openedx_filters_samples.pipeline.StopEnrollment"
            ]
        },
    }
"""
    )
)
tutor plugins enable openedx-filters
  1. Trigger the filter by enrolling in a course. The filter will be applied and the pipeline step will be executed stopping the enrollment process.

Review the Tutor documentation for more information on using plugins and extra requirements.

How to Extend this Repository

This repository is a starting point for Open edX developers:

  • You can add new filter pipeline step by following the structure in pipeline.py.
  • Custom logic can be implemented in the pipeline step to test the behavior of the filter in the Open edX platform.

For details on extending Open edX with Open edX Filters, see also:

The openedx-filters-samples repository is here to give developers the tools implement new filters and test them with pipeline steps in a safe environment.

More Help

If you're having trouble, we have discussion forums at https://discuss.openedx.org where you can connect with others in the community.

Our real-time conversations are on Slack. You can request a Slack invitation, then join our community Slack workspace.

For anything non-trivial, the best path is to open an issue in this repository with as many details about the issue you are facing as you can provide.

https://github.com/edunext/openedx-filters-samples/issues

For more information about these options, see the Getting Help page.

License

The code in this repository is licensed under the AGPL 3.0 unless otherwise noted.

Please see LICENSE.txt for details.

Contributing

Contributions are very welcome. Please read How To Contribute for details.

This project is currently accepting all types of contributions, bug fixes, security fixes, maintenance work, or new features. However, please make sure to discuss your new feature idea with the maintainers before beginning development to maximize the chances of your change being accepted. You can start a conversation by creating a new issue on this repo summarizing your idea.

The Open edX Code of Conduct

All community members are expected to follow the Open edX Code of Conduct.

People

This repository is currently being maintained by the eduNEXT team. See the CODEOWNERS file for details.

Reporting Security Issues

Please do not report security issues in public. Please email [email protected].

About

Used to create Open edX Filters steps for testing purposes.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published