@@ -259,6 +259,57 @@ export const ASSOCIATE_ITEM_XML = `<?xml version="1.0" encoding="UTF-8"?>
259259 </qti-item-body>
260260</qti-assessment-item>` ;
261261
262+ /**
263+ * Demo item 8: match interaction — learner matches animals to their traits.
264+ * Uses cardinality="multiple" and base-type="directedPair".
265+ * Bat has two answers, "Can fly" and "Mammal" are each shared by two rows, and
266+ * "Reptile" is a distractor.
267+ */
268+ export const MATCH_ITEM_XML = `<?xml version="1.0" encoding="UTF-8"?>
269+ <qti-assessment-item
270+ xmlns="http://www.imsglobal.org/xsd/imsqtiasi_v3p0"
271+ identifier="item-match"
272+ title="Match each animal with its traits"
273+ adaptive="false"
274+ time-dependent="false"
275+ xml:lang="en"
276+ >
277+ <qti-response-declaration
278+ identifier="RESPONSE"
279+ cardinality="multiple"
280+ base-type="directedPair"
281+ >
282+ <qti-correct-response>
283+ <qti-value>row_bat choice_mammal</qti-value>
284+ <qti-value>row_bat choice_fly</qti-value>
285+ <qti-value>row_eagle choice_bird</qti-value>
286+ <qti-value>row_eagle choice_fly</qti-value>
287+ <qti-value>row_whale choice_mammal</qti-value>
288+ </qti-correct-response>
289+ </qti-response-declaration>
290+
291+ <qti-item-body>
292+ <qti-match-interaction
293+ response-identifier="RESPONSE"
294+ shuffle="true"
295+ max-associations="5"
296+ >
297+ <qti-prompt><p>Match each animal with its traits:</p></qti-prompt>
298+ <qti-simple-match-set>
299+ <qti-simple-associable-choice identifier="row_bat" match-max="2">Bat</qti-simple-associable-choice>
300+ <qti-simple-associable-choice identifier="row_eagle" match-max="2">Eagle</qti-simple-associable-choice>
301+ <qti-simple-associable-choice identifier="row_whale" match-max="1">Whale</qti-simple-associable-choice>
302+ </qti-simple-match-set>
303+ <qti-simple-match-set>
304+ <qti-simple-associable-choice identifier="choice_mammal" match-max="2">Mammal</qti-simple-associable-choice>
305+ <qti-simple-associable-choice identifier="choice_fly" match-max="2">Can fly</qti-simple-associable-choice>
306+ <qti-simple-associable-choice identifier="choice_bird" match-max="1">Bird</qti-simple-associable-choice>
307+ <qti-simple-associable-choice identifier="choice_reptile" match-max="1">Reptile</qti-simple-associable-choice>
308+ </qti-simple-match-set>
309+ </qti-match-interaction>
310+ </qti-item-body>
311+ </qti-assessment-item>` ;
312+
262313/**
263314 * Hardcoded items covering different states:
264315 * - item-1: single-select choice interaction
@@ -268,6 +319,7 @@ export const ASSOCIATE_ITEM_XML = `<?xml version="1.0" encoding="UTF-8"?>
268319 * - item-free-response: free-response text-entry (no correct answer)
269320 * - item-ordering: ordering interaction (planets by distance from the Sun)
270321 * - item-associate: associate interaction (countries to capitals, with distractors)
322+ * - item-match: match interaction (animals to traits, with shared answers and a distractor)
271323 */
272324export const INITIAL_ASSESSMENTS = [
273325 {
@@ -305,4 +357,9 @@ export const INITIAL_ASSESSMENTS = [
305357 type : AssessmentItemTypes . QTI ,
306358 raw_data : ASSOCIATE_ITEM_XML ,
307359 } ,
360+ {
361+ assessment_id : 'demo-item-match' ,
362+ type : AssessmentItemTypes . QTI ,
363+ raw_data : MATCH_ITEM_XML ,
364+ } ,
308365] ;
0 commit comments