Skip to content

Commit

Permalink
feat: one problem type for new problem editor (#31423)
Browse files Browse the repository at this point in the history
* feat: one problem type for new problem editor

* fix: add comment, fix lint

* fix: remove print statement

* fix: lint fix
  • Loading branch information
connorhaugh authored Dec 12, 2022
1 parent ceab37b commit cec560b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion cms/djangoapps/contentstore/views/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from common.djangoapps.student.auth import has_course_author_access
from common.djangoapps.xblock_django.api import authorable_xblocks, disabled_xblocks
from common.djangoapps.xblock_django.models import XBlockStudioConfigurationFlag
from cms.djangoapps.contentstore.toggles import use_new_problem_editor
from openedx.core.lib.xblock_utils import get_aside_from_xblock, is_xblock_aside
from openedx.core.djangoapps.discussions.models import DiscussionsConfiguration
from xmodule.modulestore.django import modulestore # lint-amnesty, pylint: disable=wrong-import-order
Expand Down Expand Up @@ -353,9 +354,16 @@ def create_support_legend_dict():
)
)

#If using new problem editor, we select problem type inside the editor
# because of this, we only show one problem.
if category == 'problem' and use_new_problem_editor():
templates_for_category = [
template for template in templates_for_category if template['boilerplate_name'] == 'blank_common.yaml'
]

# Add any advanced problem types. Note that these are different xblocks being stored as Advanced Problems,
# currently not supported in libraries .
if category == 'problem' and not library:
if category == 'problem' and not library and not use_new_problem_editor():
disabled_block_names = [block.name for block in disabled_xblocks()]
advanced_problem_types = [advanced_problem_type for advanced_problem_type in ADVANCED_PROBLEM_TYPES
if advanced_problem_type['component'] not in disabled_block_names]
Expand Down

0 comments on commit cec560b

Please sign in to comment.