diff --git a/amd/src/studyplan-editor-components.js b/amd/src/studyplan-editor-components.js index f0015ac..b1e6c14 100644 --- a/amd/src/studyplan-editor-components.js +++ b/amd/src/studyplan-editor-components.js @@ -1,5 +1,7 @@ /*eslint no-var: "error"*/ /*eslint no-console: "off"*/ +/*eslint no-unused-vars: warn */ +/*eslint max-len: ["error", { "code": 160 }] */ /*eslint-disable no-trailing-spaces */ /*eslint-env es6*/ // Put this file in path/to/plugin/amd/src @@ -1131,6 +1133,26 @@ export default { } }, methods: { + countLineLayers(line){ + let maxLayer = -1; + for(let i = 0; i <= this.value.slots; i++){ + const slot = line.slots[i]; + // Determine the amount of used layers in a studyline slit + for(const ix in line.slots[i].competencies){ + const item = line.slots[i].competencies[ix]; + if(item.layer > maxLayer){ + maxLayer = item.layer; + } + } + for(const ix in line.slots[i].filters){ + const item = line.slots[i].filters[ix]; + if(item.layer > maxLayer){ + maxLayer = item.layer; + } + } + } + return maxLayer+1; + }, slotsempty(slots) { if(Array.isArray(slots)){ let count = 0; @@ -1353,32 +1375,36 @@ export default {