Package: edx-completion
A library for tracking completion of blocks by learners in edX courses.OverviewThis repository provides a Django modelBlockCompletionthat is intended to be plugged intoedx-platform.  It
provides various handlers and services for the recording of completion data.  It also provides a DRF API for submitting
completion data in batches.Enabling in the LMSBy default, the Open edX LMS does not use this library. To turn it on, go tohttp://localhost:18000/admin/waffle/switch/(substitute your LMS URL forhttp://localhost:18000/), and add a new switch with Namecompletion.enable_completion_trackingand Active selected.SeeCompletion Toolin the Open edX documentation for details on what will happen once enabled.LicenseThe code in this repository is licensed under the AGPL 3.0 unless
otherwise noted.Please seeLICENSE.txtfor details.How To ContributeContributions are very welcome.Please readHow To Contributefor details.PR description template should be automatically applied if you are sending PR from github interface; otherwise you
can find it it atPULL_REQUEST_TEMPLATE.mdIssue report template should be automatically applied if you are sending it from github UI as well; otherwise you
can find it atISSUE_TEMPLATE.mdReporting Security IssuesPlease do not report security issues in public. Please emailsecurity@edx.org.Using with Docker DevstackPrerequisite: Have your Open edXDevstackproperly installed.Note: When you see “from inside the lms” below, it means that you’ve runmakelms-shellfrom your devstack
directory and are on a command prompt inside the LMS container.Clone this repo into../src/directory (relative to your “devstack” repo location). This will mount the
directory in a way that is accessible to the lms container.From inside the lms, uninstall completion and reinstall your local copy. You can just copy the following line:pip uninstall completion -y; pip install -e /edx/src/completion/Now, get your completion development environment set up:cd /edx/src/completion
virtualenv completion-env
source completion-env/bin/activate
make installDon’t forget to enable the waffle switch as described above in “Enabling in the LMS”That’s it!  In order to simulate a given tox environment(django18, django111, quality), runtox-e<env>for the env in question.  If you want to runpytestdirectly:pytest completion/tests/test_models.pyGetting HelpHave a question about this repository, or about Open edX in general?  Please
refer to thislist of resourcesif you need any assistance.Change LogUnreleased[4.4.0] - 2023-10-20Added tracking logs for completion events[4.3.0]- 2023-07-26Added support for Django 4.2[4.2.1]- 2023-04-26Supportget_child_blocksalong withget_child_descriptors.Switch fromedx-sphinx-themetosphinx-book-themesince the former is
deprecated[4.1.0]- 2021-07-19Add Django 3.0, 3.1 & 3.2 Support[4.0.4]- 2021-02-04Updateget_key_to_last_completed_blockto returnfull_block_keyinstead ofblock_key[4.0.2] - 2021-02-04Future-proof usage ofedx_toggles.toggles[4.0.1] - 2021-01-05Replace reference to deprecated import pathstudent.modelswithcommon.djangoapps.student.models.Updated the build status badge in README.rst to point to travis-ci.com instead of travis-ci.org[4.0.0] - 2020-11-05Remove soon-to-be-deprecated WaffleSwitchNamespace class instancesBACKWARD INCOMPATIBLE: Removeswaffle(), which returned a (now deprecated) WaffleSwitchNamespace. This should only affect tests in edx-platform.Requires edx-toggles>=1.2.0, which introduces a new API to waffle objects.RefactorsENABLE_COMPLETION_TRACKING_SWITCHfrom aLegacyWaffleSwitchto the updatedWaffleSwitch.  We don’t expect uses of this updated switch to require changes, unless there are surprise uses of deprecated methods fromLegacyWaffleSwitch.[3.2.5] - 2020-10-23Fix waffle switch override in tests by relying on newest edx_toggles API[3.2.4] - 2020-07-21Fix AttributeError raised byvertical_is_complete.
* by ensuringget_completable_childrendoesn’t return null[3.2.3] - 2020-07-01Updated the children lookup forvertical_is_completeto utilize the XBlockCompletion model. There are
three completion modes to consider: EXCLUDED, AGGREGATOR, COMPLETABLE.This method will now ignore any block with XBlockCompletion.EXCLUDED.This method will now recurse down any child of a vertical if that child has XBlockCompletion.AGGREGATOR.This method will consider all children blocks with XBlockCompletion.COMPLETABLE as candidates to
determine if the vertical is complete.[3.2.2] - 2020-06-30Adding recursive lookup for children of a vertical to thevertical_is_completemethod in services.py.This was added because verticals containing children that had their own children were not being properly marked
as complete. Since the vertical was only looking one layer deep, it was possible to have children lower in the tree
incomplete, but the vertical would still be marked as complete. Now it looks at all leaves under the vertical.[3.1.1] - 2020-02-24Remove unnecessary constraint for edx-drf-extensions<3.0.0[3.1.0] - 2020-02-18Upgrades packages, drops support for Python 2.[3.0.1] - 2019-10-22Fix the package long description to be valid rST, check this in CI.[3.0.0] - 2019-10-22Support tracking completion of XBlocks in any “learning context”, such as in
a content library, and not just in courses. To keep the code clean, this has
been done as abreaking changeto the python API. (The API has been
simplified so that it’s generally only necessary to pass in a block key /
usage key rather than block key + course key.) The REST API is unchanged.[2.1.1] - 2019-10-21Updated credentials for PyPI deployment via token.[2.1.0] - 2019-10-18Switch blocks_to_mark_complete_on_view() to return a list of XBlocks instead of a set.  Many XBlocks aren’t hashable;
the old implementation allowed subtle bugs under Python 2.7 but triggers an immediate error under 3.5.[2.0.0] - 2019-04-23Unpin django-rest-framework requirements. This is a potentiallybreaking changeif people were
relying on this package to ensure the correct version of djangorestframework was being installed.Remove the AUTHORS file and references to it.[1.0.2] - 2019-03-11Fix the 403 error occurring for completion-batch API for requests coming from the iOS devices[1.0.0] - 2018-10-16Updated edx-drf-extensions imports. Completion will no longer work with
outdated versions of edx-drf-extensions.[0.1.14] - 2018-10-04Added submit_completion and submit_group_completion methods on
CompletionService.[0.1.7] - 2018-06-18Added can_mark_block_complete_on_view() and blocks_to_mark_complete_on_view()
methods on CompletionService and renamed get_completion_by_viewing_delay_ms()
to get_complete_on_view_delay_ms().[0.1.6] - 2018-04-13Remove usage of deprecated CourseStructure api.[0.1.5] - 2018-04-03Delete enable_visual_progress methods and checks. Deprecate ENABLE_VISUAL_PROGRESS,
ENABLE_COURSE_VISUAL_PROGRESS, and ENABLE_SITE_VISUAL_PROGRESS waffle flags[0.1.4] - 2018-03-28Site configurations must now explicitly disable visual progress for the
enable_visual_progress() feature gating function to return False early.[0.1.3] - 2018-03-26Added some documentation.[0.1.2] - 2018-03-23Fix management of dependency versions[0.1.1] - 2018-03-23Fixes wildly inefficient raw query in BlockCompletion.latest_blocks_completed_all_courses()Updates freezegun version, makes tests that use it somewhat faster.[0.1.0] - 2018-03-20Fixeshttps://openedx.atlassian.net/browse/EDUCATOR-2540[0.0.11] - 2018-03-20Added “subsection-completion/{username}/{course_key}/{subsection_id}” API
endpoint, to be used with the completion milestones experiment.[0.0.9] - 2018-02-27Added “utilities.py”, which houses methods for working with BlockCompletion
data.[0.0.8] - 2018-03-01Add model method for superlative “last completed block” - for site awareness
include every last completed block by course, for later sorting in business
layer.[0.0.7] - 2018-02-15Add settings and service method for determining completion-by-viewing delay.[0.0.6] - 2018-02-13Add the additional completion logic into the service and models from edx-platform[0.0.2] - 2018-01-31Fix up edx-lint requirements shenanigans.[0.0.1] - 2018-01-31Initial release