tao-test/app/taoQtiTest/views/js/controller/creator/templates/index.js

56 lines
2.1 KiB
JavaScript

define([
'taoQtiTest/controller/creator/config/defaults',
'tpl!taoQtiTest/controller/creator/templates/testpart',
'tpl!taoQtiTest/controller/creator/templates/section',
'tpl!taoQtiTest/controller/creator/templates/rubricblock',
'tpl!taoQtiTest/controller/creator/templates/itemref',
'tpl!taoQtiTest/controller/creator/templates/outcomes',
'tpl!taoQtiTest/controller/creator/templates/test-props',
'tpl!taoQtiTest/controller/creator/templates/testpart-props',
'tpl!taoQtiTest/controller/creator/templates/section-props',
'tpl!taoQtiTest/controller/creator/templates/itemref-props',
'tpl!taoQtiTest/controller/creator/templates/itemref-props-weight',
'tpl!taoQtiTest/controller/creator/templates/rubricblock-props',
'tpl!taoQtiTest/controller/creator/templates/category-presets'
],
function(
defaults,
testPart,
section,
rubricBlock,
itemRef,
outcomes,
testProps,
testPartProps,
sectionProps,
itemRefProps,
itemRefPropsWeight,
rubricBlockProps,
categoryPresets
){
'use strict';
const applyTemplateConfiguration = (template) => (config) => template(defaults(config));
/**
* Expose all the templates used by the test creator
* @exports taoQtiTest/controller/creator/templates/index
*/
return {
testpart : applyTemplateConfiguration(testPart),
section : applyTemplateConfiguration(section),
itemref : applyTemplateConfiguration(itemRef),
rubricblock : applyTemplateConfiguration(rubricBlock),
outcomes : applyTemplateConfiguration(outcomes),
properties : {
test : applyTemplateConfiguration(testProps),
testpart : applyTemplateConfiguration(testPartProps),
section : applyTemplateConfiguration(sectionProps),
itemref : applyTemplateConfiguration(itemRefProps),
itemrefweight : applyTemplateConfiguration(itemRefPropsWeight),
rubricblock : applyTemplateConfiguration(rubricBlockProps),
categorypresets : applyTemplateConfiguration(categoryPresets)
}
};
});