UNPKG

@oat-sa/tao-item-runner-qti

Version:
29 lines (24 loc) 895 B
define(['taoQtiItem/qtiItem/core/IdentifiedElement'], function (IdentifiedElement) { 'use strict'; IdentifiedElement = IdentifiedElement && Object.prototype.hasOwnProperty.call(IdentifiedElement, 'default') ? IdentifiedElement['default'] : IdentifiedElement; var Choice = IdentifiedElement.extend({ init: function(serial, attributes) { this._super(serial, attributes); }, is: function(qtiClass) { return qtiClass === 'choice' || this._super(qtiClass); }, getInteraction: function() { var found, ret = null, item = this.getRootElement(); if (item) { found = item.find(this.serial); if (found) { ret = found.parent; } } return ret; } }); return Choice; });