From 54cd4a79c8bbe98378e109c92cd0eb2a13f0402f Mon Sep 17 00:00:00 2001 From: Rey Reyes Date: Tue, 26 Apr 2016 11:33:52 -0430 Subject: [PATCH] Update section view with students with 75%< assitance --- .../report/section_assist.controller.js | 17 +++++++++-- app/partials/report/section_assist.html | 29 +++++++++++++++++++ 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/app/partials/report/section_assist.controller.js b/app/partials/report/section_assist.controller.js index a194883..7d3ebf9 100644 --- a/app/partials/report/section_assist.controller.js +++ b/app/partials/report/section_assist.controller.js @@ -15,7 +15,9 @@ vm.percentage = 0; vm.positive = 0; vm.professor = null; + vm.students = []; vm.negative = 0; + vm.flag = false; professors.get({ id: professorid }, function (successResult){ @@ -31,6 +33,7 @@ angular.forEach (vm.section.students, function (value){ vm.lectures = value.assistance; + vm.subTotal = 0; angular.forEach (value.assistanceTotal, function (valued){ @@ -39,9 +42,19 @@ } else { vm.negative++; } - }); + vm.subTotal = vm.positive + vm.negative; + }); + if(((vm.positive/vm.subTotal)*100)<75){ + vm.students.push(value); + vm.flag = true; + }; + vm.positiveTotal = vm.positiveTotal + vm.positive; + vm.negativeTotal = vm.negativeTotal + vm.negative; + vm.positive = 0; + vm.negative = 0; + vm.subTotal = 0; }); - vm.total = vm.positive + vm.negative; + vm.total = vm.positiveTotal + vm.negativeTotal; vm.percentage = (vm.positive/vm.total)*100; }, function (){ diff --git a/app/partials/report/section_assist.html b/app/partials/report/section_assist.html index aea94e1..1e6f66d 100644 --- a/app/partials/report/section_assist.html +++ b/app/partials/report/section_assist.html @@ -6,7 +6,36 @@
Estadisticas
Porcentaje de Asistencia: {{vm.percentage}} %
Total de Dias de Clase: {{vm.lectures}}
+

+ +
+ +

Estudiantes con menos de 75% de Asistencia

+ + + + + + + + + + + + + + + +
+ Cedula + + Nombre + + Apellido +
{{ student.id }}{{ student.name }}{{ student.lastname }}
+
+