If this is invalid JSON, `json.loads` will throw a ValueError.  If this is what you want, you should state this in the docstring for both `_reset_module_attempts()` and `reset_student_attempts()`.  If not, catch the exception and handle accordingly.