-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #109 from oat-sa/release-0.12.0
Release 0.12.0
- Loading branch information
Showing
12 changed files
with
2,052 additions
and
186 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,159 @@ | ||
/* | ||
* 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) 2020 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT); | ||
* | ||
*/ | ||
export const responseRules = { | ||
MATCH_CORRECT: (responseIdentifier, outcomeIdentifier) => ({ | ||
qtiClass: 'responseCondition', | ||
responseIf: { | ||
qtiClass: 'responseIf', | ||
expression: { | ||
qtiClass: 'match', | ||
expressions: [ | ||
{ | ||
qtiClass: 'variable', | ||
attributes: { | ||
identifier: responseIdentifier, | ||
}, | ||
}, | ||
{ | ||
qtiClass: 'correct', | ||
attributes: { | ||
identifier: responseIdentifier, | ||
}, | ||
}, | ||
], | ||
}, | ||
responseRules: [ | ||
{ | ||
qtiClass: 'setOutcomeValue', | ||
attributes: { | ||
identifier: outcomeIdentifier, | ||
}, | ||
expression: { | ||
qtiClass: 'sum', | ||
expressions: [ | ||
{ | ||
qtiClass: 'variable', | ||
attributes: { | ||
identifier: outcomeIdentifier, | ||
}, | ||
}, | ||
{ | ||
qtiClass: 'baseValue', | ||
attributes: { | ||
baseType: 'integer' | ||
}, | ||
value: '1', | ||
}, | ||
], | ||
}, | ||
}, | ||
], | ||
}, | ||
}), | ||
MAP_RESPONSE: (responseIdentifier, outcomeIdentifier) => ({ | ||
qtiClass: 'responseCondition', | ||
responseIf: { | ||
qtiClass: 'responseIf', | ||
expression: { | ||
qtiClass: 'not', | ||
expressions: [ | ||
{ | ||
qtiClass: 'isNull', | ||
expressions: [{ | ||
qtiClass: 'variable', | ||
attributes: { | ||
identifier: responseIdentifier, | ||
}, | ||
}], | ||
}, | ||
], | ||
}, | ||
responseRules: [ | ||
{ | ||
qtiClass: 'setOutcomeValue', | ||
attributes: { | ||
identifier: outcomeIdentifier, | ||
}, | ||
expression: { | ||
qtiClass: 'sum', | ||
expressions: [ | ||
{ | ||
qtiClass: 'variable', | ||
attributes: { | ||
identifier: outcomeIdentifier, | ||
} | ||
}, | ||
{ | ||
qtiClass: 'mapResponse', | ||
attributes: { | ||
identifier: responseIdentifier, | ||
}, | ||
}, | ||
], | ||
}, | ||
}, | ||
], | ||
}, | ||
}), | ||
MAP_RESPONSE_POINT: (responseIdentifier, outcomeIdentifier) => ({ | ||
qtiClass: 'responseCondition', | ||
responseIf: { | ||
qtiClass: 'responseIf', | ||
expression: { | ||
qtiClass: 'not', | ||
expressions: [ | ||
{ | ||
qtiClass: 'isNull', | ||
expressions: [{ | ||
qtiClass: 'variable', | ||
attributes: { | ||
identifier: responseIdentifier, | ||
}, | ||
}], | ||
}, | ||
], | ||
}, | ||
responseRules: [ | ||
{ | ||
qtiClass: 'setOutcomeValue', | ||
attributes: { | ||
identifier: outcomeIdentifier, | ||
}, | ||
expression: { | ||
qtiClass: 'sum', | ||
expressions: [ | ||
{ | ||
qtiClass: 'variable', | ||
attributes: { | ||
identifier: outcomeIdentifier, | ||
} | ||
}, | ||
{ | ||
qtiClass: 'mapResponsePoint', | ||
attributes: { | ||
identifier: responseIdentifier, | ||
}, | ||
}, | ||
], | ||
}, | ||
}, | ||
], | ||
}, | ||
}), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>QTI Item loader</title> | ||
<script type="text/javascript" src="/environment/require.js"></script> | ||
<script type="text/javascript"> | ||
require(['/environment/config.js'], function() { | ||
require(['qunitEnv'], function() { | ||
require(['taoQtiItem/test/qtiItem/core/loader/test'], function() { | ||
QUnit.config.reorder = false; | ||
QUnit.start(); | ||
}); | ||
}); | ||
}); | ||
</script> | ||
</head> | ||
<body> | ||
<div id="qunit"></div> | ||
<div id="qunit-fixture"></div> | ||
</body> | ||
</html> |
Oops, something went wrong.