Update section view with students with 75%< assitance
This commit is contained in:
@@ -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 (){
|
||||
|
@@ -6,7 +6,36 @@
|
||||
<div> Estadisticas </div>
|
||||
<div> Porcentaje de Asistencia: {{vm.percentage}} % </div>
|
||||
<div> Total de Dias de Clase: {{vm.lectures}} </div>
|
||||
<br><br/>
|
||||
</div>
|
||||
|
||||
<div ng-show="vm.flag">
|
||||
|
||||
<h4> Estudiantes con menos de 75% de Asistencia </h4>
|
||||
<table class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="20%" style="text-align: center">
|
||||
Cedula
|
||||
</th>
|
||||
<th width="20%" style="text-align: center">
|
||||
Nombre
|
||||
</th>
|
||||
<th width="20%" style="text-align: center">
|
||||
Apellido
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="student in vm.students">
|
||||
<td style="vertical-align:middle">{{ student.id }}</td>
|
||||
<td style="vertical-align:middle">{{ student.name }}</td>
|
||||
<td style="vertical-align:middle">{{ student.lastname }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<button class = "btn-warning btn"
|
||||
type = "button"
|
||||
style = "margin: 10px"
|
||||
|
Reference in New Issue
Block a user