Commit ca1e9f95 by Tim Krones

Don't allow num_attempts to be larger than max_attempts.

parent 95c94869
...@@ -979,7 +979,8 @@ class MentoringWithExplicitStepsBlock(BaseMentoringBlock, StudioContainerWithNes ...@@ -979,7 +979,8 @@ class MentoringWithExplicitStepsBlock(BaseMentoringBlock, StudioContainerWithNes
@XBlock.json_handler @XBlock.json_handler
def update_num_attempts(self, data, suffix=''): def update_num_attempts(self, data, suffix=''):
self.num_attempts += 1 if self.num_attempts < self.max_attempts:
self.num_attempts += 1
return { return {
'num_attempts': self.num_attempts 'num_attempts': self.num_attempts
} }
......
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