Question Matrices

The list questions presented in List Questions ask the same boolean question about a group of entities. It is possible to ask the same codetable question for a group of entities using question matrices.

A question matrix will display a list of questions based on a codetable and for each of these codetable values and each entity, a checkbox will be displayed to allow the user to select all the values that apply to a particular entity.

For example, suppose there is a requirement to capture possible levels of substance abuse for each household member, a new a new domain definition can be added to represent the SubstanceAbuse codetable and an attribute to store the level of substance abuse can be added to the Person entity as follows:

Figure 1. Substance Abuse Attribute
<xsd:simpleType name="IEG_SUBSTANCEABUSE">
  <xsd:annotation>
    <xsd:appinfo>
      <D:options>
        <D:option name="code-table-name">SubstanceAbuse</D:option>
      </D:options>
    </xsd:appinfo>
  </xsd:annotation>
  <xsd:restriction base="IEG_CODETABLE_CODE" />
</xsd:simpleType>

<xsd:element name="Person">
  <xsd:complexType>
    ...
    <xsd:attribute name="substanceAbuse"
                   type="IEG_SUBSTANCEABUSE" />

The question matrix is then defined as a regular list question, only the fact that it is based on a codetable instead of a boolean will cause it to be displayed differently.

Figure 2. Question Matrix Code Example
...
<list-question entity="Person" id="substanceAbuse"
      criteria="age > 14">
  <label id="SubstanceAbuse.Label">
    <![CDATA[Substance Abuse:]]>
  </label>
  <item-label>
    <label-element attribute-id="firstName" />
  </item-label>
</list-question>

The example above, of a question matrix that collects substance abuse information about multiple household members, will be displayed in the IEG Player as a matrix with each row corresponding to a codetable description and each column to a Person.