From 5e433cda2e7b061a06500a0a3e4e1d4d7cfafcf1 Mon Sep 17 00:00:00 2001 From: Will Daly Date: Thu, 14 Mar 2013 14:43:04 -0400 Subject: [PATCH] Clarified comments about the logic of showing the save button --- common/lib/xmodule/xmodule/capa_module.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/common/lib/xmodule/xmodule/capa_module.py b/common/lib/xmodule/xmodule/capa_module.py index 2856a942e9..8434f41cff 100644 --- a/common/lib/xmodule/xmodule/capa_module.py +++ b/common/lib/xmodule/xmodule/capa_module.py @@ -312,14 +312,23 @@ class CapaModule(XModule): # If the student has unlimited attempts, and their answers # are not randomized, then we do not need a save button - # because they can use the "Check" button + # because they can use the "Check" button without consequences. + # + # The consequences we want to avoid are: + # * Using up an attempt (if max_attempts is set) + # * Changing the current problem, and no longer being + # able to view it (if rerandomize is "always") + # + # In those cases. the if statement below is false, + # and the save button can still be displayed. + # if self.max_attempts is None and self.rerandomize != "always": return False # If the problem is closed (and not a survey question with max_attempts==0), - # then do NOT show the reset button + # then do NOT show the save button # If we're waiting for the user to reset a randomized problem - # then do NOT show the reset button + # then do NOT show the save button elif (self.closed() and not is_survey_question) or needs_reset: return False else: