prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  InteractiveMap interaction: in the rule editor, clicks on the map are not displayed correctly
  Create an exploration with a map interaction. Add a rule and click on the map to choose the point the rule applies to. A marker should appear where you click, but it does not.
  
  Save and close the rule, then re-open it. The marker is now displayed correctly.
  
  Create a new rule. Before being clicked on the map should be blank, but instead it displays the position of the marker from the previous rule.
  
  
  </issue>
  <code>
  [start of extensions/dependencies/dependencies_config.py]
  1 # coding: utf-8
  2 #
  3 # Copyright 2014 The Oppia Authors. All Rights Reserved.
  4 #
  5 # Licensed under the Apache License, Version 2.0 (the "License");
  6 # you may not use this file except in compliance with the License.
  7 # You may obtain a copy of the License at
  8 #
  9 #      http://www.apache.org/licenses/LICENSE-2.0
  10 #
  11 # Unless required by applicable law or agreed to in writing, software
  12 # distributed under the License is distributed on an "AS-IS" BASIS,
  13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14 # See the License for the specific language governing permissions and
  15 # limitations under the License.
  16 
  17 """Configuration for JavaScript library dependencies."""
  18 
  19 
  20 # A dict mapping dependency ids to the Angular module names they
  21 # should insert when the Angular app is first initialized.
  22 DEPENDENCIES_TO_ANGULAR_MODULES_DICT = {
  23     'codemirror': ['ui.codemirror'],
  24     'google_maps': ['ui.map'],
  25     'guppy': [],
  26     'logic_proof': [],
  27     'math_expressions': [],
  28     'midijs': [],
  29     'pencilcode': [],
  30     'skulpt': [],
  31 }
  32
  [end of extensions/dependencies/dependencies_config.py]
  [start of extensions/interactions/InteractiveMap/InteractiveMap.py]
  1 # coding: utf-8
  2 #
  3 # Copyright 2014 The Oppia Authors. All Rights Reserved.
  4 #
  5 # Licensed under the Apache License, Version 2.0 (the "License");
  6 # you may not use this file except in compliance with the License.
  7 # You may obtain a copy of the License at
  8 #
  9 #      http://www.apache.org/licenses/LICENSE-2.0
  10 #
  11 # Unless required by applicable law or agreed to in writing, softwar
  12 # distributed under the License is distributed on an "AS-IS" BASIS,
  13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14 # See the License for the specific language governing permissions and
  15 # limitations under the License.
  16 
  17 """Python configuration for InteractiveMap interaction."""
  18 
  19 from extensions.interactions import base
  20 
  21 
  22 class InteractiveMap(base.BaseInteraction):
  23     """Interaction for pinpointing a location on a map."""
  24 
  25     name = 'World Map'
  26     description = 'Allows learners to specify a position on a world map.'
  27     display_mode = base.DISPLAY_MODE_SUPPLEMENTAL
  28     is_trainable = False
  29     _dependency_ids = ['google_maps']
  30     answer_type = 'CoordTwoDim'
  31     instructions = 'Click on the map'
  32     narrow_instructions = 'View map'
  33     needs_summary = True
  34     # There needs to be a way to pass marker location so that an answer can be
  35     # conveyed meaningfully to the learner. Once this issue is fixed,
  36     # InteractiveMap interaction can be supported by the solution feature.
  37     can_have_solution = False
  38     show_generic_submit_button = False
  39 
  40     _customization_arg_specs = [{
  41         'name': 'latitude',
  42         'description': 'Starting center latitude (-90 to 90)',
  43         'schema': {
  44             'type': 'float',
  45             'validators': [{
  46                 'id': 'is_at_least',
  47                 'min_value': -90.0,
  48             }, {
  49                 'id': 'is_at_most',
  50                 'max_value': 90.0,
  51             }]
  52         },
  53         'default_value': 0.0,
  54     }, {
  55         'name': 'longitude',
  56         'description': 'Starting center longitude (-180 to 180)',
  57         'schema': {
  58             'type': 'float',
  59             'validators': [{
  60                 'id': 'is_at_least',
  61                 'min_value': -180.0,
  62             }, {
  63                 'id': 'is_at_most',
  64                 'max_value': 180.0,
  65             }]
  66         },
  67         'default_value': 0.0,
  68     }, {
  69         'name': 'zoom',
  70         'description': 'Starting zoom level (0 shows the entire earth)',
  71         'schema': {
  72             'type': 'float',
  73         },
  74         'default_value': 0.0,
  75     }]
  76 
  77     _answer_visualization_specs = [{
  78         # Table with answer counts for top N answers.
  79         'id': 'FrequencyTable',
  80         'options': {
  81             'column_headers': ['Answer', 'Count'],
  82             'title': 'Top 10 answers',
  83         },
  84         'calculation_id': 'Top10AnswerFrequencies',
  85         'addressed_info_is_supported': True,
  86     }]
  87
  [end of extensions/interactions/InteractiveMap/InteractiveMap.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/extensions/dependencies/dependencies_config.py b/extensions/dependencies/dependencies_config.py
  --- a/extensions/dependencies/dependencies_config.py
  +++ b/extensions/dependencies/dependencies_config.py
  @@ -21,7 +21,7 @@
   # should insert when the Angular app is first initialized.
   DEPENDENCIES_TO_ANGULAR_MODULES_DICT = {
       'codemirror': ['ui.codemirror'],
  -    'google_maps': ['ui.map'],
  +    'ui_leaflet': ['ui-leaflet'],
       'guppy': [],
       'logic_proof': [],
       'math_expressions': [],
  diff --git a/extensions/interactions/InteractiveMap/InteractiveMap.py b/extensions/interactions/InteractiveMap/InteractiveMap.py
  --- a/extensions/interactions/InteractiveMap/InteractiveMap.py
  +++ b/extensions/interactions/InteractiveMap/InteractiveMap.py
  @@ -26,7 +26,7 @@
       description = 'Allows learners to specify a position on a world map.'
       display_mode = base.DISPLAY_MODE_SUPPLEMENTAL
       is_trainable = False
  -    _dependency_ids = ['google_maps']
  +    _dependency_ids = ['ui_leaflet']
       answer_type = 'CoordTwoDim'
       instructions = 'Click on the map'
       narrow_instructions = 'View map'
  
verification_info: {"golden_diff": "diff --git a/extensions/dependencies/dependencies_config.py b/extensions/dependencies/dependencies_config.py\n--- a/extensions/dependencies/dependencies_config.py\n+++ b/extensions/dependencies/dependencies_config.py\n@@ -21,7 +21,7 @@\n # should insert when the Angular app is first initialized.\n DEPENDENCIES_TO_ANGULAR_MODULES_DICT = {\n     'codemirror': ['ui.codemirror'],\n-    'google_maps': ['ui.map'],\n+    'ui_leaflet': ['ui-leaflet'],\n     'guppy': [],\n     'logic_proof': [],\n     'math_expressions': [],\ndiff --git a/extensions/interactions/InteractiveMap/InteractiveMap.py b/extensions/interactions/InteractiveMap/InteractiveMap.py\n--- a/extensions/interactions/InteractiveMap/InteractiveMap.py\n+++ b/extensions/interactions/InteractiveMap/InteractiveMap.py\n@@ -26,7 +26,7 @@\n     description = 'Allows learners to specify a position on a world map.'\n     display_mode = base.DISPLAY_MODE_SUPPLEMENTAL\n     is_trainable = False\n-    _dependency_ids = ['google_maps']\n+    _dependency_ids = ['ui_leaflet']\n     answer_type = 'CoordTwoDim'\n     instructions = 'Click on the map'\n     narrow_instructions = 'View map'\n", "issue": "InteractiveMap interaction: in the rule editor, clicks on the map are not displayed correctly\nCreate an exploration with a map interaction. Add a rule and click on the map to choose the point the rule applies to. A marker should appear where you click, but it does not.\n\nSave and close the rule, then re-open it. The marker is now displayed correctly.\n\nCreate a new rule. Before being clicked on the map should be blank, but instead it displays the position of the marker from the previous rule.\n\n", "before_files": [{"content": "# coding: utf-8\n#\n# Copyright 2014 The Oppia Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS-IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"Configuration for JavaScript library dependencies.\"\"\"\n\n\n# A dict mapping dependency ids to the Angular module names they\n# should insert when the Angular app is first initialized.\nDEPENDENCIES_TO_ANGULAR_MODULES_DICT = {\n    'codemirror': ['ui.codemirror'],\n    'google_maps': ['ui.map'],\n    'guppy': [],\n    'logic_proof': [],\n    'math_expressions': [],\n    'midijs': [],\n    'pencilcode': [],\n    'skulpt': [],\n}\n", "path": "extensions/dependencies/dependencies_config.py"}, {"content": "# coding: utf-8\n#\n# Copyright 2014 The Oppia Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, softwar\n# distributed under the License is distributed on an \"AS-IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"Python configuration for InteractiveMap interaction.\"\"\"\n\nfrom extensions.interactions import base\n\n\nclass InteractiveMap(base.BaseInteraction):\n    \"\"\"Interaction for pinpointing a location on a map.\"\"\"\n\n    name = 'World Map'\n    description = 'Allows learners to specify a position on a world map.'\n    display_mode = base.DISPLAY_MODE_SUPPLEMENTAL\n    is_trainable = False\n    _dependency_ids = ['google_maps']\n    answer_type = 'CoordTwoDim'\n    instructions = 'Click on the map'\n    narrow_instructions = 'View map'\n    needs_summary = True\n    # There needs to be a way to pass marker location so that an answer can be\n    # conveyed meaningfully to the learner. Once this issue is fixed,\n    # InteractiveMap interaction can be supported by the solution feature.\n    can_have_solution = False\n    show_generic_submit_button = False\n\n    _customization_arg_specs = [{\n        'name': 'latitude',\n        'description': 'Starting center latitude (-90 to 90)',\n        'schema': {\n            'type': 'float',\n            'validators': [{\n                'id': 'is_at_least',\n                'min_value': -90.0,\n            }, {\n                'id': 'is_at_most',\n                'max_value': 90.0,\n            }]\n        },\n        'default_value': 0.0,\n    }, {\n        'name': 'longitude',\n        'description': 'Starting center longitude (-180 to 180)',\n        'schema': {\n            'type': 'float',\n            'validators': [{\n                'id': 'is_at_least',\n                'min_value': -180.0,\n            }, {\n                'id': 'is_at_most',\n                'max_value': 180.0,\n            }]\n        },\n        'default_value': 0.0,\n    }, {\n        'name': 'zoom',\n        'description': 'Starting zoom level (0 shows the entire earth)',\n        'schema': {\n            'type': 'float',\n        },\n        'default_value': 0.0,\n    }]\n\n    _answer_visualization_specs = [{\n        # Table with answer counts for top N answers.\n        'id': 'FrequencyTable',\n        'options': {\n            'column_headers': ['Answer', 'Count'],\n            'title': 'Top 10 answers',\n        },\n        'calculation_id': 'Top10AnswerFrequencies',\n        'addressed_info_is_supported': True,\n    }]\n", "path": "extensions/interactions/InteractiveMap/InteractiveMap.py"}]}