From b4fb0cc463fa58ba4a8bc2f0bbef5da1a7c9e0cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=80?= Date: Mon, 26 Nov 2012 18:34:38 +0200 Subject: [PATCH] fixed line length --- common/lib/capa/capa/responsetypes.py | 41 +++++++++++++++++---------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/common/lib/capa/capa/responsetypes.py b/common/lib/capa/capa/responsetypes.py index 85efd70cee..730cdb12cf 100644 --- a/common/lib/capa/capa/responsetypes.py +++ b/common/lib/capa/capa/responsetypes.py @@ -1718,23 +1718,33 @@ class ImageResponse(LoncapaResponse): which produces an [x,y] coordinate pair. The click is correct if it falls within a region specified. This region is a union of rectangles. - Lon-CAPA requires that each has a inside it. That - doesn't make sense to me (Ike). Instead, let's have it such that - should contain one or more stanzas. Each should specify - a rectangle(s) or region(s), given as an attribute, defining the correct answer. + Lon-CAPA requires that each has a inside it. + That doesn't make sense to me (Ike). Instead, let's have it such that + should contain one or more stanzas. + Each should specify a rectangle(s) or region(s), given as an + attribute, defining the correct answer. - Rectangle(s) are more prioritized over regions due to simplicity and backward compatibility. - In this example regions will be ignored: - + Rectangle(s) are more prioritized over regions due to simplicity and + backward compatibility. In this example regions will be ignored: + - Regions is list of lists [region1, region2, region3, ...] where regionN is ordered list of points: [[1,1], [100,100], [50,50], [20, 70]]. + Regions is list of lists [region1, region2, region3, ...] where regionN + is ordered list of points: [[1,1], [100,100], [50,50], [20, 70]]. """ snippets = [{'snippet': ''' - - - - - + + + + + '''}] response_tag = 'imageresponse' @@ -1748,8 +1758,9 @@ class ImageResponse(LoncapaResponse): correct_map = CorrectMap() expectedset = self.get_answers() - for aid in self.answer_ids: # loop through IDs of fields in our stanza - given = student_answers[aid] # this should be a string of the form '[x,y]' + for aid in self.answer_ids: # loop through IDs of + # fields in our stanza + given = student_answers[aid] # this should be a string of the form '[x,y]' correct_map.set(aid, 'incorrect') if not given: # No answer to parse. Mark as incorrect and move on