Note
EdX does not support this problem type.
In an image mapped input problem, also known as a “pointing on a picture” problem, students click inside a defined region in an image. You define this region by including coordinates in the body of the problem.
You can specify the following types of regions.
Note
When you create a problem that contains an image, you must include alt text for your image to make the image accessible. For more information about alt text, see Use Best Practices for Describing Images.
To create an image mapped input problem, follow these steps.
To create an image mapped input problem, you need the following elements.
- The height and width of the image in pixels.
- Coordinate pairs that define the region or regions where you want learners to click.
To collect the information you need about your image, use an image editing tool such as Microsoft Paint.
Note
The coordinate pairs for all images start with (0,0) in the upper-left corner of the image and increase in value toward the lower-right corner, similar to the progression of reading English.
To specify a rectangular region, you need two coordinate pairs: the upper-left corner and the lower-right corner.
To specify more than one rectangle, you need the coordinate pairs for the upper-left and lower-right corners of each rectangle.
To specify an irregular region, you need three or more coordinate pairs. Studio creates the simplest possible shape based on these coordinate pairs. You can enter the coordinate pairs in any order.
For example, for a triangle, you need three coordinate pairs. For an octagon, you need eight coordinate pairs.
<imageinput>
element, follow these steps.src
attribute with the file
path for your image.width
and height
attributes
with the dimensions for your image.rectangle
attribute to reflect the shape and size
of the region that you want to specify. For more information, see
Specify a Rectangular Region, Specify Multiple Rectangular Regions, or Specify an Irregular Region.To specify a rectangular region, edit the rectangle
attribute in the
<imageinput>
element.
For example, the following rectangle
attribute creates one rectangle from
two coordinate pairs:
rectangle="(338,98)-(412,168)"
Problem Code:
<problem>
<p>What country is home to the Pyramids as well as the cities of
Cairo and Memphis? Click the country on the map below.</p>
<imageresponse>
<imageinput src="/static/Africa.png" width="600" height="638"
rectangle="(338,98)-(412,168)" alt="Map of Africa" />
</imageresponse>
<solution>
<div class="detailed-solution">
<p>Explanation</p>
<p>Egypt is home to not only the Pyramids, Cairo, and Memphis, but also the
Sphinx and the ancient Royal Library of Alexandria.</p>
</div>
</solution>
</problem>
You can specify more than one rectangular region in an image.
To specify multiple rectangular regions, edit the rectangle
attribute in
the <imageinput>
element.
For example, the following rectangle
attribute creates three rectangles:
rectangle="(62,94)-(262,137);(306,41)-(389,173);(89,211)-(187,410)"
Problem Code:
<problem>
<p>In the following image, click inside any of the rectangles.</p>
<imageresponse>
<imageinput src="/static/imageresponse_multipleregions.png" width="450"
height="450" rectangle="(62,94)-(262,137);(306,41)-(389,173);(89,211)-
(187,410)" alt="Three rectangles on a white background" />
</imageresponse>
</problem>
You can specify one non-rectangular region.
To specify an irregular region, edit the rectangle
attribute in the
<imageinput>
element.
rectangle
to region
.For example, the following regions
attribute creates a pentagon.
regions="[[219,86], [305,192], [305,381], [139,381], [139,192]]"
Problem Code:
<problem>
<p>In the following image, click inside the pentagon.</p>
<imageresponse>
<imageinput src="/static/imageresponse_irregularregions.jpg" width="600"
height="204" regions="[[219,86], [305,192], [305,381], [139,381],
[139,192]]" alt ="A series of 10 shapes including a circle, triangle,
trapezoid, pentagon, star, and octagon" />
</imageresponse>
</problem>
<problem>
<p>Problem text</p>
<imageresponse>
<imageinput src="IMAGE FILE PATH" width="NUMBER" height="NUMBER"
rectangle="(X-AXIS,Y-AXIS)-(X-AXIS,Y-AXIS)" alt="DESCRIPTION OF
IMAGE" />
</imageresponse>
</problem>
<imageresponse>
: Indicates that the problem is an image mapped input
problem.<imageinput>
: Specifies the image file and the region in the file that
the learner must click.Tag: <imageresponse>
Indicates that the problem is an image mapped input problem.
Attributes
(none)
Children
<imageinput>
Tag: <imageinput>
Specifies the image file and the region in the file where learners must click.
Attributes
Attribute Description src
(required)The URL of the image height
(required)The height of the image, in pixels width
(required)The width of the image, in pixels rectangle
(required) (or, for irregular regions,region
)An attribute with two or more coordinate pairs that define the region where learners should click alt
(required)A description of the image, used for accessibility Children
(none)