[QTI] origin for coords

Steve Lay swl10 at cam.ac.uk
Wed Oct 4 14:18:56 BST 2006


At 12:40 +0200 2006-10-04, Marina Zelwer wrote:
>I'm working on selectPointInteraction and I didn't manage to find how we
>can know to which origin the coords apply. Is it the left-top corner of
>the image object ? The left-bottom ?

QTI inherits its co-ordinate space from (X)HTML.

For a selectPointInteraction there are two coordinate related issues.

(1) Firstly, areas may be defined in an areaMapping defined in the
associated responseDeclaration.  In this case, the coordinates are defined
by the coords type.  In the section on "Basic Data Types" the coords type
is defined as follows:

"The coordinates themselves are an ordered list of lengths (as defined in
[XHTML]). The interpretation of each length value is dependent on the value
of the associated shape as follows." - the 2.1 binding has more information
than previous drafts and draws attention to the need to interpret these
values as HTML lengths and not just pixel values (a length in HTML may be a
percentage).

The appropriate part of the HTML specification is here:

http://www.w3.org/TR/html401/struct/objects.html#h-13.6.1

Which states: "Coordinates are relative to the top, left corner of the
object. All values are lengths. All values are separated by commas."

Note that I've included the binding information in this quote as it differs
from the space-separated convention used for most data types in the
specification binding (spaces being the convention used in XML schema, on
which the binding is based).

(2) Secondly, you may need a coordinate value when representing coordinate
values returned by the user (e.g., in reports) or in declarations  such as
that of the correctResponse.  In this case, you have to use the value
element.  The co-ordinate space is the same but the binding is carried out
in accordance with the rules in the XML binding document, section "Binding
Values of Item Variables".  This states that 'point' is bound as:

"A space separated list of two integer values, bound in the same was as the
XML schema type int. The first value is the horizontal component, the
second the vertical."

Note also that lengths are not allowed so you *can't* report a user clicked
point of "50% 50%" indicating that the user clicked in the centre of the
image even though you can use this form to define a shape in an
areaMapping, e.g. shape="circle" coords="50% 50% 10" which indicates a
centred circle of radius 10 pixels.

Hope that helps.

Steve




More information about the IMS-QTI mailing list