Filters: Sumac Release

Contents

Filters: Sumac Release#

This is the list of Open edX Filters found in this repository that are available in the Sumac release.

Note

Filters can be created in other projects and plugins as well, but these default filters are guaranteed to exist.

Package where filters related to the learning architectural subdomain are implemented.

class openedx_filters.learning.filters.AccountSettingsRenderStarted#

Custom class used to create Account settings filters.

exception RedirectToPage(message, redirect_to='')#

Custom class used to redirect before the account settings rendering process.

exception RenderCustomResponse(message, response=None)#

Custom class used to stop the account settings rendering process and return a custom response.

exception RenderInvalidAccountSettings(message, account_settings_template='', template_context=None)#

Custom class used to stop the account settings rendering process.

classmethod run_filter(context, template_name)#

Execute a filter with the signature specified.

Arguments:

context (dict): template context for the account settings page. template_name (str): template path used to render the account settings page.

class openedx_filters.learning.filters.CertificateCreationRequested#

Custom class used to create certificate creation filters and its custom methods.

exception PreventCertificateCreation(message='', redirect_to=None, status_code=None, **kwargs)#

Custom class used to stop the certificate creation process.

classmethod run_filter(user, course_key, mode, status, grade, generation_mode)#

Execute a filter with the signature specified.

Arguments:

user (User): is a Django User object. course_key (CourseKey): course key associated with the certificate. mode (str): mode of the certificate. status (str): status of the certificate. grade (CourseGrade): user’s grade in this course run. generation_mode (str): Options are “self” (implying the user generated the cert themself) and “batch” for everything else.

class openedx_filters.learning.filters.CertificateRenderStarted#

Custom class used to create certificate render filters and its custom methods.

exception RedirectToPage(message, redirect_to='')#

Custom class used to stop the certificate rendering process.

exception RenderAlternativeInvalidCertificate(message, template_name='')#

Custom class used to stop the certificate rendering process.

exception RenderCustomResponse(message, response=None)#

Custom class used to stop the certificate rendering process.

classmethod run_filter(context, custom_template)#

Execute a filter with the signature specified.

Arguments:

context (dict): context dictionary for certificate template. custom_template (CertificateTemplate): edxapp object representing custom web certificate template.

class openedx_filters.learning.filters.CohortAssignmentRequested#

Custom class used to create cohort assignment filters and its custom methods.

exception PreventCohortAssignment(message='', redirect_to=None, status_code=None, **kwargs)#

Custom class used to stop the cohort assignment process.

classmethod run_filter(user, target_cohort)#

Execute a filter with the signature specified.

Arguments:

user (User): is a Django User object to be added in the cohort. target_cohort (CourseUserGroup): edxapp object representing the new user’s cohort.

class openedx_filters.learning.filters.CohortChangeRequested#

Custom class used to create cohort change filters and its custom methods.

exception PreventCohortChange(message='', redirect_to=None, status_code=None, **kwargs)#

Custom class used to stop the cohort change process.

classmethod run_filter(current_membership, target_cohort)#

Execute a filter with the signature specified.

Arguments:

current_membership (CohortMembership): edxapp object representing the user’s cohort current membership object. target_cohort (CourseUserGroup): edxapp object representing the new user’s cohort.

class openedx_filters.learning.filters.CourseAboutPageURLRequested#

Custom class used to get course about page url filters and its custom methods.

classmethod run_filter(url, org)#

Execute a filter with the specified signature.

Arguments:

url (str): the URL of the page to be modified. org (str): Course org filter used as context data to get LMS configurations.

class openedx_filters.learning.filters.CourseAboutRenderStarted#

Custom class used to create course about render filters and its custom methods.

exception RedirectToPage(message, redirect_to='')#

Custom class used to stop the course about rendering process.

exception RenderCustomResponse(message, response=None)#

Custom class used to stop the course about rendering process.

exception RenderInvalidCourseAbout(message, course_about_template='', template_context=None)#

Custom class used to stop the course about rendering process.

classmethod run_filter(context, template_name)#

Execute a filter with the signature specified.

Arguments:

context (dict): context dictionary for course about template. template_name (str): template name to be rendered by the course about.

class openedx_filters.learning.filters.CourseEnrollmentAPIRenderStarted#

Custom class used to create filters for enrollment data.

classmethod run_filter(course_key, serialized_enrollment)#

Execute a filter with the specified signature.

Arguments:

course_key (CourseKey): The course key for which isStarted is being modify. serialized_enrollment (dict): enrollment data

class openedx_filters.learning.filters.CourseEnrollmentQuerysetRequested#

Custom class used to create course enrollments queryset filters and its custom methods.

exception PreventEnrollmentQuerysetRequest(message='', redirect_to=None, status_code=None, **kwargs)#

Custom class used to stop the course enrollment queryset request process.

classmethod run_filter(enrollments)#

Execute a filter with the signature specified.

Arguments: enrollments (QuerySet): data with all user’s course enrollments

class openedx_filters.learning.filters.CourseEnrollmentStarted#

Custom class used to create enrollment filters and its custom methods.

exception PreventEnrollment(message='', redirect_to=None, status_code=None, **kwargs)#

Custom class used to stop the enrollment process.

classmethod run_filter(user, course_key, mode)#

Execute a filter with the signature specified.

Arguments:

user (User): is a Django User object. course_key (CourseKey): course key associated with the enrollment. mode (str): is a string specifying what kind of enrollment.

class openedx_filters.learning.filters.CourseHomeUrlCreationStarted#

Custom class used to create filters to act on course home url creation.

classmethod run_filter(course_key, course_home_url)#

Execute a filter with the specified signature.

Arguments:

course_key (CourseKey): The course key for which the home url is being requested. course_home_url (String): The url string for the course home

class openedx_filters.learning.filters.CourseRunAPIRenderStarted#

Custom class used to create filters for course run data.

classmethod run_filter(serialized_courserun)#

Execute a filter with the specified signature.

Arguments:

serialized_courserun (dict): courserun data

class openedx_filters.learning.filters.CourseUnenrollmentStarted#

Custom class used to create unenrollment filters and its custom methods.

exception PreventUnenrollment(message='', redirect_to=None, status_code=None, **kwargs)#

Custom class used to stop the unenrollment process.

classmethod run_filter(enrollment)#

Execute a filter with the signature specified.

Arguments:

enrollment (CourseEnrollment): edxapp object representing course enrollments.

class openedx_filters.learning.filters.DashboardRenderStarted#

Custom class used to create dashboard render filters and its custom methods.

exception RedirectToPage(message, redirect_to='')#

Custom class used to stop the dashboard rendering process.

exception RenderCustomResponse(message, response=None)#

Custom class used to stop the dashboard rendering process.

exception RenderInvalidDashboard(message, dashboard_template='', template_context=None)#

Custom class used to stop the dashboard render process.

classmethod run_filter(context, template_name)#

Execute a filter with the signature specified.

Arguments:

context (dict): context dictionary for student’s dashboard template. template_name (str): template name to be rendered by the student’s dashboard.

class openedx_filters.learning.filters.IDVPageURLRequested#

Custom class used to create filters to act on ID verification page URL requests.

classmethod run_filter(url: str)#

Execute a filter with the specified signature.

Arguments:

url (str): The url for the ID verification page to be modified.

class openedx_filters.learning.filters.InstructorDashboardRenderStarted#

Custom class used to create instructor dashboard filters and its custom methods.

exception RedirectToPage(message, redirect_to='')#

Custom class used to stop the instructor dashboard render by redirecting to a new page.

exception RenderCustomResponse(message, response=None)#

Custom class used to stop the instructor dashboard rendering by returning a custom response.

exception RenderInvalidDashboard(message, instructor_template='', template_context=None)#

Custom class used to render a custom template instead of the instructor dashboard.

classmethod run_filter(context, template_name)#

Execute a filter with the signature specified.

Arguments:

context (dict): context dictionary for instructor’s tab template. template_name (str): template name to be rendered by the instructor’s tab.

class openedx_filters.learning.filters.ORASubmissionViewRenderStarted#

Custom class used to create ORA submission view filters and its custom methods.

exception RenderInvalidTemplate(message: str, context: dict | None = None, template_name: str = '')#

Custom class used to stop the submission view render process.

classmethod run_filter(context: dict, template_name: str)#

Execute a filter with the signature specified.

Arguments:

context (dict): context dictionary for submission view template. template_name (str): template name to be rendered by the student’s dashboard.

class openedx_filters.learning.filters.RenderXBlockStarted#

Filter in between context generation and rendering of XBlock scope.

exception PreventXBlockBlockRender(message='', redirect_to=None, status_code=None, **kwargs)#

Custom class used to prevent the XBlock from rendering for the user.

exception RenderCustomResponse(message, response=None)#

Custom class used to stop the XBlock rendering process and return a custom response.

classmethod run_filter(context, student_view_context)#

Execute a filter with the specified signature.

Arguments:

context (dict): rendering context values like is_mobile_app, show_title, etc. student_view_context (dict): context passed to the student_view of the block context

class openedx_filters.learning.filters.ScheduleQuerySetRequested#

Filter class designed to apply additional filtering to a given QuerySet of Schedules.

If you want to know more about the Schedules feature, please refer: - openedx/edx-platform - https://edx.readthedocs.io/projects/edx-partner-course-staff/en/latest/manage_live_course/automatic_email.html

classmethod run_filter(schedules: QuerySet) QuerySet#

Execute the filtering logic for the given QuerySet of schedules.

This method processes the input QuerySet using the configured pipeline steps to applies additional filtering rules. It returns the filtered QuerySet for further processing.

Arguments:

schedules (QuerySet): The original QuerySet of schedules to be filtered.

Returns:

QuerySet: A refined QuerySet of schedules after applying the filter.

class openedx_filters.learning.filters.StudentLoginRequested#

Custom class used to create login filters and its custom methods.

exception PreventLogin(message, redirect_to=None, error_code='', context=None)#

Custom class used to stop the login process.

classmethod run_filter(user)#

Execute a filter with the signature specified.

Arguments:

user (User): is a Django User object.

class openedx_filters.learning.filters.StudentRegistrationRequested#

Custom class used to create registration filters and its custom methods.

exception PreventRegistration(message='', redirect_to=None, status_code=None, **kwargs)#

Custom class used to stop the registration process.

classmethod run_filter(form_data)#

Execute a filter with the signature specified.

Arguments:

form_data (QueryDict): contains the request.data submitted by the registration form.

class openedx_filters.learning.filters.VerticalBlockChildRenderStarted#

Custom class used to create vertical block children’s render filters.

exception PreventChildBlockRender(message='', redirect_to=None, status_code=None, **kwargs)#

Custom class used to stop a particular child block from being rendered.

classmethod run_filter(block, context)#

Execute a filter with the signature specified.

Arguments:

block (XBlock): the XBlock that is about to be rendered into HTML context (dict): rendering context values like is_mobile_app, show_title..etc

class openedx_filters.learning.filters.VerticalBlockRenderCompleted#

Custom class used to create filters to act on vertical block rendering completed.

exception PreventVerticalBlockRender(message='', redirect_to=None, status_code=None, **kwargs)#

Custom class used to prevent the vertical block from rendering for the user.

classmethod run_filter(block, fragment, context, view)#

Execute a filter with the specified signature.

Arguments:

block (VerticalBlock): The VeriticalBlock instance which is being rendered fragment (web_fragments.Fragment): The web-fragment containing the rendered content of VerticalBlock context (dict): rendering context values like is_mobile_app, show_title..etc., view (str): the rendering view. Can be either ‘student_view’, or ‘public_view’