{"id":23079,"library":"edx-completion","title":"edx-completion","description":"A Django app for tracking completion of blocks by learners in edX courses. Current version 5.0.0. Release cadence is irregular, with frequent dependency upgrades and occasional feature drops.","status":"active","version":"5.0.0","language":"python","source_language":"en","source_url":"https://github.com/openedx/completion","tags":["edx","completion","django","lms"],"install":[{"cmd":"pip install edx-completion","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Required as a Django app.","package":"Django","optional":false},{"reason":"For BlockUsageLocator and other key types.","package":"edx-opaque-keys","optional":false}],"imports":[{"note":"BlockCompletion is a model, not a top-level module symbol.","wrong":"from completion import BlockCompletion","symbol":"BlockCompletion","correct":"from completion.models import BlockCompletion"},{"note":"submit_completion is not a top-level export.","wrong":"from completion import submit_completion","symbol":"submit_completion","correct":"from completion.api import submit_completion"}],"quickstart":{"code":"from completion.api import submit_completion\nfrom completion.models import BlockCompletion\n\n# Submit a completion for a block\nblock_key = 'block-v1:Org+Course+Run+type@problem+block@abc123'\nuser_id = 1\ncourse_key = 'course-v1:Org+Course+Run'\nsubmit_completion(\n    user_id=user_id,\n    course_key=course_key,\n    block_key=block_key,\n    completion=1.0\n)\n\n# Query existing completions\ncompletions = BlockCompletion.objects.filter(user_id=user_id, course_key=course_key)\nprint(list(completions))","lang":"python","description":"Submit a completion and query completions."},"warnings":[{"fix":"Ensure keys are stringified via `str(course_key)` before calling submit_completion.","message":"The `submit_completion` function expects `course_key` and `block_key` as strings (serialized opaque keys), not objects. Using `CourseKey` or `BlockUsageLocator` objects will raise a TypeError.","severity":"gotcha","affected_versions":">=4.0.0"},{"fix":"Use Python 3.10 or later.","message":"In v5.0.0, support for Python 3.8 was dropped. If your project uses Python 3.8, you must upgrade.","severity":"breaking","affected_versions":">=5.0.0"},{"fix":"Replace `get_completions(...)` with `BlockCompletion.objects.filter(...)`.","message":"The `get_completions` function in `completion.api` was deprecated in v4.x and removed in v5.0.0. Use `BlockCompletion.objects.filter(...)` instead.","severity":"deprecated","affected_versions":">=5.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run `pip install edx-completion` and use `from completion.models import BlockCompletion`.","cause":"Package not installed or import path wrong.","error":"ModuleNotFoundError: No module named 'completion'"},{"fix":"Ensure you provide all required arguments: user_id, course_key, block_key, completion.","cause":"Missing argument when calling submit_completion.","error":"TypeError: submit_completion() missing 1 required positional argument: 'block_key'"},{"fix":"Add 'completion' to INSTALLED_APPS in settings.","cause":"The Django app is not added to INSTALLED_APPS.","error":"django.core.exceptions.ImproperlyConfigured: The app 'completion' is not a properly configured Django application."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}