Fix section and course assistance calculation

This commit is contained in:
Reynaldo Reyes
2016-04-12 23:26:18 -04:30
parent ee5cc1f019
commit 8fee773cf8
2 changed files with 2 additions and 4 deletions

View File

@@ -32,7 +32,6 @@
function (value){ function (value){
angular.forEach (value.students, angular.forEach (value.students,
function (valued){ function (valued){
vm.lectures = valued.assistance;
angular.forEach (valued.assistanceTotal, angular.forEach (valued.assistanceTotal,
function (valueda){ function (valueda){
if (valueda.assistance) { if (valueda.assistance) {
@@ -44,7 +43,7 @@
}); });
}); });
vm.total = vm.positive + vm.negative; vm.total = vm.positive + vm.negative;
vm.percentage = ((vm.positive/vm.total)/vm.lectures)*100; vm.percentage = (vm.positive/vm.total)*100;
}, },
function (){ function (){
console.log("Error al obtener los datos."); console.log("Error al obtener los datos.");

View File

@@ -30,7 +30,6 @@
angular.forEach (vm.section.students, angular.forEach (vm.section.students,
function (value){ function (value){
vm.lectures = value.assistance;
angular.forEach (value.assistanceTotal, angular.forEach (value.assistanceTotal,
function (valued){ function (valued){
if (valued.assistance) { if (valued.assistance) {
@@ -41,7 +40,7 @@
}); });
}); });
vm.total = vm.positive + vm.negative; vm.total = vm.positive + vm.negative;
vm.percentage = ((vm.positive/vm.total)/vm.lectures)*100; vm.percentage = (vm.positive/vm.total)*100;
}, },
function (){ function (){
console.log("Error al obtener los datos."); console.log("Error al obtener los datos.");