Skip to content

feat: allow marking Library Content Block as complete on view [BB-4503] - #28268

Merged
mtyaka merged 1 commit into
openedx:masterfrom
open-craft:agrendalath/bb-4503_library_content_block_completion
Mar 25, 2022
Merged

feat: allow marking Library Content Block as complete on view [BB-4503]#28268
mtyaka merged 1 commit into
openedx:masterfrom
open-craft:agrendalath/bb-4503_library_content_block_completion

Conversation

@Agrendalath

@Agrendalath Agrendalath commented Jul 25, 2021

Copy link
Copy Markdown
Member

Description

edx/edx-platform#24365 has changed the completion mode of these blocks.
Before Koa, it was sufficient to view the block to get a completion checkmark.
Since Koa, all children of the block must be completed.

This adds the MARK_LIBRARY_CONTENT_BLOCK_COMPLETE_ON_VIEW toggle to change the completion behavior back to the previous one so that the user experience can be consistent if needed.

Use case

Our client offers a Certificate of Completion additionally to the one received after passing a course. In order to receive it, learners need to "complete" all of the course material, including the final exam (Randomized Content Block). The final exam is considered "complete" for the purposes of these criteria even if the learner has not submitted every question. This way, the learners who have spent some time in the final exam would still get this certificate - even if they haven't submitted everything.

Jira

OSPR-5930
BB-4503

Sandbox

https://pr28268.sandbox.opencraft.hosting/ (provisioning)

Testing instructions

  1. Add the completion.enable_completion_tracking [Waffle Switch|http://localhost:18000/admin/waffle/switch/] (marked as active).
  2. Create a new library in Studio. Add an example problem there.
  3. Create a new course. Add "library_content" to "Advanced Module List".
  4. Add a "Randomized Content Block" to the course and set the new library as its source.
  5. Copy the subsection with this unit and publish the section.
  6. Visit the first unit in the LMS and see that it's not marked as completed on the Course Outline page.
  7. Complete the first unit and see that you have the completion checkmark on the Course Outline page.
  8. Add FEATURES['MARK_LIBRARY_CONTENT_BLOCK_COMPLETE_ON_VIEW'] = True to envs/private.py.
  9. Visit the second unit and wait for a few seconds. You should be able to see two publish_completion POST requests in the browser's Network tab. The first one will return 200, and the second one 400 (because it's not going to affect the problem block itself).
  10. Go to the Course Outline page and check that the second subsection is now completed as well.

Deadline

None.

Reviewers

Settings

EDXAPP_FEATURES_EXTRA:
  MARK_LIBRARY_CONTENT_BLOCK_COMPLETE_ON_VIEW: true

@openedx-webhooks openedx-webhooks added needs triage open-source-contribution PR author is not from Axim or 2U labels Jul 25, 2021
@openedx-webhooks

openedx-webhooks commented Jul 25, 2021

Copy link
Copy Markdown

Thanks for the pull request, @Agrendalath! I've created OSPR-5930 to keep track of it in JIRA, where we prioritize reviews. Please note that it may take us up to several weeks or months to complete a review and merge your PR.

Feel free to add as much of the following information to the ticket as you can:

  • supporting documentation
  • Open edX discussion forum threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here.

Please let us know once your PR is ready for our review and all tests are green.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to use classproperty here to make the purpose clearer, but it's not supported by pylint (also, it doesn't seem to be documented before Django 3.1, but it's present in the code).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never mind, we need a classproperty here.

@Agrendalath
Agrendalath force-pushed the agrendalath/bb-4503_library_content_block_completion branch from f7cfe0b to dda8974 Compare July 26, 2021 17:24

@arjunsinghy96 arjunsinghy96 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 @Agrendalath LGTM

  • I tested that completion on view can be configured with the feature flag MARK_LIBRARY_CONTENT_BLOCK_COMPLETE_ON_VIEW
  • I read through the code
  • I checked for accessibility issues
  • Includes documentation
  • I made sure any change in configuration variables is reflected in the corresponding client's configuration-secure repository.

@Agrendalath

Copy link
Copy Markdown
Member Author

@natabene, this is ready for your review.

@Agrendalath
Agrendalath force-pushed the agrendalath/bb-4503_library_content_block_completion branch from dda8974 to c729be7 Compare July 26, 2021 18:45
@natabene

Copy link
Copy Markdown
Contributor

@Agrendalath Thank you!

@Agrendalath
Agrendalath force-pushed the agrendalath/bb-4503_library_content_block_completion branch from c729be7 to c6b7238 Compare August 2, 2021 15:46
@Agrendalath
Agrendalath force-pushed the agrendalath/bb-4503_library_content_block_completion branch 2 times, most recently from 618c5d6 to fe39441 Compare October 22, 2021 17:23
@Agrendalath
Agrendalath force-pushed the agrendalath/bb-4503_library_content_block_completion branch from fe39441 to a9bda23 Compare November 5, 2021 10:03
@edx-status-bot

Copy link
Copy Markdown

Your PR has finished running tests. There were no failures.

@mtyaka

mtyaka commented Mar 13, 2022

Copy link
Copy Markdown
Contributor

@natabene Would this be suitable for a Core Contributor review?

@natabene

Copy link
Copy Markdown
Contributor

@mtyaka Let me check with the owning team, and I will get back to you.

@natabene

Copy link
Copy Markdown
Contributor

@mtyaka Please review and merge as you find fit.

@Agrendalath
Agrendalath force-pushed the agrendalath/bb-4503_library_content_block_completion branch from a9bda23 to 43cc419 Compare March 15, 2022 19:20
edx/edx-platform#24365 has changed the completion mode of these blocks.
Before Koa, it was sufficient to view the block to get a completion checkmark.
Since Koa, all children of the block must be completed.

This adds a toggle to change the completion behavior back to the previous one
so that the user experience can be consistent if needed.
@Agrendalath
Agrendalath force-pushed the agrendalath/bb-4503_library_content_block_completion branch from 43cc419 to d05e5c6 Compare March 22, 2022 18:09
@Agrendalath
Agrendalath requested a review from mtyaka March 22, 2022 18:11

@mtyaka mtyaka left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

  • I tested this: I followed the testing instructions on the sandbox and verified that a randomized content block gets flagged as complete on view (without having to complete the problem) when the MARK_LIBRARY_CONTENT_BLOCK_COMPLETE_ON_VIEW feature is enabled.
  • I read through the code
  • Includes documentation

@mtyaka
mtyaka merged commit 8633249 into openedx:master Mar 25, 2022
@openedx-webhooks

Copy link
Copy Markdown

@Agrendalath 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future.

@edx-pipeline-bot

Copy link
Copy Markdown
Contributor

EdX Release Notice: This PR has been deployed to the staging environment in preparation for a release to production.

@edx-pipeline-bot

Copy link
Copy Markdown
Contributor

EdX Release Notice: This PR has been deployed to the production environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged open-source-contribution PR author is not from Axim or 2U

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants