Commit 9b57ef0b by Vik Paruchuri

Pep8 fixes

parent a06226aa
...@@ -5,11 +5,11 @@ from xmodule.timeinfo import TimeInfo ...@@ -5,11 +5,11 @@ from xmodule.timeinfo import TimeInfo
from xmodule.capa_module import ComplexEncoder from xmodule.capa_module import ComplexEncoder
from xmodule.progress import Progress from xmodule.progress import Progress
from xmodule.stringify import stringify_children from xmodule.stringify import stringify_children
import self_assessment_module from xmodule.open_ended_grading_classes import self_assessment_module
import open_ended_module from xmodule.open_ended_grading_classes import open_ended_module
from functools import partial from functools import partial
from .combined_open_ended_rubric import CombinedOpenEndedRubric, GRADER_TYPE_IMAGE_DICT, HUMAN_GRADER_TYPE, LEGEND_LIST from .combined_open_ended_rubric import CombinedOpenEndedRubric, GRADER_TYPE_IMAGE_DICT, HUMAN_GRADER_TYPE, LEGEND_LIST
from peer_grading_service import PeerGradingService, MockPeerGradingService, GradingServiceError from xmodule.open_ended_grading_classes.peer_grading_service import PeerGradingService, MockPeerGradingService, GradingServiceError
log = logging.getLogger("mitx.courseware") log = logging.getLogger("mitx.courseware")
...@@ -547,6 +547,11 @@ class CombinedOpenEndedV1Module(): ...@@ -547,6 +547,11 @@ class CombinedOpenEndedV1Module():
return last_response_dict return last_response_dict
def extract_human_name_from_task(self, task_xml): def extract_human_name_from_task(self, task_xml):
"""
Given the xml for a task, pull out the human name for it.
Input: xml string
Output: a human readable task name (ie Self Assessment)
"""
tree = etree.fromstring(task_xml) tree = etree.fromstring(task_xml)
payload = tree.xpath("/openended/openendedparam/grader_payload") payload = tree.xpath("/openended/openendedparam/grader_payload")
if len(payload) == 0: if len(payload) == 0:
...@@ -644,7 +649,13 @@ class CombinedOpenEndedV1Module(): ...@@ -644,7 +649,13 @@ class CombinedOpenEndedV1Module():
all_responses = [] all_responses = []
success, can_see_rubric, error = self.check_if_student_has_done_needed_grading() success, can_see_rubric, error = self.check_if_student_has_done_needed_grading()
if not can_see_rubric: if not can_see_rubric:
return {'html' : self.system.render_template('{0}/combined_open_ended_hidden_results.html'.format(self.TEMPLATE_DIR), {'error' : error}), 'success' : True, 'hide_reset' : True} return {
'html': self.system.render_template(
'{0}/combined_open_ended_hidden_results.html'.format(self.TEMPLATE_DIR),
{'error': error}),
'success': True,
'hide_reset': True
}
contexts = [] contexts = []
rubric_number = self.current_task_number rubric_number = self.current_task_number
...@@ -717,6 +728,9 @@ class CombinedOpenEndedV1Module(): ...@@ -717,6 +728,9 @@ class CombinedOpenEndedV1Module():
return json.dumps(d, cls=ComplexEncoder) return json.dumps(d, cls=ComplexEncoder)
def get_current_state(self, data): def get_current_state(self, data):
"""
Gets the current state of the module.
"""
return self.get_context() return self.get_context()
def get_last_response_ajax(self, data): def get_last_response_ajax(self, data):
...@@ -866,7 +880,6 @@ class CombinedOpenEndedV1Module(): ...@@ -866,7 +880,6 @@ class CombinedOpenEndedV1Module():
if len(score_mat) > 0: if len(score_mat) > 0:
# Currently, assume that the final step is the correct one, and that those are the final scores. # Currently, assume that the final step is the correct one, and that those are the final scores.
# This will change in the future, which is why the machinery above exists to extract all scores on all steps # This will change in the future, which is why the machinery above exists to extract all scores on all steps
# TODO: better final score handling.
scores = score_mat[-1] scores = score_mat[-1]
score = max(scores) score = max(scores)
else: else:
......
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