Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: ADR introducing mobile offline content support #35011

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

GlugovGrGlib
Copy link
Member

@GlugovGrGlib GlugovGrGlib commented Jun 20, 2024

Description

This PR introduces an ADR outlining the approach to enable offline content support in the Open edX mobile application. The ADR documents the proposed solution, including content generation, API extensions, and synchronization mechanisms.

Key Decisions:

Offline Content Generation:

ZIP archives of xBlock content (HTML, assets, and assessments) will be pre-generated during course publishing and stored for mobile download.

Retries failed generation tasks with progressive delays.

Supports both local and S3 storage.

Mobile API:

Extends the Course Home API to include offline content availability (URL, size, last modified timestamp).

JavaScript Bridge:

Enables CAPA problem submissions via JSON messages through native mobile bridges.
Partial support for hints/feedback in problem types.

Supported xBlocks:

Includes common problem types (checkboxes, dropdown, text/numerical input), text/video blocks, and partial support for blocks with hints/feedback.

Consequences:

✅ Pros: Improved accessibility for learners with unreliable connectivity, increased engagement.
⚠️ Cons: Added complexity in content sync/storage, potential app size increase.

Rejected Solutions:

  • Storing shared JS/CSS files separately (tracking changes impractical).
  • On-the-fly content generation (performance concerns).

Supporting information

FC-0047

@openedx-webhooks
Copy link

openedx-webhooks commented Jun 20, 2024

Thanks for the pull request, @GlugovGrGlib!

This repository is currently maintained by @openedx/wg-maintenance-edx-platform.

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.


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.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Jun 20, 2024
@mphilbrick211 mphilbrick211 added the FC Relates to an Axim Funded Contribution project label Jul 30, 2024
@angonz
Copy link
Contributor

angonz commented Aug 9, 2024

I suggest adding a comprehensive list of content types that will support offline viewing (maybe not all will be implemented at a time).
I think that video content deserves special attention. Many courses rely on video content. Open edX usually relies on external streaming services for video (YouTube, Vimeo, etc.) Video files can be huge. How will it handle offload video? Maybe uploading a downloadable version of the video in a separate storage?
Another thing to consider is milestones. If grading cannot be done offline, then probably unlocking content based on subsection grade will not be possible.

@salman2013
Copy link
Contributor

@GlugovGrGlib Just for curiosity how this ADR is different from this PR?

@NiedielnitsevIvan
Copy link
Contributor

I suggest adding a comprehensive list of content types that will support offline viewing (maybe not all will be implemented at a time).
I think that video content deserves special attention. Many courses rely on video content. Open edX usually relies on external streaming services for video (YouTube, Vimeo, etc.) Video files can be huge. How will it handle offload video? Maybe uploading a downloadable version of the video in a separate storage?
Another thing to consider is milestones. If grading cannot be done offline, then probably unlocking content based on subsection grade will not be possible.

Hello @angonz! I have updated the ADR and now there is a list of blocks that are planned to be supported. I also added a diagram to make it clearer how the content generation process will work. Please check it out.

As for videos, video uploading is already implemented in mobile applications.
As for unlocking content based on subsection grade, yes, such functionality is not planned within this work scope and, accordingly, it is not reflected in the ADR.

@NiedielnitsevIvan
Copy link
Contributor

@GlugovGrGlib Just for curiosity how this ADR is different from this PR?

Hi @salman2013, the functionality added in the PR you mentioned corresponds to what is described in this ADR.
This ADR describes the overall vision, but focuses on how it is planned to be done on the backend.

@cmltaWt0 cmltaWt0 marked this pull request as ready for review January 28, 2025 15:36
@kdmccormick kdmccormick self-requested a review January 31, 2025 16:10
Copy link
Member

@kdmccormick kdmccormick left a comment

Choose a reason for hiding this comment

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

This is very exciting. Here's a first pass. I'll need to think through the implications over the next few days, so I should have more review comments next week--feel free to bug me if I don't get back to you with those.

Comment on lines 23 to 24
* Figma
* Offline mode product pages
Copy link
Member

Choose a reason for hiding this comment

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

Links?

Copy link
Contributor

Choose a reason for hiding this comment

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

Added.

Comment on lines +93 to +94
It was decided to include a fraction of Open edX xBlocks to be supported.
The following list of blocks is currently planned to be added to the support:
Copy link
Member

Choose a reason for hiding this comment

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

I'm glad you enumerated these. I agree that it makes sense to start with a subset of XBlocks.

I think it would be good to keep the door open for future XBlocks to be supported. Could you build this in a way that would allow that? For example, can we make sure that it is possible to add support for an external XBlock like xblock-drag-and-drop-v2, without adding knowledge of xblock-drag-and-drop-v2 to edx-platform?

Relatedly, please keep in mind that we are extracting all built-in edx-platform XBlocks into a separate repo. It will take some time, but the CAPA ProblemBlock will eventually be extracted as part of that project. So, when you implement this, it is important that we are not hard-coding more CAPA knowledge into the publishing process-- the CAPA-specific archiving code should stay within the ProblemBlock definition.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you for your question!
For offline content generation, we will use an html renderer very similar to the one used in the LMS, so there shouldn't be any significant issues with adding support for new blocks.

As for your question about xblock-drag-and-drop-v2 or other external XBlocks, yes, we won't need to add changes to the edx platform for each of them. I think that some refactoring/improvements will be needed in the future to expand the types of supported blocks, but it definitely shouldn't be for each new block separately.

As for CAPA, yes, the CAPA block will not be used.

Copy link
Member

Choose a reason for hiding this comment

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

As for CAPA, yes, the CAPA block will not be used.

@NiedielnitsevIvan Can you clarify this statement? "CAPA" is just another name for the ProblemBlock, which implements most of the core problem types. To implement offline support for most problems, the app will need to download archives of CAPA problem data and render CAPA html/javascript.

Mobile API extension
~~~~~~~~~~~~~~~~~~~~

Extend mobile API endpoint for Course Home, to return information about offline content available for download for supported blocks
Copy link
Member

Choose a reason for hiding this comment

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

Please provide the exact URL



* **Implement of a mechanism for generating and storing on a server or external storage**: The course content should be pre-generated and saved to the storage for later download.
* **Render content**: Generate HTML content of block as it does for LMS.
Copy link
Member

Choose a reason for hiding this comment

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

What Python function will call in order to render the HTML?

Does that function require a user_id? If so, how will you handle that?

Comment on lines +82 to +83
* **Track course publishing events on CMS side**: Signal in the CMS that makes request to LMS to update course content.
* **Track course publishing events on LMS side**: API endpoint to receive the signal from CMS and update course content.
Copy link
Member

Choose a reason for hiding this comment

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

I can see that this would work, but I am curious if there is a more elegant approach. I have asked in #architecture.

Comment on lines +87 to +88
* **Sync Mechanism**: Periodically synchronize local data with the server when the device is online.
* **Sync on app side**: On course outline screen, check if the course content is up to date and update it if necessary.
Copy link
Member

Choose a reason for hiding this comment

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

Please say more about:

  • How the offline app will respond when a user hits Submit
  • What local state the app will store and in what format it will store it
  • How the app will synchronize this state with the server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FC Relates to an Axim Funded Contribution project open-source-contribution PR author is not from Axim or 2U
Projects
Status: Waiting on Author
Development

Successfully merging this pull request may close these issues.

7 participants