Skip to main content

Django app plugin for fetching and verifying tags for xblock skills.

Project description

skill_tagging

PyPI CI Codecov Documentation Supported Python versions License status-badge

Overview

Django app for fetching and verifying tags/skills for video and vertical/unit XBlocks. It implements two openedx_filters pipelines to inject a form into the end unit XBlocks and video XBlocks.

vertical block verification form video block verification form

More information about the XBlock skill tagging design can be found in this ADR.

Getting Started

To install skill_tagging in edx-platform, run

pip install skill_tagging

# to install a development version locally in devstack
# clone this repo in `<devstack_base_dir>/src` directory and run
pip install -e /edx/src/xblock-skill-tagging

This repo depends on discovery service for fetching skills/tags for a given XBlock which depends on taxonomy-connector plugin for generating and serving these tags. Setup taxonomy-connector plugin in course-discovery by installing it via pip:

pip install taxonomy-connector

# to install a development version locally in devstack
# clone this repo in `<devstack_base_dir>/src` directory and run
pip install -e /edx/src/taxonomy_connector

Whenever a user verifies tags/skills for an XBlock, skill_tagging emits an openedx_event called XBLOCK_SKILL_VERIFIED. This event needs to be consumed by course discovery to make sure that the verification count is incremented for that skill/tag.

To produce and consume this event, setup an implementation of event bus like event_bus_kafka or event_bus_redis. How to start using the Event Bus has detailed information on setting up event bus. The host would be edx-platform while course-discovery will be the consumer for the event bus.

Configuration

Add following configuration values to the host django settings, i.e. LMS settings: lms/envs/common.py

from .common import XBLOCK_MIXINS
# Below mixin adds the ability to fetch skills/tags from discovery and update them.
XBLOCK_MIXINS += ('skill_tagging.skill_tagging_mixin.SkillTaggingMixin',)
# Set below url to point to discovery service.
TAXONOMY_API_BASE_URL='http://edx.devstack.discovery:18381'
# Configure the maximum number skills/tags to display in the form for a given xblock.
TAXONOMY_API_SKILL_PAGE_SIZE=20
# Copy this as is, this configures the required openedx_filters.
OPEN_EDX_FILTERS_CONFIG = {
    "org.openedx.learning.vertical_block.render.completed.v1": {
        "fail_silently": False,
        "pipeline": [
            "skill_tagging.pipeline.AddVerticalBlockSkillVerificationSection",
        ]
    },
    "org.openedx.learning.vertical_block_child.render.started.v1": {
        "fail_silently": False,
        "pipeline": [
            "skill_tagging.pipeline.AddVideoBlockSkillVerificationComponent",
        ]
    }
}
# helps to configure probability of displaying the verification forms. Values in range 0 to 1 are allowed, where 0
# means never and 1 means always display. Default value is 0.5 i.e. 50% chance of displaying the form.
SHOW_SKILL_VERIFICATION_PROBABILITY = 0.5
# Optionally update topic name for verification event emitted when a user verifies tags for an xblock.
EVENT_BUS_XBLOCK_VERIFICATION_TOPIC = "learning-custom-xblock-skill-verfied"

Developing

One Time Setup
# Clone the repository
git clone git@github.com:openedx/xblock-skill-tagging.git
cd xblock-skill-tagging

# Set up a virtualenv using virtualenvwrapper with the same name as the repo and activate it
mkvirtualenv -p python3.8 xblock-skill-tagging
Every time you develop something in this repo
# Activate the virtualenv
workon xblock-skill-tagging

# Grab the latest code
git checkout main
git pull

# Install/update the dev requirements
make requirements

# Run the tests and quality checks (to verify the status before you make any changes)
make validate

# Make a new branch for your changes
git checkout -b <your_github_username>/<short_description>

# Using your favorite editor, edit the code to make your change.
vim ...

# Run your new tests
pytest ./path/to/new/tests

# Run all the tests and quality checks
make validate

# Commit all your changes
git commit ...
git push

# Open a PR and ask for review.

Deploying

This package is automatically published to pypi whenever a new tag is pushed to the repository.

Getting Help

Documentation

Published documentation is not available.

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/openedx/xblock-skill-tagging/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 have a discussion about your new feature idea with the maintainers prior to 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

The assigned maintainers for this component and other project details may be found in Backstage. Backstage pulls this data from the catalog-info.yaml file in this repo.

Reporting Security Issues

Please do not report security issues in public. Please email security@openedx.org.

Change Log

Unreleased

[0.2.0] - 2024-04-23

Changed

  • Applied updates required for XBlock 3.0

[0.1.10] - 2024-03-22

Changed

  • Remove log statement

[0.1.9] - 2024-03-20

Changed

  • Pass course key as query param to taxonomy skills api

[0.1.8] - 2024-03-14

Changed

  • Verification pipeline filter not run for proctored exam units

[0.1.7] - 2024-01-31

Changed

  • Removed temporary logs

[0.1.6] - 2024-01-29

Changed

  • Refactored logging and default run probability

[0.1.5] - 2024-01-25

Changed

  • Logging aborted runs of the filter

[0.1.4] - 2024-01-22

Changed

  • Added debug logs for filter runs

[0.1.3] - 2023-09-27

Changed

  • Gate skills API call behind probablity check to reduce traffic.

[0.1.2] - 2023-08-18

Added

  • Define Metaclass for XblockSkillTagging Mixin

[0.1.1] - 2023-06-14

Added

  • Add temporary option to configure topic name for skill-verified event.

[0.1.0] - 2022-12-01

Added

  • First release on PyPI.

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

skill_tagging-0.2.0.tar.gz (49.6 kB view details)

Uploaded Source

Built Distribution

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

skill_tagging-0.2.0-py2.py3-none-any.whl (45.7 kB view details)

Uploaded Python 2Python 3

File details

Details for the file skill_tagging-0.2.0.tar.gz.

File metadata

  • Download URL: skill_tagging-0.2.0.tar.gz
  • Upload date:
  • Size: 49.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.19

File hashes

Hashes for skill_tagging-0.2.0.tar.gz
Algorithm Hash digest
SHA256 bba40bfc6175da905a37121861bf83009b22a4983902ec8af4a65d4a64dd7f2a
MD5 86038a629428a32a28a79bebd6b23349
BLAKE2b-256 ad83a09860dfaa7bbb5e3c99dd7df90d3c889e291c54176917bc51837ab59b61

See more details on using hashes here.

File details

Details for the file skill_tagging-0.2.0-py2.py3-none-any.whl.

File metadata

  • Download URL: skill_tagging-0.2.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 45.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.19

File hashes

Hashes for skill_tagging-0.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d458a240a11b3184ea602c9641d4242ea9b0a9e52050b3e85acc68b1b93c0b40
MD5 a7ce0cc396b59dcd59f1dc3b15cfcef3
BLAKE2b-256 022b333635048decfa836a57750a39ada06e2bc73d57119c84e23b8e775fc8f2

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