Skip to content

Conversation

@0x29a
Copy link

@0x29a 0x29a commented Feb 17, 2025

Description

Here is what happens when you try to access any section before completing prerequisites in LMS:
image
Here is what happens when you try to access any unit in a gated subsection using the mobile app (the first subsection on the video is a prerequisite to the second):

before.mp4

With the fix from this PR:

after.mp4

Testing instructions

  1. Setup the latest version of Tutor locally with https://github.com/overhangio/tutor-android. It doesn't matter if it can't build an image. We only need it to create OAuth application.
  2. Create and configure a course like this:
    https://github.com/user-attachments/assets/0e943622-0577-4c98-a538-e407f53a9e96
  3. Launch the app in the Android emulator. Be sure to make this and this local changes to allow it to connect to a local Tutor instance.
  4. Run ./adb reverse tcp:8000 tcp:8000 from ~/Android/Sdk/platform-tools (if you're on Linux) directory to allow your virtual device communicate with the Tutor instance.
  5. Replicate the behavior from the "after.mp4" video above in the description.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Feb 17, 2025
@openedx-webhooks
Copy link

Thanks for the pull request, @0x29a!

This repository is currently maintained by @openedx/openedx-mobile-maintainers.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

Details
Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@0x29a 0x29a force-pushed the 0x29a/BB-9492/locked-content branch from 23797f1 to 58739a1 Compare February 18, 2025 13:24
Adds a "locked" screen when trying to access content that's locked due
to incomplete prerequisites.
@0x29a 0x29a force-pushed the 0x29a/BB-9492/locked-content branch from 58739a1 to 2947fa7 Compare February 18, 2025 13:29
@mphilbrick211 mphilbrick211 requested a review from a team February 19, 2025 21:40
@e0d
Copy link

e0d commented Feb 19, 2025

@marcotuts and @edschema this looks pretty useful, but needs a product eye.

Comment on lines +59 to +69
if (networkConnection.isOnline()) {
val sectionData = interactor.getSubsection(blockId)
if (sectionData.gatedContent.gated) {
_uiState.value = CourseSectionUIState.Gated(
prereqId = sectionData.gatedContent.prereqId,
prereqSubsectionName = sectionData.gatedContent.prereqSubsectionName,
gatedSubsectionName = sectionData.gatedContent.gatedSubsectionName,
)
return@launch
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

@0x29a, thanks for the contribution; it's a great improvement.

A few architectural concerns:

To address both issues, we must rely on the /api/mobile/{api_version}/course_info/blocks/ endpoint that we use to work with course structure and related data. If that endpoint doesn't provide us with that information, I would consider starting by adding that data to the endpoint.

@e0d @marcotuts wdyt?

Copy link
Author

Choose a reason for hiding this comment

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

Thank you for the review, @volodymyr-chekyrta!

We've tried to add the locked content information to that endpoint, but it proved to be really hard, so we had to resort to this "online-only" half-measure, which solves the problem for us. Once locked content data is available in the /api/mobile/{api_version}/course_info/blocks/ endpoint, it should be very trivial to update the implementation of this feature to use it.

@edschema
Copy link

edschema commented Feb 21, 2025

This is great..! A couple product notes:

  • We have a pattern for similar screens that shows a large icon, text, and call to action. For the prerequisite lock screen, I'd suggest following that pattern for the sake of consistency.
  • For the button, I'd suggest a minor change from 'Go to Prerequisite Section" to just "Go to Prerequisite".

cc: @marcotuts @sdaitzman, any other product notes?

@mphilbrick211
Copy link

Hi @edschema @marcotuts - just checking to see if there's any updates here?

@sdaitzman
Copy link

No other notes from me, the proposed design from @edschema looks good here!

@itsjeyd itsjeyd added the product review PR requires product review before merging label Mar 13, 2025
@itsjeyd itsjeyd moved this from Ready for Review to Product Review in Contributions Mar 13, 2025
@mphilbrick211
Copy link

@marcotuts @edschema is this all set?

@edschema
Copy link

Yes, all set thank you @mphilbrick211!

@mphilbrick211 mphilbrick211 moved this from Product Review to Ready for Review in Contributions May 12, 2025
@mphilbrick211 mphilbrick211 requested a review from a team May 12, 2025 19:12
@mphilbrick211
Copy link

@openedx/openedx-mobile-maintainers - would someone be able to please review / merge this for us?

@mphilbrick211 mphilbrick211 added product review complete PR has gone through product review and removed product review PR requires product review before merging labels May 12, 2025
@volodymyr-chekyrta
Copy link
Contributor

@openedx/openedx-mobile-maintainers - would someone be able to please review / merge this for us?

@0x29a @mphilbrick211 I reviewed it previously. I had only one concern: This solution is not suitable for everyone.
We can merge it, but I would like to have a feature flag to manage this feature.

@0x29a Could you please introduce a feature flag for this feature?

@0x29a
Copy link
Author

0x29a commented May 16, 2025

Thank you for your review, @edschema!

@mphilbrick211, @volodymyr-chekyrta - I apologize for the lack of activity here. We've run out of budget for up-streaming this feature and had to pause work on it back then. Before adding the feature flag, I'd like to address @edschema comments and review again your first concern from this comment. I'll try to re-visit this in the coming weeks.

@mphilbrick211 mphilbrick211 added the inactive PR author has been unresponsive for several months label Sep 16, 2025
@mphilbrick211
Copy link

Thank you for your review, @edschema!

@mphilbrick211, @volodymyr-chekyrta - I apologize for the lack of activity here. We've run out of budget for up-streaming this feature and had to pause work on it back then. Before adding the feature flag, I'd like to address @edschema comments and review again your first concern from this comment. I'll try to re-visit this in the coming weeks.

Just checking in on this, @0x29a!

@mphilbrick211 mphilbrick211 added closed inactivity PR was closed because the author abandoned it and removed inactive PR author has been unresponsive for several months labels Dec 19, 2025
@mphilbrick211
Copy link

Closing for now - can reopen if needed.

@github-project-automation github-project-automation bot moved this from Ready for Review to Done in Contributions Dec 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

closed inactivity PR was closed because the author abandoned it open-source-contribution PR author is not from Axim or 2U product review complete PR has gone through product review

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

8 participants