Commit d3ccc648 by Vik Paruchuri

Remove some unneeded log statements

parent f131b867
...@@ -101,7 +101,6 @@ class CombinedOpenEndedModule(XModule): ...@@ -101,7 +101,6 @@ class CombinedOpenEndedModule(XModule):
if self.state in [self.ASSESSING, self.DONE]: if self.state in [self.ASSESSING, self.DONE]:
current_task_state=self.task_states[len(self.task_states)-1] current_task_state=self.task_states[len(self.task_states)-1]
log.debug(self.task_states)
self.current_task_xml=self.task_xml[self.current_task_number] self.current_task_xml=self.task_xml[self.current_task_number]
current_task_type=self.get_tag_name(self.current_task_xml) current_task_type=self.get_tag_name(self.current_task_xml)
...@@ -115,7 +114,7 @@ class CombinedOpenEndedModule(XModule): ...@@ -115,7 +114,7 @@ class CombinedOpenEndedModule(XModule):
elif current_task_state is None and self.current_task_number>0: elif current_task_state is None and self.current_task_number>0:
last_response, last_score=self.get_last_response(self.current_task_number-1) last_response, last_score=self.get_last_response(self.current_task_number-1)
current_task_state = ('{"state": "assessing", "version": 1, "max_score": ' + str(self._max_score) + ', ' + current_task_state = ('{"state": "assessing", "version": 1, "max_score": ' + str(self._max_score) + ', ' +
'"attempts": 0, "created": True, "history": [{"answer": "' + str(last_response) + '"}]}') '"attempts": 0, "created": "True", "history": [{"answer": "' + str(last_response) + '"}]}')
self.current_task=self_assessment_module.SelfAssessmentModule(self.system, self.location, self.current_task_parsed_xml, self.current_task_descriptor, instance_state=current_task_state) self.current_task=self_assessment_module.SelfAssessmentModule(self.system, self.location, self.current_task_parsed_xml, self.current_task_descriptor, instance_state=current_task_state)
self.task_states.append(self.current_task.get_instance_state()) self.task_states.append(self.current_task.get_instance_state())
self.state=self.ASSESSING self.state=self.ASSESSING
...@@ -131,7 +130,8 @@ class CombinedOpenEndedModule(XModule): ...@@ -131,7 +130,8 @@ class CombinedOpenEndedModule(XModule):
elif current_task_state is None and self.current_task_number>0: elif current_task_state is None and self.current_task_number>0:
last_response, last_score=self.get_last_response(self.current_task_number-1) last_response, last_score=self.get_last_response(self.current_task_number-1)
current_task_state = ('{"state": "assessing", "version": 1, "max_score": ' + str(self._max_score) + ', ' + current_task_state = ('{"state": "assessing", "version": 1, "max_score": ' + str(self._max_score) + ', ' +
'"attempts": 0, "created": True, "history": [{"answer": "' + str(last_response) + '"}]}') '"attempts": 0, "created": "True", "history": [{"answer": "' + str(last_response) + '"}]}')
log.debug(current_task_state)
self.current_task=open_ended_module.OpenEndedModule(self.system, self.location, self.current_task_parsed_xml, self.current_task_descriptor, instance_state=current_task_state) self.current_task=open_ended_module.OpenEndedModule(self.system, self.location, self.current_task_parsed_xml, self.current_task_descriptor, instance_state=current_task_state)
self.task_states.append(self.current_task.get_instance_state()) self.task_states.append(self.current_task.get_instance_state())
self.state=self.ASSESSING self.state=self.ASSESSING
......
...@@ -104,6 +104,7 @@ class OpenEndedModule(): ...@@ -104,6 +104,7 @@ class OpenEndedModule():
# Load instance state # Load instance state
if instance_state is not None: if instance_state is not None:
log.debug(instance_state)
instance_state = json.loads(instance_state) instance_state = json.loads(instance_state)
else: else:
instance_state = {} instance_state = {}
...@@ -116,13 +117,7 @@ class OpenEndedModule(): ...@@ -116,13 +117,7 @@ class OpenEndedModule():
self.state = instance_state.get('state', 'initial') self.state = instance_state.get('state', 'initial')
self.created = instance_state.get('created', False) self.created = instance_state.get('created', "False")
if self.created and self.state == self.ASSESSING:
self.created=False
self.get_score(self.latest_answer(), system)
self.created=False
self.attempts = instance_state.get('attempts', 0) self.attempts = instance_state.get('attempts', 0)
self.max_attempts = int(instance_state.get('attempts', MAX_ATTEMPTS)) self.max_attempts = int(instance_state.get('attempts', MAX_ATTEMPTS))
...@@ -152,6 +147,11 @@ class OpenEndedModule(): ...@@ -152,6 +147,11 @@ class OpenEndedModule():
self._parse(oeparam, prompt, rubric, system) self._parse(oeparam, prompt, rubric, system)
if self.created=="True" and self.state == self.ASSESSING:
self.created="False"
self.get_score(self.latest_answer(), system)
self.created="False"
def _parse(self, oeparam, prompt, rubric, system): def _parse(self, oeparam, prompt, rubric, system):
''' '''
Parse OpenEndedResponse XML: Parse OpenEndedResponse XML:
...@@ -303,7 +303,6 @@ class OpenEndedModule(): ...@@ -303,7 +303,6 @@ class OpenEndedModule():
return True return True
def _update_score(self, score_msg, queuekey, system): def _update_score(self, score_msg, queuekey, system):
log.debug(score_msg)
score_msg = self._parse_score_msg(score_msg, system) score_msg = self._parse_score_msg(score_msg, system)
if not score_msg['valid']: if not score_msg['valid']:
score_msg['feedback'] = 'Invalid grader reply. Please contact the course staff.' score_msg['feedback'] = 'Invalid grader reply. Please contact the course staff.'
...@@ -489,7 +488,6 @@ class OpenEndedModule(): ...@@ -489,7 +488,6 @@ class OpenEndedModule():
'progress' : 'none'/'in_progress'/'done', 'progress' : 'none'/'in_progress'/'done',
<other request-specific values here > } <other request-specific values here > }
''' '''
log.debug(get)
handlers = { handlers = {
'problem_get': self.get_problem, 'problem_get': self.get_problem,
'save_answer': self.save_answer, 'save_answer': self.save_answer,
...@@ -587,7 +585,7 @@ class OpenEndedModule(): ...@@ -587,7 +585,7 @@ class OpenEndedModule():
'state': self.state, 'state': self.state,
'max_score': self._max_score, 'max_score': self._max_score,
'attempts': self.attempts, 'attempts': self.attempts,
'created' : self.created, 'created' : "False",
} }
return json.dumps(state) return json.dumps(state)
......
...@@ -107,7 +107,7 @@ class SelfAssessmentModule(): ...@@ -107,7 +107,7 @@ class SelfAssessmentModule():
# Scores are on scale from 0 to max_score # Scores are on scale from 0 to max_score
self.history = instance_state.get('history', []) self.history = instance_state.get('history', [])
self.created = instance_state.get('created', False) self.created = instance_state.get('created', "False")
self.state = instance_state.get('state', 'initial') self.state = instance_state.get('state', 'initial')
...@@ -491,7 +491,7 @@ class SelfAssessmentModule(): ...@@ -491,7 +491,7 @@ class SelfAssessmentModule():
'state': self.state, 'state': self.state,
'max_score': self._max_score, 'max_score': self._max_score,
'attempts': self.attempts, 'attempts': self.attempts,
'created' : self.created, 'created' : "False",
} }
return json.dumps(state) return json.dumps(state)
......
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