tao-test/app/taoQtiItem/views/js/qtiXmlRenderer/renderers/PortableInfoControl.js

24 lines
707 B
JavaScript
Raw Normal View History

2022-08-29 20:14:13 +02:00
define([
'tpl!taoQtiItem/qtiXmlRenderer/tpl/portableInfoControl',
'taoQtiItem/qtiItem/helper/util',
'taoQtiItem/qtiXmlRenderer/helper/portableElementTpl'
], function(tpl, util){
'use strict';
return {
qtiClass : 'infoControl',
template : tpl,
getData : function(infoControl, data){
data.markup = infoControl.markup;
//ensure infoControl have an id, otherwise generate one in order to be able to identify it for the state
if(!infoControl.attr('id')){
infoControl.attr('id', util.buildId(infoControl.getRootElement(), infoControl.typeIdentifier ));
}
return data;
}
};
});