feat: change problem default display name (#33240)

This commit is contained in:
Kristin Aoki
2023-09-13 11:08:48 -04:00
committed by GitHub
parent 3b869dd041
commit f9c1af775c
5 changed files with 5 additions and 5 deletions

View File

@@ -147,7 +147,7 @@ def xblock_type_display_name(xblock, default_display_name=None):
elif category == 'vertical':
return _('Unit')
elif category == 'problem':
# The problem XBlock's display_name.default is not helpful ("Blank Advanced Problem") but changing it could have
# The problem XBlock's display_name.default is not helpful ("Blank Problem") but changing it could have
# too many ripple effects in other places, so we have a special case for capa problems here.
# Note: With a ProblemBlock instance, we could actually check block.problem_types to give a more specific
# description like "Multiple Choice Problem", but that won't work if our 'block' argument is just the block_type

View File

@@ -336,7 +336,7 @@ def get_component_templates(courselike, library=False): # lint-amnesty, pylint:
template_id = "peer-assessment"
elif category == 'problem':
# Override generic "Problem" name to describe this blank template:
display_name = _("Blank Advanced Problem")
display_name = _("Blank Problem")
templates_for_category.append(
create_template_dict(display_name, category, support_level_without_template, template_id, 'advanced')
)

View File

@@ -2779,7 +2779,7 @@ class TestComponentTemplates(CourseTestCase):
self._verify_basic_component("video", "Video", "us")
problem_templates = self.get_templates_of_type("problem")
problem_no_boilerplate = self.get_template(
problem_templates, "Blank Advanced Problem"
problem_templates, "Blank Problem"
)
self.assertIsNotNone(problem_no_boilerplate)
self.assertEqual("us", problem_no_boilerplate["support_level"])

View File

@@ -313,7 +313,7 @@ class ContentLibrariesTestMixin:
block_data = self._add_block_to_library(lib_id, "problem", "problem1")
self.assertDictContainsEntries(block_data, {
"id": "lb:CL-TEST:testlib1:problem:problem1",
"display_name": "Blank Advanced Problem",
"display_name": "Blank Problem",
"block_type": "problem",
"has_unpublished_changes": True,
})

View File

@@ -168,7 +168,7 @@ class ProblemBlock(
scope=Scope.settings,
# it'd be nice to have a useful default but it screws up other things; so,
# use display_name_with_default for those
default=_("Blank Advanced Problem")
default=_("Blank Problem")
)
attempts = Integer(
help=_("Number of attempts taken by the student on this problem"),