oppia / oppia-android

A free, online & offline learning platform to make quality education accessible for all.
https://www.oppia.org
Apache License 2.0
311 stars 514 forks source link

[Feature Request]: Introduce support for multiple classrooms (GSoC'24 4.2) #5344

Closed BenHenning closed 2 weeks ago

BenHenning commented 7 months ago

Is your feature request related to a problem? Please describe.

The app is currently limited to only showing basic numeracy lessons, and the broader team plans to introduce lessons of other types (such as financial literacy, science, and more).

Describe the solution you'd like

Suggested Milestones

Technical hints / guidance #### Top-level components needed for supporting multiple classrooms in the app - ``ClassroomListActivity.kt`` + presenter & layout: Top-level activity that has a row of available classrooms which is displayed as a carousel to facilitate addition of future classrooms. - The list of topics will be filtered based on the selected classroom. - The classrooms carousel shoud be sticky at the top when the topic list is scrolled. - When the home screen is resumed, the last classroom selection will be retained. - ``ClassroomListFragment.kt`` + presenter & layout: Top-level fragment for the available classrooms. The classrooms are displayed in a carousel(custom view as per existing patterns, see the "last played stories" carousel). - ``ClassroomController.kt``: The new controller for providing classroom context and state. - ``TopicListController.kt``: Existing controller that will be updated to no longer surface ``getTopicList`` since this is now implemented in ``ClassroomController``. Existing use cases and tests will need to be migrated over to ``ClassroomController``. For the home screen, suggest defaulting to the "math" classroom so that existing functionality is maintained. - ``FeatureFlagConstants.kt``: Where the new feature flag for enabling multiple classrooms will be defined. - ``ProfileChooserFragmentPresenter.kt``: Updated to navigate the user to `ClassroomListActivity.kt` instead of HomeActivity when the new feature flag is enabled. - Much of the classes under app/src/main/java/org/oppia/android/app/home: These will need to be moved to a new classroom package and generalized such that they can be used by both the home activity/fragment and new classroom views. - The rest of the classes under home/ (including HomeFragment & HomeActivity): These will be deleted at the end of the project in favor of the new structure. The ``home`` package will actually be completely removed. #### Some key technical notes - All new components require new corresponding test files. All updated components will need their tests updated based on the changes to those components. Presenters and view models are typically exempted from testing, and are exempted from test file presence check via [script/assets/test_file_exemptions.textproto](https://github.com/oppia/oppia-android/wiki/Static-Analysis-Checks#test-file-presence-check). - All references to HomeActivity/Fragment will need to be updated throughout the codebase. This may require documentation and/or test updates. - Existing layout files will need to be updated, as needed, to support the different card tile changes. - The new activities & fragments aren't explicitly spec'd out since they are mostly boilerplate. Existing classes should be analyzed for a reference on spec'ing these out in the proposal. - New test textproto files should be added to demonstrate multiple classrooms in the base developer version of the app. - Existing exploration-related event logs should be updated to contain classroomId #### Suggested files to add/change ClassroomController.kt: ```kotlin class ClassroomController { fun getClassroomList(profileId: ProfileId): DataProvider> fun getTopicList(profileId: ProfileId, classroomId: String): DataProvider } ``` TODO: Others will be added soon.

Describe alternatives you've considered

No response

Additional context

This is the high-level tracking issue corresponding to https://github.com/oppia/oppia/wiki/Google-Summer-of-Code-2024#42-multiple-classrooms-support.

BenHenning commented 7 months ago

NB: This issue is locked to ensure that it only contains updates for requirements. If you have questions regarding this project, please use its corresponding discussion category: https://github.com/oppia/oppia-android/discussions/categories/gsoc-q-a-4-2-multiple-classrooms-support.

BenHenning commented 7 months ago

NB: The main issue comment has been updated to include the technical details directly rather than a link to a Gist (so that we can easily change this if needed). Please note that there are some small changes to the requirements to better align with the PRD for the feature (as some key UX confusions were cleared up that influenced the original technical design).

theMr17 commented 4 months ago

Milestone 1

✅ PR 1.1 - #5410

Introduce a new feature flag for the multiple classrooms feature.

Starting Date Creation Date Merge Date
27-05-2024 27-05-2024 28-05-2024
Tasks Due Dates
Introduce feature flag in FeatureFlagConstants.kt file. 27-05-2024
Add dagger providers for the new feature flag. 27-05-2024

✅ PR 1.2 - #5418

Update the model & domain layer to support the definition of classrooms, and specify a classroom per-topic.

Starting Date Creation Date Merge Date
28-05-2024 31-05-2024 03-06-2024
Tasks Due Dates
Add ClassroomSummary & ClassroomIdList objects to topic.proto file. 29-05-2024
Update topic related objects to include classroomId & classroomTitle fields. 30-05-2024
Create test data json & textproto files for classrooms. 31-05-2024

✅ PR 1.3 - #5419

Introduce ClassroomController and modify TopicListController & ProfileManagmentController.

Starting Date Creation Date Merge Date
04-06-2024 10-06-2024 14-06-2024
Tasks Due Dates
Introduce ClassroomController to surface getClassroomList function. 04-06-2024
Add tests for getClassroomList function. 05-06-2024
Migrate getTopicList from TopicListController to ClassroomController. 07-06-2024
Migrate tests for getTopicList function. 08-06-2024
Modify ProfileManagementController to track last selected classroom. 09-06-2024
Add tests for new functions in ProfileManagementController. 10-06-2024

✅ PR 1.4 - #5437

Introduce a new activity & related fragments/views/tests for a new classroom list page.

Starting Date Creation Date Merge Date
11-06-2024 21-06-2024 25-06-2024
Tasks Due Dates
Create ClassroomListActivity, ClassroomListFragment & ClassroomListViewModel. 12-06-2024
Gate the new ClassroomListActivity. 13-06-2024
Add tests to verify the gating. 14-06-2024
Introduce Jetpack Compose Dependencies. 16-06-2024
Implement the Sticky Header and other elements of the ComposeView. 17-06-2024
Implement the Topic List UI. 19-06-2024
Add tests for the Sticky Header and other elements of the ComposeView. 20-06-2024
Add tests for the Topic List UI. 21-06-2024

Milestone 2

✅ PR 2.1 - #5456

Ensure the existing event logs are captured in the new screen and related tests in preparation for removal & implement new event log.

Starting Date Creation Date Merge Date
08-07-2024 12-07-2024 16-07-2024
Tasks Due Dates
Ensure that the existing event logs are captured in the new screen. 08-07-2024
Add classroomId field in ExplorationContext object and update related tests. 09-07-2024
Implement logging of start_exploration event. 10-07-2024
Add tests to verify the behaviour of the new event. 11-07-2024
Update FeatureFlagLogger with the ENABLE_MULTIPLE_CLASSROOMS feature flag. 12-07-2024

✅ PR 2.2 - #5460

Implement new recommendations logic & UI support for the classroom selection and add tests.

Starting Date Creation Date Merge Date
13-07-2024 18-07-2024 22-07-2024
Tasks Due Dates
Fix remaining recommendation logic tests. 14-07-2024
Add coming soon topic list UI. 15-07-2024
Add UI tests for coming soon topic list. 16-07-2024
Ensure all requirements of recommendation logic are fulfilled. 18-07-2024

✅ PR 2.3 - #5462

Address all PM demo comments from M1 and clean up the models to remove any unused fields to reduce the proto sizes.

Starting Date Creation Date Merge Date
21-07-2024 26-07-2024 30-07-2024
Tasks Due Dates
Collapse the classroom card when the carousel sticks to the top. 22-07-2024
Add tests to verify the card collapse behavior. 23-07-2024
Fix the background of topic list. 24-07-2024
Update dark mode colors. 25-07-2024

✅ Task 2.4 - #5479, #5502

Test and finalize the feature.

Starting Date Completion Date
29-07-2024 04-08-2024
Tasks Due Dates
Manually test the feature for regression. 31-07-2024
Add tests to the Android QA Regression Test Matrix. 04-08-2024

✅ PR 2.5 - #5510 #5488

Audit home activity/fragment to ensure the new utilities cover the same behaviors.

Starting Date Creation Date Merge Date
02-08-2024 06-08-2024 09-08-2024
Tasks Due Dates
Verify that the new utilities cover the same behaviour. 05-08-2024
Enable the ENABLE_MULTIPLE_CLASSROOMS feature flag. 06-08-2024
Milestone 2 (Outdated) ### ⬜ PR 2.1 Update 'recently played' topic cards to include classroom information and update tests. |Starting Date|Creation Date|Merge Date| |:-:|:-:|:-:| |08-07-2024|11-07-2024|15-07-2024| ||Tasks|Due Dates| |--|--|--| |⬜|Update topic cards UI.|09-07-2024| |⬜|Update tests for the UI changes.|11-07-2024| ### ⬜ PR 2.2 Implement new recommendations logic & UI support for the classroom selection and add tests. |Starting Date|Creation Date|Merge Date| |:-:|:-:|:-:| |13-07-2024|18-07-2024|20-07-2024| ||Tasks|Due Dates| |--|--|--| |⬜|Update the recommendation logic to include classroom information.|16-07-2024| |⬜|Update tests for the logic changes.|18-07-2024| ### ⬜ PR 2.3 Ensure the existing event logs are captured in the new screen and related tests in preparation for removal & implement new event log. |Starting Date|Creation Date|Merge Date| |:-:|:-:|:-:| |21-07-2024|25-07-2024|28-07-2024| ||Tasks|Due Dates| |--|--|--| |⬜|Ensure that the existing event logs are captured in the new screen.|21-07-2024| |⬜|Add `classroomId` field in `ExplorationContext` object and update related tests.|22-07-2024| |⬜|Implement logging of `start_exploration` event.|23-07-2024| |⬜|Add tests to verify the behaviour of the new event.|25-07-2024| ### ⬜ Task 2.4 Test, iterate, and work with the tech lead to finalize and launch the feature. |Starting Date|Completion Date| |:-:|:-:| |29-07-2024|04-08-2024| ### ⬜ PR 2.5 Audit home activity/fragment & recommendation tests to ensure the new utilities cover the same behaviors. Remove the old home activity/fragment. |Starting Date|Creation Date|Merge Date| |:-:|:-:|:-:| |02-08-2024|06-08-2024|09-08-2024| ||Tasks|Due Dates| |--|--|--| |⬜|Verify that the new utilities cover the same behaviour.|04-08-2024| |⬜|Enable the `ENABLE_MULTIPLE_CLASSROOMS` feature flag.|06-07-2024|
DubeySandeep commented 3 months ago

@theMr17 It looks like the PR 1.2 was expected to be merged by 03-06-2024, can you please raise a schedule slip and explain what's going on so that we can help you fix it?

theMr17 commented 3 months ago

Yes, @DubeySandeep, PR 1.2 (#5418) was supposed to be merged on the mentioned date. The PR is currently under review by @adhiamboperes. We are likely pending a decision regarding the structure of the classroom model, specifically the approach for storing the topic ID list of the classroom, which is being discussed in the CLaM team chat.

Additionally, please note that the work related to PR 1.3 (#5419) is completed as well and is ready for review. I am currently working on PR 1.4. Except for the schedule slip in merging PR 1.2, everything seems to be on track and ahead of schedule.

PR 1.4 is partly blocked by #4937 (PR 1.4 requires Kotlin v1.6.10 for Compose dependencies on Gradle) and #4886 (PR 1.4 requires Bazel 6.5.0 for Compose dependencies on Bazel).

DubeySandeep commented 3 months ago

@theMr17 PR for M1.2 is still not merged and I don't see any update on the PR for the last 6 days! Can you please raise a schedule slip report following the Contributors guide? (Please explain the situation in the email so that we can help you resolve it quickly!)

theMr17 commented 3 months ago

@DubeySandeep Apologies for the delay, I have raised a schedule slip report through email.

BenHenning commented 3 weeks ago

I think we can close this as the project is essentially finished now. :) Thanks again @theMr17 for all the work on this!

github-actions[bot] commented 3 weeks ago

The issue is reopened because of the following unresolved TODOs: https://github.com/oppia/oppia-android/blob/a1fbe0c98b512eec45bb94804b50095606a5e64b/domain/src/main/java/org/oppia/android/domain/topic/TopicListController.kt#L880 https://github.com/oppia/oppia-android/blob/a1fbe0c98b512eec45bb94804b50095606a5e64b/domain/src/main/java/org/oppia/android/domain/topic/TopicListController.kt#L892 https://github.com/oppia/oppia-android/blob/a1fbe0c98b512eec45bb94804b50095606a5e64b/domain/src/main/java/org/oppia/android/domain/topic/TopicListController.kt#L915 https://github.com/oppia/oppia-android/blob/a1fbe0c98b512eec45bb94804b50095606a5e64b/domain/src/main/java/org/oppia/android/domain/topic/TopicListController.kt#L925 https://github.com/oppia/oppia-android/blob/a1fbe0c98b512eec45bb94804b50095606a5e64b/domain/src/main/java/org/oppia/android/domain/topic/TopicListController.kt#L965

BenHenning commented 3 weeks ago

Hmm what's left on this issue per those TODOs @theMr17 / @adhiamboperes? I'd have expected everything tied to this issue to have been resolved by the end of GSoC.

theMr17 commented 3 weeks ago

@BenHenning, seems like these TODOs got left out. The TODOs are corresponding to some temporary functions in the TopicListController. I am working on getting those removed.