Commit 142493ed by Sef Kloninger

Merge branch 'jinpa/check-off-edx-west-release' of github.com:edx/edx-platform…

Merge branch 'jinpa/check-off-edx-west-release' of github.com:edx/edx-platform into edx-west/release-candidate-20130806
parents 7e02d435 1f6fe321
...@@ -340,15 +340,15 @@ class CapaModule(CapaFields, XModule): ...@@ -340,15 +340,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 Usually it is just "Submit", but if this is the student's
final attempt, change the name to "Submit" final attempt, change the name to "Final Submit" so they
know it's their last one.
""" """
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 Submit" if final_check else "Submit"
return "Submit" if final_check else "Check"
def should_show_check_button(self): def should_show_check_button(self):
""" """
......
...@@ -815,19 +815,18 @@ class CapaModuleTest(unittest.TestCase): ...@@ -815,19 +815,18 @@ 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"
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(), "Final 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(), "Final Submit")
# If no limit on attempts, then always show "Check" # If no limit on attempts
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(), "Final 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