Match Interaction - with Table-Grid

Match - Table Grid interactions have a special layout of sources and targets in a tabular format. These are specified by using the class="table-grid" formatting option for the <matchInteraction>.

In a table-grid matchInteraction, the first simpleMatchSet defines the row headings for the table, while the second simpleMatchSet defines the column headings of the table. Because the column headings are defined in the second simpleMatchSet, you can think of the columns as the targets to which you are matching row sources. Consequently, the directedPair answers coming out of this type of matchInteraction will list the row identifiers first and the column identifiers second in each.

You can control the cardinality of each target column by setting the column's simpleAssociableChoice matchMax attribute. If matchMax="1", the column's cardinality is single, and you'll get radio buttons in the column's cells. If matchMax="0" or greater than 1, the column's cardinality is multiple, and you'll get checkboxes in the column's cells.

By default, Match - Table Grid interactions are column-dominant. However, you can set the class of the Match - Table Grid interaction to row-centric. This makes the interaction row-dominant. For example, on a row-centric interaction, if matchMax="1", the row's cardinality is single, and you'll get radio buttons in the row's cells.

About the <prompt> element: a prompt is required for a Match Interaction with class="table-grid". The contents of <prompt> are used to create the column heading above the row headings.

There is one other formatting option: no-header. Add this to the Match Interaction's class attribute, and all column headings will not be displayed. So class="table-grid no-header" will render a header-less table.

Ignore Answer

If a match interaction is inside a composite item there is an option to have the match interaction be ignored when the answered status of the item is being determined. To do this, add the class ignore-answered to the interactions class attribute.
Example: <matchInteraction class="table-grid ignore-answered" responseIdentifier="RESPONSE">

Get Responses: [ Click Get Responses ]
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<assessmentItem xmlns="http://www.imsglobal.org/xsd/imsqti_v2p1" xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" adaptive="false" identifier="match-table-grid" timeDependent="false" 
title="Match - Table Grid" xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqti_v2p1 http://www.imsglobal.org/xsd/imsqti_v2p1.xsd">
  <responseDeclaration baseType="directedPair" cardinality="multiple" identifier="RESPONSE">
    <correctResponse>
      <value>row3 col1</value>
      <value>row1 col2</value>
      <value>row2 col2</value>
      <value>row3 col2</value>
    </correctResponse>
  </responseDeclaration>
  <outcomeDeclaration baseType="float" cardinality="single" identifier="SCORE" />
  <itemBody>
    <p>
      Click on all appropriate cells in the table to <strong>categorize and classify Stooges</strong>. 
      Note how we manipulate the matchMax of each column to display either radio 
      buttons or checkboxes.
    </p>
    <matchInteraction class="table-grid" responseIdentifier="RESPONSE">
      <prompt>Stooges</prompt>
      <simpleMatchSet>
        <simpleAssociableChoice identifier="row1" matchMax="1">Larry</simpleAssociableChoice>
        <simpleAssociableChoice identifier="row2" matchMax="1">Moe</simpleAssociableChoice>
        <simpleAssociableChoice identifier="row3" matchMax="1">Curly</simpleAssociableChoice>
      </simpleMatchSet>
      <simpleMatchSet>
        <simpleAssociableChoice identifier="col1" matchMax="1">Bald Headed</simpleAssociableChoice>
        <simpleAssociableChoice identifier="col2" matchMax="0">Not Very Smart</simpleAssociableChoice>        
      </simpleMatchSet>
    </matchInteraction>
  </itemBody>
  <responseProcessing template="http://www.imsglobal.org/question/qti_v2p1/rptemplates/match_correct"/>
</assessmentItem>

Click on all appropriate cells in the table to categorize and classify Stooges. Note how we manipulate the matchMax of each column to display either radio buttons or checkboxes.

Stooge Bald Headed Not Very Smart
Larry
Moe
Curly