Skip to content

Commit

Permalink
Merge pull request #292 from oat-sa/release-1.2.0
Browse files Browse the repository at this point in the history
Release 1.2.0
  • Loading branch information
shaveko authored May 25, 2022
2 parents 7e48ad1 + 8254f3f commit c9dcd1f
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 20 deletions.
7 changes: 7 additions & 0 deletions environment/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,11 @@ define(['/node_modules/@oat-sa/tao-core-libs/dist/pathdefinition.js'], function(
}));
define('taoQtiItem/portableElementRegistry/provider/sideLoadingProviderFactory', [], () => {});
define('taoQtiItem/portableElementRegistry/assetManager/portableAssetStrategy', [], () => {});
define('services/features', function() {
return {
isVisible: function() {
return true;
}
}
});
});
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oat-sa/tao-item-runner-qti",
"version": "1.1.10",
"version": "1.2.0",
"displayName": "TAO Item Runner QTI",
"description": "TAO QTI Item Runner modules",
"files": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@
*/
import tpl from 'taoQtiItem/qtiCommonRenderer/tpl/choices/simpleChoice.choiceInteraction';
import containerHelper from 'taoQtiItem/qtiCommonRenderer/helpers/container';
import features from 'services/features';

export default {
qtiClass: 'simpleChoice.choiceInteraction',
getContainer: containerHelper.get,
getData: function(choice, data) {
data.unique = parseInt(data.interaction.attributes.maxChoices) === 1;
data.allowElimination = features.isVisible('taoQtiItem/creator/interaction/choice/property/allowElimination');
return data;
},
template: tpl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import instructionMgr from 'taoQtiItem/qtiCommonRenderer/helpers/instructions/in
import pciResponse from 'taoQtiItem/qtiCommonRenderer/helpers/PciResponse';
import sizeAdapter from 'taoQtiItem/qtiCommonRenderer/helpers/sizeAdapter';
import adaptSize from 'util/adaptSize';
import features from 'services/features';

const KEY_CODE_SPACE = 32;
const KEY_CODE_ENTER = 13;
Expand Down Expand Up @@ -392,7 +393,8 @@ const getCustomData = function getCustomData(interaction, data) {
return _.merge(data || {}, {
horizontal: interaction.attr('orientation') === 'horizontal',
listStyle: listStyles.pop(),
eliminable: isEliminable(interaction)
eliminable: isEliminable(interaction),
allowEliminationVisible: features.isVisible('taoQtiItem/creator/interaction/choice/property/allowElimination')
});
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ import loggerFactory from 'core/logger';
*/
const logger = loggerFactory('taoQtiItem/qtiCommonRenderer/renderers/interactions/ExtendedTextInteraction.js');

const hideXhtmlConstraints = !features.isVisible('taoQtiItem/creator/interaction/extendedText/property/xhtmlConstraints');
const hideXhtmlRecommendations = !features.isVisible('taoQtiItem/creator/interaction/extendedText/property/xhtmlRecommendations');

/**
* Init rendering, called after template injected into the DOM
* All options are listed in the QTI v2.1 information model:
Expand Down Expand Up @@ -84,11 +87,15 @@ const render = function render(interaction) {
$el.attr('placeholder', placeholderText);
}
if (_getFormat(interaction) === 'xhtml') {
if(!features.isVisible('taoQtiItem/creator/interaction/extendedText/property/xhtmlConstraints') && !features.isVisible('taoQtiItem/creator/interaction/extendedText/property/xhtmlRecommendations')) {

if(hideXhtmlConstraints && hideXhtmlRecommendations) {
$container.find('.text-counter').hide();
}

if(hideXhtmlConstraints) {
limiter.enabled = false;
}

_styleUpdater = function () {
let qtiItemStyle, $editorBody, qtiItem;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@
</div>
</div>
</div>
{{#if allowElimination}}
<label data-eliminable="container" data-label="{{__ "Eliminate"}}">
<span data-eliminable="trigger" class="icon-checkbox"></span>
</label>
{{/if}}
</li>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div
{{#if attributes.id}}id="{{attributes.id}}"{{/if}}
class="qti-interaction qti-blockInteraction qti-choiceInteraction{{#if attributes.class}} {{attributes.class}}{{/if}}"
class="qti-interaction qti-blockInteraction qti-choiceInteraction{{#if attributes.class}} {{attributes.class}}{{/if}}{{#if allowEliminationVisible}} allow-elimination-visible{{/if}}"
data-serial="{{serial}}"
data-qti-class="choiceInteraction"
{{#if attributes.xml:lang}} lang="{{attributes.xml:lang}}"{{/if}}
Expand Down
7 changes: 0 additions & 7 deletions test/qtiCommonRenderer/interactions/extendedText/test.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,6 @@
<script type="text/javascript">
require(['/environment/config.js'], function() {
require(['qunitEnv'], function() {
define('services/features', function() {
return {
isVisible: function() {
return true;
}
}
});
require(['taoQtiItem/test/qtiCommonRenderer/interactions/extendedText/test'], function() {
QUnit.start();
QUnit.config.reorder = false;
Expand Down
7 changes: 0 additions & 7 deletions test/reviewRenderer/interactions/extendedText/test.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,6 @@
<script type="text/javascript">
require(['/environment/config.js'], function () {
require(['qunitEnv'], function () {
define('services/features', function() {
return {
isVisible: function() {
return true;
}
}
});
require(['taoQtiItem/test/reviewRenderer/interactions/extendedText/test'], function () {
QUnit.start();
QUnit.config.reorder = false;
Expand Down

0 comments on commit c9dcd1f

Please sign in to comment.