define(['utils'], function(utils) {
// ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
// ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
// ROPOT or website configuration
// ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
// ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
var config = utils.createConfiguration();
config.cssFilePath('/el/1433/podzim2017/PB168/odp/test_db_design_files/db-design-style.css');
config.evaluationServiceUrl('');
config.schemaClass('schema');
config.schemaNameClass('schema-name');
config.schemaAttrClass('schema-attr');
config.attrsCollectionClass('attrs-coll');
config.attrsCollectionSchemaClass('attrs-coll-schema');
config.attrsCollectionAttrClass('attrs-coll-attr');
config.fdClass('fd');
config.fdSchemaClass('fd-schema');
config.fdAttrClass('fd-attr');
config.addAttrButtonText('');
config.addAttrButtonClass('plus-icon');
config.removeAttrButtonText('');
config.removeAttrButtonClass('x-icon');
config.makeCopyButtonText('');
config.makeCopyButtonTitle('Copy');
config.makeCopyButtonClass('copy-icon');
// ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
// ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
// definitions of all exercises for ROPOT or website
// ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
// ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
/*var exercisesContainer = utils.createExercisesContainer(false, [
utils.createExercise('shared', null, false),
utils.createExercise('superkeys', null, false),
utils.createExercise('candidateKeys', null, false),
utils.createExercise('attributeSetClosure', null, false),
utils.createExercise('functionalDependenciesClosure', null, false),
utils.createExercise('canonicalCover', null, false),
utils.createExercise('secondNormalForm', null, false),
utils.createExercise('thirdNormalForm', null, false),
utils.createExercise('boyceCoddNormalForm', null, false),
utils.createExercise('fdsAndMvdsClosure', null, false),
utils.createExercise('fourthNormalForm', null, false),
utils.createExercise('ropot-exporter', null, false)
]);*/
var exercisesContainer = utils.createExercisesContainer(true, [
utils.createExercise('superkeys', null, false,
[
utils.createSchema('r', ['uco', 'jmeno', 'prijmeni', 'kod', 'nazev', 'pocet_kreditu', 'ukonceni'])
],
[
utils.createFunctionalDependency('r', ['uco'], ['jmeno', 'prijmeni']),
utils.createFunctionalDependency('r', ['kod'], ['nazev', 'pocet_kreditu']),
utils.createFunctionalDependency('r', ['uco', 'kod'], ['ukonceni'])
]
),
utils.createExercise('candidateKeys', null, false,
[
utils.createSchema('r', ['uco', 'jmeno', 'prijmeni', 'kod', 'nazev', 'pocet_kreditu', 'ukonceni'])
],
[
utils.createFunctionalDependency('r', ['uco'], ['jmeno', 'prijmeni']),
utils.createFunctionalDependency('r', ['kod'], ['nazev', 'pocet_kreditu']),
utils.createFunctionalDependency('r', ['uco', 'kod'], ['ukonceni'])
]
),
utils.createExercise('attributeSetClosure', null, false,
[
utils.createSchema('r', ['uco', 'jmeno', 'prijmeni', 'kod', 'nazev', 'pocet_kreditu', 'ukonceni'])
],
[
utils.createFunctionalDependency('r', ['uco'], ['jmeno', 'prijmeni']),
utils.createFunctionalDependency('r', ['kod'], ['nazev', 'pocet_kreditu']),
utils.createFunctionalDependency('r', ['uco', 'kod'], ['ukonceni'])
],
[],
[
utils.createAttributesCollection('r', ['uco'])
]
),
utils.createExercise('functionalDependenciesClosure', null, false,
[
utils.createSchema('r', ['uco', 'jmeno', 'prijmeni', 'kod', 'nazev', 'pocet_kreditu', 'ukonceni'])
],
[
utils.createFunctionalDependency('r', ['uco'], ['jmeno', 'prijmeni']),
utils.createFunctionalDependency('r', ['kod'], ['nazev', 'pocet_kreditu']),
utils.createFunctionalDependency('r', ['uco', 'kod'], ['ukonceni'])
],
[
utils.createAugmentationAxiom(
utils.createFunctionalDependency('r', ['uco'], ['jmeno', 'prijmeni']),
['r.kod']
),
utils.createUnionAxiom(
utils.createFunctionalDependency('r', ['uco', 'kod'], ['ukonceni']),
utils.createFunctionalDependency(utils.allSchemasString, ['r.kod', 'r.uco'], ['r.prijmeni', 'r.kod', 'r.jmeno'])
)
]
),
utils.createExercise('functionalDependenciesClosure-userResults', null, true,
[
utils.createSchema('r', ['uco', 'jmeno', 'prijmeni', 'kod', 'nazev', 'pocet_kreditu', 'ukonceni'])
],
[
utils.createFunctionalDependency('r', ['uco'], ['jmeno', 'prijmeni']),
utils.createFunctionalDependency('r', ['kod'], ['nazev', 'pocet_kreditu']),
utils.createFunctionalDependency('r', ['uco', 'kod'], ['ukonceni'])
],
[
utils.createAugmentationAxiom(
utils.createFunctionalDependency('r', ['uco'], ['jmeno', 'prijmeni']),
['r.kod']
),
utils.createUnionAxiom(
utils.createFunctionalDependency('r', ['uco', 'kod'], ['ukonceni']),
utils.createFunctionalDependency(utils.allSchemasString, ['r.kod', 'r.uco'], ['r.prijmeni', 'r.kod', 'r.jmeno'])
)
]
),
utils.createExercise('canonicalCover', null, false,
[
utils.createSchema('R', ['a', 'b', 'c'])
],
[
utils.createFunctionalDependency('R', ['a'], ['b', 'c']),
utils.createFunctionalDependency('R', ['b'], ['c']),
utils.createFunctionalDependency('R', ['a'], ['b']),
utils.createFunctionalDependency('R', ['a', 'b'], ['c'])
]
),
utils.createExercise('inferFunctionalDependencies', null, false,
[
utils.createSchema('Tabulka', ['uco', 'jmeno', 'prijmeni', 'stud_prumer', 'kod', 'nazev', 'pocet_kreditu', 'ukonceni', 'stud_program', 'vyse_stipendia'])
],
[
utils.createFunctionalDependency('Tabulka', ['uco'], ['jmeno']),
utils.createFunctionalDependency('Tabulka', ['uco'], ['prijmeni']),
utils.createFunctionalDependency('Tabulka', ['uco'], ['stud_prumer']),
utils.createFunctionalDependency('Tabulka', ['kod'], ['nazev', 'pocet_kreditu']),
utils.createFunctionalDependency('Tabulka', ['uco', 'kod'], ['ukonceni']),
utils.createFunctionalDependency('Tabulka', ['stud_program', 'stud_prumer'], ['vyse_stipendia'])
],
[
utils.createAugmentationAxiom(
utils.createFunctionalDependency('Tabulka', ['kod'], ['nazev', 'pocet_kreditu']),
['Tabulka.uco']
),
utils.createAugmentationAxiom(
utils.createFunctionalDependency('Tabulka', ['uco', 'kod'], ['ukonceni']),
['Tabulka.pocet_kreditu']
)
],
[],
[
utils.createFunctionalDependency('Tabulka', ['uco'], ['jmeno', 'prijmeni']),
utils.createFunctionalDependency('Tabulka', ['kod'], ['nazev']),
utils.createFunctionalDependency('Tabulka', ['uco', 'stud_program'], ['vyse_stipendia'])
]
),
utils.createExercise('inferFunctionalDependencies-userResults', null, true,
[
utils.createSchema('Tabulka', ['uco', 'jmeno', 'prijmeni', 'stud_prumer', 'kod', 'nazev', 'pocet_kreditu', 'ukonceni', 'stud_program', 'vyse_stipendia'])
],
[
utils.createFunctionalDependency('Tabulka', ['uco'], ['jmeno']),
utils.createFunctionalDependency('Tabulka', ['uco'], ['prijmeni']),
utils.createFunctionalDependency('Tabulka', ['uco'], ['stud_prumer']),
utils.createFunctionalDependency('Tabulka', ['kod'], ['nazev', 'pocet_kreditu']),
utils.createFunctionalDependency('Tabulka', ['uco', 'kod'], ['ukonceni']),
utils.createFunctionalDependency('Tabulka', ['stud_program', 'stud_prumer'], ['vyse_stipendia'])
],
[
utils.createAugmentationAxiom(
utils.createFunctionalDependency('Tabulka', ['kod'], ['nazev', 'pocet_kreditu']),
['Tabulka.uco']
),
utils.createAugmentationAxiom(
utils.createFunctionalDependency('Tabulka', ['uco', 'kod'], ['ukonceni']),
['Tabulka.pocet_kreditu']
)
],
[],
[
utils.createFunctionalDependency('Tabulka', ['uco'], ['jmeno', 'prijmeni']),
utils.createFunctionalDependency('Tabulka', ['kod'], ['nazev']),
utils.createFunctionalDependency('Tabulka', ['uco', 'stud_program'], ['vyse_stipendia'])
]
),
utils.createExercise('secondNormalForm', null, false,
[
utils.createSchema('Zaverecna_prace', ['uco', 'jmeno', 'prijmeni', 'program', 'obor', 'nazev_prace', 'vedouci', 'vedouci_katedra', 'garant_oboru'])
],
[
utils.createFunctionalDependency('Zaverecna_prace', ['uco', 'program'], ['obor', 'vedouci', 'nazev_prace']),
utils.createFunctionalDependency('Zaverecna_prace', ['obor'], ['garant_oboru', 'program']),
utils.createFunctionalDependency('Zaverecna_prace', ['vedouci'], ['vedouci_katedra']),
utils.createFunctionalDependency('Zaverecna_prace', ['uco'], ['jmeno', 'prijmeni'])
]
),
utils.createExercise('thirdNormalForm', null, false,
[
utils.createSchema('Zaverecna_prace', ['uco', 'program', 'obor', 'nazev_prace', 'vedouci', 'vedouci_katedra']),
utils.createSchema('Student', ['uco', 'jmeno', 'prijmeni']),
utils.createSchema('Garant', ['obor', 'garant_ oboru'])
],
[
utils.createFunctionalDependency('Zaverecna_prace', ['uco', 'program'], ['obor', 'vedouci', 'nazev_prace']),
utils.createFunctionalDependency('Zaverecna_prace', ['obor'], ['program']),
utils.createFunctionalDependency('Zaverecna_prace', ['vedouci'], ['vedouci_katedra']),
utils.createFunctionalDependency('Student', ['uco'], ['jmeno', 'prijmeni']),
utils.createFunctionalDependency('Garant', ['obor'], ['garant_oboru'])
]
),
utils.createExercise('boyceCoddNormalForm', null, false,
[
utils.createSchema('Jednotka', ['katedra', 'budova', 'adresa', 'plocha'])
],
[
utils.createFunctionalDependency('Jednotka', ['katedra'], ['budova', 'plocha']),
utils.createFunctionalDependency('Jednotka', ['budova'], ['adresa'])
]
),
utils.createExercise('fdsAndMvdsClosure', null, false,
[
utils.createSchema('R', ['a', 'b', 'c', 'g', 'h', 'i'])
],
[
utils.createMultivaluedDependency('R', ['a'], ['b']),
utils.createMultivaluedDependency('R', ['b'], ['h', 'i']),
utils.createFunctionalDependency('R', ['c', 'g'], ['h'])
],
[
utils.createComplementationAxiom(
utils.createMultivaluedDependency('R', ['a'], ['b'])
),
utils.createMultivaluedTransitivityAxiom(
utils.createMultivaluedDependency('R', ['a'], ['b']),
utils.createMultivaluedDependency('R', ['b'], ['h', 'i'])
),
utils.createCoalescenceAxiom(
utils.createMultivaluedDependency('R', ['b'], ['h', 'i']),
utils.createFunctionalDependency('R', ['c', 'g'], ['h'])
)
]
),
utils.createExercise('fdsAndMvdsClosure-userResults', null, true,
[
utils.createSchema('R', ['a', 'b', 'c', 'g', 'h', 'i'])
],
[
utils.createMultivaluedDependency('R', ['a'], ['b']),
utils.createMultivaluedDependency('R', ['b'], ['h', 'i']),
utils.createFunctionalDependency('R', ['c', 'g'], ['h'])
],
[
utils.createComplementationAxiom(
utils.createMultivaluedDependency('R', ['a'], ['b'])
),
utils.createMultivaluedTransitivityAxiom(
utils.createMultivaluedDependency('R', ['a'], ['b']),
utils.createMultivaluedDependency('R', ['b'], ['h', 'i'])
),
utils.createCoalescenceAxiom(
utils.createMultivaluedDependency('R', ['b'], ['h', 'i']),
utils.createFunctionalDependency('R', ['c', 'g'], ['h'])
)
]
),
utils.createExercise('inferFdsAndMvds', null, false,
[
utils.createSchema('R', ['a', 'b', 'c', 'g', 'h', 'i'])
],
[
utils.createMultivaluedDependency('R', ['a'], ['b']),
utils.createMultivaluedDependency('R', ['b'], ['h', 'i']),
utils.createFunctionalDependency('R', ['c', 'g'], ['h'])
],
[
utils.createComplementationAxiom(
utils.createMultivaluedDependency('R', ['a'], ['b'])
)
],
[],
[
utils.createMultivaluedDependency(utils.allSchemasString, ['R.a'], ['R.h', 'R.i']),
utils.createFunctionalDependency(utils.allSchemasString, ['R.b'], ['R.h'])
]
),
utils.createExercise('inferFdsAndMvds-userResults', null, true,
[
utils.createSchema('R', ['a', 'b', 'c', 'g', 'h', 'i'])
],
[
utils.createMultivaluedDependency('R', ['a'], ['b']),
utils.createMultivaluedDependency('R', ['b'], ['h', 'i']),
utils.createFunctionalDependency('R', ['c', 'g'], ['h'])
],
[
utils.createComplementationAxiom(
utils.createMultivaluedDependency('R', ['a'], ['b'])
)
],
[],
[
utils.createMultivaluedDependency(utils.allSchemasString, ['R.a'], ['R.h', 'R.i']),
utils.createFunctionalDependency(utils.allSchemasString, ['R.b'], ['R.h'])
]
),
utils.createExercise('fourthNormalForm', null, false,
[
utils.createSchema('R', ['a', 'b', 'c', 'g', 'h', 'i'])
],
[
utils.createMultivaluedDependency('R', ['a'], ['b']),
utils.createMultivaluedDependency('R', ['b'], ['h', 'i']),
utils.createMultivaluedDependency('R', ['c', 'g'], ['h'])
]
),
utils.createExercise('nonExistingExercise', null, false,
[
utils.createSchema('r', ['uco', 'jmeno', 'prijmeni', 'kod', 'nazev', 'pocet_kreditu', 'ukonceni'])
],
[
utils.createFunctionalDependency('r', ['uco'], ['jmeno', 'prijmeni']),
utils.createFunctionalDependency('r', ['kod'], ['nazev', 'pocet_kreditu']),
utils.createFunctionalDependency('r', ['uco', 'kod'], ['ukonceni'])
]),
utils.createExercise('exerciseWithoutStudentResult', null, false,
[
utils.createSchema('r', ['uco', 'jmeno', 'prijmeni', 'kod', 'nazev', 'pocet_kreditu', 'ukonceni'])
],
[
utils.createFunctionalDependency('r', ['uco'], ['jmeno', 'prijmeni']),
utils.createFunctionalDependency('r', ['kod'], ['nazev', 'pocet_kreditu']),
utils.createFunctionalDependency('r', ['uco', 'kod'], ['ukonceni'])
]),
utils.createExercise('createFromText', null, false)
]);
return {
config: config,
exercisesContainer: exercisesContainer
};
/*
*/
});