Commit fa66184d by jinpa

change label from "check" to "submit"

parent 5d096580
...@@ -320,15 +320,15 @@ class CapaModule(CapaFields, XModule): ...@@ -320,15 +320,15 @@ class CapaModule(CapaFields, XModule):
""" """
Determine the name for the "check" button. Determine the name for the "check" button.
Usually it is just "Check", but if this is the student's It could have different names depending on whether it's the student's
final attempt, change the name to "Submit" final attempt or not, but right now it doesn't - it's always "Submit"
""" """
if self.max_attempts is not None: if self.max_attempts is not None:
final_check = (self.attempts >= self.max_attempts - 1) final_check = (self.attempts >= self.max_attempts - 1)
else: else:
final_check = False final_check = False
return "Submit" if final_check else "Check" return "Submit" if final_check else "Submit"
def should_show_check_button(self): def should_show_check_button(self):
""" """
......
...@@ -815,19 +815,19 @@ class CapaModuleTest(unittest.TestCase): ...@@ -815,19 +815,19 @@ class CapaModuleTest(unittest.TestCase):
module = CapaFactory.create(attempts=attempts + 1, max_attempts=attempts) module = CapaFactory.create(attempts=attempts + 1, max_attempts=attempts)
self.assertEqual(module.check_button_name(), "Submit") self.assertEqual(module.check_button_name(), "Submit")
# Otherwise, button name is "Check" # We've got the button name set to "Submit" even if it's not the final attempt
module = CapaFactory.create(attempts=attempts - 2, max_attempts=attempts) module = CapaFactory.create(attempts=attempts - 2, max_attempts=attempts)
self.assertEqual(module.check_button_name(), "Check") self.assertEqual(module.check_button_name(), "Submit")
module = CapaFactory.create(attempts=attempts - 3, max_attempts=attempts) module = CapaFactory.create(attempts=attempts - 3, max_attempts=attempts)
self.assertEqual(module.check_button_name(), "Check") self.assertEqual(module.check_button_name(), "Submit")
# If no limit on attempts, then always show "Check" # If no limit on attempts, still show "Submit"
module = CapaFactory.create(attempts=attempts - 3) module = CapaFactory.create(attempts=attempts - 3)
self.assertEqual(module.check_button_name(), "Check") self.assertEqual(module.check_button_name(), "Submit")
module = CapaFactory.create(attempts=0) module = CapaFactory.create(attempts=0)
self.assertEqual(module.check_button_name(), "Check") self.assertEqual(module.check_button_name(), "Submit")
def test_should_show_check_button(self): def test_should_show_check_button(self):
......
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