oppia-android icon indicating copy to clipboard operation
oppia-android copied to clipboard

[Feature Request]: Add support for the new study guide structure similar to web

Open mon4our opened this issue 6 months ago • 0 comments

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

As part of GSoC 2025, the Oppia website will undergo changes:

  • SubtopicPages having page_contents with subtitled_html (the single content field), written_translations and recorded_voiceovers will be replaced by StudyGuides which will have sections, a list of heading (SubtitledUnicode) and content (SubtitledHtml) pairs. Refer to the implementation section of the proposal for the structure.
  • A section is basically the subtitled_html field broken down into easily digestable parts that would be easier to - understand for the learner and translate for the translators.
  • The written_translations and recorded_voiceovers fields will not be a part of the StudyGuides. written_translations will be managed by its own separate GeneralTranslationModel.

Make the Android app compatible with the new StudyGuides with sections (they should be properly displayed on the android app as they are on web).

Describe the solution you'd like

Have the ability to display sections on the Android app to match with the Oppia website. Mocks for the website.

Update the Android app to use the data formatted as study guides, so that the old Web handler (that arranges them in the form of subtopic pages) can be deprecated.

Describe alternatives you've considered

No response

Additional context

After the Subtopic Page restructure is complete, in the android.py file in the Oppia web repository, there will be two ways to access data for Subtopics:

elif activity_type == constants.ACTIVITY_TYPE_SUBTOPIC:
            for activity_data in activities_data:
                topic_id, subtopic_id = activity_data['id'].split('-')
                study_guide = study_guide_services.get_study_guide_by_id(
                    topic_id,
                    int(subtopic_id),
                    strict=False,
                    version=activity_data.get('version')
                )
                activities.append({
                    'id': activity_data['id'],
                    'version': activity_data.get('version'),
                    'payload': (
                        study_guide.to_subtopic_page_dict_for_android() if study_guide is not None
                        else None)
                })
elif activity_type == constants.ACTIVITY_TYPE_SUBTOPIC_WITH_STUDY_GUIDE:
            for activity_data in activities_data:
                topic_id, subtopic_id = activity_data['id'].split('-')
                study_guide = study_guide_services.get_study_guide_by_id(
                    topic_id,
                    int(subtopic_id),
                    strict=False,
                    version=activity_data.get('version')
                )
                activities.append({
                    'id': activity_data['id'],
                    'version': activity_data.get('version'),
                    'payload': (
                        study_guide.to_dict() if study_guide is not None
                        else None)
                })

The block with ACTIVITY_TYPE_SUBTOPIC will be accessible when activity type is subtopic and will return the old structure of subtopic page.

The block with ACTIVITY_TYPE_SUBTOPIC_WITH_STUDY_GUIDE will be accessible when activity type is subtopicwithstudyguide and will return the new structure of study guide.

While making changes for this feature, make sure to use the ACTIVITY_TYPE_SUBTOPIC_WITH_STUDY_GUIDE block to get access to the new structure. Once completed, inform the Oppia Web LaCE Team and leave a comment/update the issue description on this issue (#22776) stating that the new structure has been utilized on the Android side and the to_subtopic_page_dict_for_android() method can be deprecated.

mon4our avatar Jun 06 '25 01:06 mon4our