def _reset_module_attempts(studentmodule):
 problem_state = json.loads(studentmodule.state)
 problem_state['attempts'] = 0
 studentmodule.state = json.dumps(problem_state)
 studentmodule.save()

def _reset_module_attempts ( studentmodule ) : problem_state = json . loads ( studentmodule . state ) problem_state [ 'attempts' ] = 0 studentmodule . state = json . dumps ( problem_state ) studentmodule . save ( )
reset the number of attempts on a studentmodule .