Commit 9d7ee511 by cahrens

Delete text_customization.

The button text will be changing to Submit/Submitting,
and therefore the customization is no longer needed.
parent 0014d83c
...@@ -180,12 +180,6 @@ class CapaFields(object): ...@@ -180,12 +180,6 @@ class CapaFields(object):
help=_("Source code for LaTeX and Word problems. This feature is not well-supported."), help=_("Source code for LaTeX and Word problems. This feature is not well-supported."),
scope=Scope.settings scope=Scope.settings
) )
text_customization = Dict(
help=_("String customization substitutions for particular locations"),
scope=Scope.settings
# TODO: someday it should be possible to not duplicate this definition here
# and in inheritance.py
)
use_latex_compiler = Boolean( use_latex_compiler = Boolean(
help=_("Enable LaTeX templates?"), help=_("Enable LaTeX templates?"),
default=False, default=False,
...@@ -408,7 +402,6 @@ class CapaMixin(CapaFields): ...@@ -408,7 +402,6 @@ class CapaMixin(CapaFields):
Usually it is just "Check", but if this is the student's Usually it is just "Check", but if this is the student's
final attempt, change the name to "Final Check". final attempt, change the name to "Final Check".
The text can be customized by the text_customization setting.
""" """
# The logic flow is a little odd so that _('xxx') strings can be found for # The logic flow is a little odd so that _('xxx') strings can be found for
# translation while also running _() just once for each string. # translation while also running _() just once for each string.
...@@ -416,14 +409,6 @@ class CapaMixin(CapaFields): ...@@ -416,14 +409,6 @@ class CapaMixin(CapaFields):
check = _('Check') check = _('Check')
final_check = _('Final Check') final_check = _('Final Check')
# Apply customizations if present
if 'custom_check' in self.text_customization:
check = _(self.text_customization.get('custom_check')) # pylint: disable=translation-of-non-string
if 'custom_final_check' in self.text_customization:
final_check = _(self.text_customization.get('custom_final_check')) # pylint: disable=translation-of-non-string
# TODO: need a way to get the customized words into the list of
# words to be translated
if self.max_attempts is not None and self.attempts >= self.max_attempts - 1: if self.max_attempts is not None and self.attempts >= self.max_attempts - 1:
return final_check return final_check
else: else:
...@@ -436,14 +421,7 @@ class CapaMixin(CapaFields): ...@@ -436,14 +421,7 @@ class CapaMixin(CapaFields):
After the user presses the "check" button, the button will briefly After the user presses the "check" button, the button will briefly
display the value returned by this function until a response is display the value returned by this function until a response is
received by the server. received by the server.
The text can be customized by the text_customization setting.
""" """
# Apply customizations if present
if 'custom_checking' in self.text_customization:
return self.text_customization.get('custom_checking')
_ = self.runtime.service(self, "i18n").ugettext _ = self.runtime.service(self, "i18n").ugettext
return _('Checking...') return _('Checking...')
......
...@@ -212,7 +212,6 @@ class CapaDescriptor(CapaFields, RawDescriptor): ...@@ -212,7 +212,6 @@ class CapaDescriptor(CapaFields, RawDescriptor):
CapaDescriptor.graceperiod, CapaDescriptor.graceperiod,
CapaDescriptor.force_save_button, CapaDescriptor.force_save_button,
CapaDescriptor.markdown, CapaDescriptor.markdown,
CapaDescriptor.text_customization,
CapaDescriptor.use_latex_compiler, CapaDescriptor.use_latex_compiler,
]) ])
return non_editable_fields return non_editable_fields
......
...@@ -125,11 +125,6 @@ class InheritanceMixin(XBlockMixin): ...@@ -125,11 +125,6 @@ class InheritanceMixin(XBlockMixin):
scope=Scope.settings, scope=Scope.settings,
default='', default='',
) )
text_customization = Dict(
display_name=_("Text Customization"),
help=_("Enter string customization substitutions for particular locations."),
scope=Scope.settings,
)
use_latex_compiler = Boolean( use_latex_compiler = Boolean(
display_name=_("Enable LaTeX Compiler"), display_name=_("Enable LaTeX Compiler"),
help=_("Enter true or false. If true, you can use the LaTeX templates for HTML components and advanced Problem components."), help=_("Enter true or false. If true, you can use the LaTeX templates for HTML components and advanced Problem components."),
......
...@@ -1022,46 +1022,6 @@ class CapaModuleTest(unittest.TestCase): ...@@ -1022,46 +1022,6 @@ class CapaModuleTest(unittest.TestCase):
module = CapaFactory.create(attempts=1, max_attempts=10) module = CapaFactory.create(attempts=1, max_attempts=10)
self.assertEqual(module.check_button_checking_name(), "Checking...") self.assertEqual(module.check_button_checking_name(), "Checking...")
module = CapaFactory.create(attempts=10, max_attempts=10)
self.assertEqual(module.check_button_checking_name(), "Checking...")
def test_check_button_name_customization(self):
module = CapaFactory.create(
attempts=1,
max_attempts=10,
text_customization={"custom_check": "Submit", "custom_final_check": "Final Submit"}
)
self.assertEqual(module.check_button_name(), "Submit")
module = CapaFactory.create(attempts=9,
max_attempts=10,
text_customization={"custom_check": "Submit", "custom_final_check": "Final Submit"}
)
self.assertEqual(module.check_button_name(), "Final Submit")
def test_check_button_checking_name_customization(self):
module = CapaFactory.create(
attempts=1,
max_attempts=10,
text_customization={
"custom_check": "Submit",
"custom_final_check": "Final Submit",
"custom_checking": "Checking..."
}
)
self.assertEqual(module.check_button_checking_name(), "Checking...")
module = CapaFactory.create(
attempts=9,
max_attempts=10,
text_customization={
"custom_check": "Submit",
"custom_final_check": "Final Submit",
"custom_checking": "Checking..."
}
)
self.assertEqual(module.check_button_checking_name(), "Checking...")
def test_should_show_check_button(self): def test_should_show_check_button(self):
attempts = random.randint(1, 10) attempts = random.randint(1, 10)
......
...@@ -215,7 +215,6 @@ class AdvancedSettingsPage(CoursePage): ...@@ -215,7 +215,6 @@ class AdvancedSettingsPage(CoursePage):
'show_reset_button', 'show_reset_button',
'static_asset_path', 'static_asset_path',
'teams_configuration', 'teams_configuration',
'text_customization',
'annotation_storage_url', 'annotation_storage_url',
'social_sharing_url', 'social_sharing_url',
'video_bumper', 'video_bumper',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment