UNPKG

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

Version:
59 lines (51 loc) 2.57 kB
define(['taoQtiItem/scoring/processor/responseRules/exitResponse', 'taoQtiItem/scoring/processor/responseRules/responseCondition', 'taoQtiItem/scoring/processor/responseRules/setOutcomeValue'], function (exitResponse, responseCondition, setOutcomeValue) { 'use strict'; exitResponse = exitResponse && Object.prototype.hasOwnProperty.call(exitResponse, 'default') ? exitResponse['default'] : exitResponse; responseCondition = responseCondition && Object.prototype.hasOwnProperty.call(responseCondition, 'default') ? responseCondition['default'] : responseCondition; setOutcomeValue = setOutcomeValue && Object.prototype.hasOwnProperty.call(setOutcomeValue, 'default') ? setOutcomeValue['default'] : setOutcomeValue; /* * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; under version 2 * of the License (non-upgradable). * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * Copyright (c) 2015-2019 (original work) Open Assessment Technlogies SA (under the project TAO-PRODUCT); * */ /** * An ResponseRuleProcessor * @typedef ResponseRuleProcessor * @property {Object} rule - the response rule definition * @property {Object} state - the item state (response, outcomes and friends) * @property {Funtion} process - the processing */ /** * Mock a processor only to make some responseRules supported but do nothing * (when the behavior is implemented somewhere else) * @private */ var _noopProcessor = { process: function() {} }; /** * Lists all available response rule processors * @exports taoQtiItem/scoring/processor/responseRules/rules */ var rules = { 'exitResponse': exitResponse, 'responseCondition': responseCondition, 'responseIf': _noopProcessor, 'responseElse': _noopProcessor, 'responseElseIf': _noopProcessor, 'setOutcomeValue': setOutcomeValue, }; return rules; });