Commit 95a224fc by Sarina Canelake

Fix pep8 violations

parent 57311607
...@@ -1147,9 +1147,9 @@ def sympy_check2(): ...@@ -1147,9 +1147,9 @@ def sympy_check2():
messages = [] messages = []
for input_dict in input_list: for input_dict in input_list:
correct.append('correct' correct.append('correct'
if input_dict['ok'] else 'incorrect') if input_dict['ok'] else 'incorrect')
msg = (self.clean_message_html(input_dict['msg']) msg = (self.clean_message_html(input_dict['msg'])
if 'msg' in input_dict else None) if 'msg' in input_dict else None)
messages.append(msg) messages.append(msg)
# Otherwise, we do not recognize the dictionary # Otherwise, we do not recognize the dictionary
...@@ -1174,7 +1174,7 @@ def sympy_check2(): ...@@ -1174,7 +1174,7 @@ def sympy_check2():
for k in range(len(idset)): for k in range(len(idset)):
npoints = (self.maxpoints[idset[k]] npoints = (self.maxpoints[idset[k]]
if correct[k] == 'correct' else 0) if correct[k] == 'correct' else 0)
correct_map.set(idset[k], correct[k], msg=messages[k], correct_map.set(idset[k], correct[k], msg=messages[k],
npoints=npoints) npoints=npoints)
return correct_map return correct_map
...@@ -1990,7 +1990,6 @@ class ImageResponse(LoncapaResponse): ...@@ -1990,7 +1990,6 @@ class ImageResponse(LoncapaResponse):
self.ielements = self.inputfields self.ielements = self.inputfields
self.answer_ids = [ie.get('id') for ie in self.ielements] self.answer_ids = [ie.get('id') for ie in self.ielements]
def get_score(self, student_answers): def get_score(self, student_answers):
correct_map = CorrectMap() correct_map = CorrectMap()
expectedset = self.get_mapped_answers() expectedset = self.get_mapped_answers()
...@@ -2059,7 +2058,7 @@ class ImageResponse(LoncapaResponse): ...@@ -2059,7 +2058,7 @@ class ImageResponse(LoncapaResponse):
rectangles (dict) - a map of inputs to the defined rectangle for that input rectangles (dict) - a map of inputs to the defined rectangle for that input
regions (dict) - a map of inputs to the defined region for that input regions (dict) - a map of inputs to the defined region for that input
''' '''
answers = ( answers = (
dict([(ie.get('id'), ie.get( dict([(ie.get('id'), ie.get(
'rectangle')) for ie in self.ielements]), 'rectangle')) for ie in self.ielements]),
dict([(ie.get('id'), ie.get('regions')) for ie in self.ielements])) dict([(ie.get('id'), ie.get('regions')) for ie in self.ielements]))
...@@ -2081,8 +2080,6 @@ class ImageResponse(LoncapaResponse): ...@@ -2081,8 +2080,6 @@ class ImageResponse(LoncapaResponse):
answers[ie_id] = (ie.get('rectangle'), ie.get('regions')) answers[ie_id] = (ie.get('rectangle'), ie.get('regions'))
return answers return answers
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
......
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