Commit d0749f53 by jinpa Committed by Joe Blaylock

Change text of button from 'final check' to 'submit'

parent f5658e27
...@@ -263,14 +263,14 @@ class CapaModule(CapaFields, XModule): ...@@ -263,14 +263,14 @@ 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 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 "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 "Final Check" if final_check else "Check" return "Submit" if final_check else "Check"
def should_show_check_button(self): def should_show_check_button(self):
""" """
......
...@@ -657,18 +657,18 @@ class CapaModuleTest(unittest.TestCase): ...@@ -657,18 +657,18 @@ class CapaModuleTest(unittest.TestCase):
def test_check_button_name(self): def test_check_button_name(self):
# If last attempt, button name changes to "Final Check" # If last attempt, button name changes to "Submit"
# Just in case, we also check what happens if we have # Just in case, we also check what happens if we have
# more attempts than allowed. # more attempts than allowed.
attempts = random.randint(1, 10) attempts = random.randint(1, 10)
module = CapaFactory.create(attempts=attempts - 1, max_attempts=attempts) module = CapaFactory.create(attempts=attempts - 1, max_attempts=attempts)
self.assertEqual(module.check_button_name(), "Final Check") self.assertEqual(module.check_button_name(), "Submit")
module = CapaFactory.create(attempts=attempts, max_attempts=attempts) module = CapaFactory.create(attempts=attempts, max_attempts=attempts)
self.assertEqual(module.check_button_name(), "Final Check") self.assertEqual(module.check_button_name(), "Submit")
module = CapaFactory.create(attempts=attempts + 1, max_attempts=attempts) module = CapaFactory.create(attempts=attempts + 1, max_attempts=attempts)
self.assertEqual(module.check_button_name(), "Final Check") self.assertEqual(module.check_button_name(), "Submit")
# Otherwise, button name is "Check" # Otherwise, button name is "Check"
module = CapaFactory.create(attempts=attempts - 2, max_attempts=attempts) module = CapaFactory.create(attempts=attempts - 2, max_attempts=attempts)
......
...@@ -106,7 +106,7 @@ Feature: Answer problems ...@@ -106,7 +106,7 @@ Feature: Answer problems
When I answer a "multiple choice" problem "incorrectly" When I answer a "multiple choice" problem "incorrectly"
And I reset the problem And I reset the problem
Then I should see "You have used 2 of 3 submissions" somewhere in the page Then I should see "You have used 2 of 3 submissions" somewhere in the page
And The "Final Check" button does appear And The "Submit" button does appear
When I answer a "multiple choice" problem "correctly" When I answer a "multiple choice" problem "correctly"
Then The "Reset" button does not appear Then The "Reset" button does not appear
......
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