openedx / openedx/frontend-app-authoring

[Course unit page] Problems with Content Experiment functional on the Course unit page

Open
#1,003 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
17
Forks
218
Avg merge
9d 20h
Merged PRs (30d)
20

Description

If contentstore.new_studio_mfe.use_new_unit_page flag is enabled, the user faces the following problems when working with experiment groups:

  • 500 error if a user tries to add Content Experiment xblock in frontend-app-course-authoring MFE:
    image
  • Content Experiment xblock is rendered incorrectly if xblock has been added in Legacy:

Content Experiment xblock rendering in frontend-app-course-authoring MFE
image

Content Experiment xblock rendering in Legacy
image

  • User cannot edit Content Experiment xblock
  • User can delete Content Experiment xblock
  • User can proceed to the Content Experiment, page only from the Group Configurations page
500 error on the Learning MFE page

It occurs when staff adds a content experiment xblock to a unit and publishes the changes. When the user tries to get to the Learning MFE page he gets an error.

The error occurs only when a group has not been added to the block.

image

Logs:

edx.devstack.lms  |   File "/edx/app/edxapp/edx-platform/openedx/core/djangoapps/courseware_api/views.py", line 615, in get
edx.devstack.lms  |     return Response(sequence.get_metadata(view=view, context=context))
edx.devstack.lms  |   File "/edx/app/edxapp/edx-platform/xmodule/seq_block.py", line 375, in get_metadata
edx.devstack.lms  |     meta = self._get_render_metadata(context, children, prereq_met, prereq_meta_info, banner_text, view)
edx.devstack.lms  |   File "/edx/app/edxapp/edx-platform/xmodule/seq_block.py", line 553, in _get_render_metadata
edx.devstack.lms  |     blocks = self._render_student_view_for_blocks(context, children, fragment, view) if prereq_met else []
edx.devstack.lms  |   File "/edx/app/edxapp/edx-platform/xmodule/seq_block.py", line 763, in _render_student_view_for_blocks
edx.devstack.lms  |     item_type = get_icon(block)
edx.devstack.lms  |   File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/edx_django_utils/plugins/pluggable_override.py", line 77, in wrapper
edx.devstack.lms  |     return prev_fn(*args, **kwargs)
edx.devstack.lms  |   File "/edx/app/edxapp/edx-platform/openedx/core/lib/xblock_utils/__init__.py", line 522, in get_icon
edx.devstack.lms  |     return block.get_icon_class()
edx.devstack.lms  |   File "/edx/app/edxapp/edx-platform/xmodule/vertical_block.py", line 254, in get_icon_class
edx.devstack.lms  |     child_classes = {child.get_icon_class() for child in self.get_children()}
edx.devstack.lms  |   File "/edx/app/edxapp/edx-platform/xmodule/vertical_block.py", line 254, in <setcomp>
edx.devstack.lms  |     child_classes = {child.get_icon_class() for child in self.get_children()}
edx.devstack.lms  |   File "/edx/app/edxapp/edx-platform/xmodule/split_test_block.py", line 398, in get_icon_class
edx.devstack.lms  |     return self.child.get_icon_class() if self.child else 'other'
edx.devstack.lms  |   File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/django/utils/functional.py", line 57, in __get__
edx.devstack.lms  |     res = instance.__dict__[self.name] = self.func(instance)
edx.devstack.lms  |   File "/edx/app/edxapp/edx-platform/xmodule/split_test_block.py", line 176, in child
edx.devstack.lms  |     if self.child_block is not None:
edx.devstack.lms  |   File "/edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/django/utils/functional.py", line 57, in __get__
edx.devstack.lms  |     res = instance.__dict__[self.name] = self.func(instance)
edx.devstack.lms  |   File "/edx/app/edxapp/edx-platform/xmodule/split_test_block.py", line 166, in child_block
edx.devstack.lms  |     child_blocks = self.get_child_blocks()
edx.devstack.lms  |   File "/edx/app/edxapp/edx-platform/xmodule/split_test_block.py", line 216, in get_child_blocks
edx.devstack.lms  |     group_id = self.get_group_id()
edx.devstack.lms  |   File "/edx/app/edxapp/edx-platform/xmodule/split_test_block.py", line 245, in get_group_id
edx.devstack.lms  |     return partitions_service.get_user_group_id_for_partition(user, self.user_partition_id)
edx.devstack.lms  |   File "/edx/app/edxapp/edx-platform/xmodule/partitions/partitions_service.py", line 146, in get_user_group_id_for_partition
edx.devstack.lms  |     raise ValueError(
edx.devstack.lms  | ValueError: Configuration problem!  No user_partition with id -1 in course course-v1:2u+1+1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce with contentstore.new_studio_mfe.use_new_unit_page enabled, using the Content Experiment flows described in frontend-app-course-authoring. Start with openedx/core/djangoapps/courseware_api/views.py and the xmodule/seq_block.py, vertical_block.py, and split_test_block.py paths shown in the trace. Done means the block can be added, rendered, edited, deleted, opened, and published without the reported errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
backend, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.