Skip to content
Snippets Groups Projects
Commit e8c7a9f9 authored by Miguel Angelo Salerno's avatar Miguel Angelo Salerno
Browse files

remove teacherAdequacy

parent ae7ff0d7
No related branches found
No related tags found
1 merge request!309Merge new updates into master
Pipeline #24415 failed
/*
Copyright (C) 2016 Centro de Computacao Cientifica e Software Livre
Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
This file is part of simcaq-node.
simcaq-node is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
simcaq-node is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with simcaq-node. If not, see <https://www.gnu.org/licenses/>.
*/
module.exports = function teacherAdequacy(id) {
switch (id) {
case 0:
return 'Formação não adequada';
case 1:
return 'Formação adequada';
}
};
......@@ -89,7 +89,6 @@ const finishUniversity = require(`${libs}/convert/finishUniversity`);
const initialTraining = require(`${libs}/convert/initialTraining`);
const posTraining = require(`${libs}/convert/posTraining`);
const licentiateDegree = require(`${libs}/convert/licentiateDegree`);
const teacherAdequacy = require(`${libs}/convert/teacherAdequacy`);
const ids = {
gender_id: gender,
......@@ -170,8 +169,7 @@ const ids = {
finish_id: finishUniversity,
initial_training_id: initialTraining,
pos_training_id: posTraining,
licentiate_degree_id: licentiateDegree,
teacher_adequacy_id: teacherAdequacy
licentiate_degree_id: licentiateDegree
};
function transform(removeId=false) {
......@@ -279,6 +277,5 @@ module.exports = {
finishUniversity,
initialTraining,
posTraining,
licentiateDegree,
teacherAdequacy
licentiateDegree
};
......@@ -193,17 +193,6 @@ disciplinesApp.get('/discipline', (req, res, next) => {
next();
}, response('discipline'))
// disciplinesApp.get('/teacher_adequacy', (req, res, next) => {
// req.result = [];
// for (let i = 0; i <= 1; i++) {
// req.result.push({
// id: i,
// name: id2str.teacherAdequacy(i)
// })
// }
// next();
// }, response('teacher_adequacy'))
rqf.addField({
name: 'filter',
field: false,
......@@ -466,18 +455,6 @@ rqf.addField({
}
});
// .addValue({
// name: 'teacher_adequacy',
// table: 'docente_test',
// tableField: '',
// resultField: 'teacher_adequacy_name',
// where: {
// relation: '=',
// type: 'integer',
// field: ''
// }
// });
disciplinesApp.get('/', rqf.parse(), (req, res, next) => {
if ('discipline' in req.dims) {
// delete req.filter.discipline;
......@@ -648,31 +625,31 @@ disciplinesApp.get('/', rqf.parse(), (req, res, next) => {
req.result = results;
}
else { */}
// let disciplinesNotSuitable = [];
// let disciplinesSuitable = [];
// req.result.forEach((r) => {
// let objNotSuitable = {
// total: parseInt(r.total) - parseInt(r.total_suitable),
// suitable: 0
// }
// let objSuitable = {
// total: parseInt(r.total_suitable),
// suitable: 1
// }
// Object.keys(r).forEach(k => {
// if (k !== 'total' && k !== 'total_suitable') {
// objNotSuitable[k] = r[k];
// objSuitable[k] = r[k];
// }
// })
// disciplinesNotSuitable.push(objNotSuitable)
// disciplinesSuitable.push(objSuitable)
// })
// req.result = disciplinesNotSuitable.concat(disciplinesSuitable);
let disciplinesNotSuitable = [];
let disciplinesSuitable = [];
req.result.forEach((r) => {
let objNotSuitable = {
total: parseInt(r.total) - parseInt(r.total_suitable),
suitable: 0
}
let objSuitable = {
total: parseInt(r.total_suitable),
suitable: 1
}
Object.keys(r).forEach(k => {
if (k !== 'total' && k !== 'total_suitable') {
objNotSuitable[k] = r[k];
objSuitable[k] = r[k];
}
})
disciplinesNotSuitable.push(objNotSuitable)
disciplinesSuitable.push(objSuitable)
})
req.result = disciplinesNotSuitable.concat(disciplinesSuitable);
next();
}, response('disciplines'));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment