1,9 → 1,9 |
<%@ page import="java.util.List" %> |
<%@ page import="pt.estgp.estgweb.domain.Teacher" %> |
<%@ page import="jomm.utils.MessageResources" %> |
<%@ page import="pt.estgp.estgweb.Globals" %> |
<%@ page import="pt.estgp.estgweb.domain.Student" %> |
<%@ page import="pt.estgp.estgweb.domain.enums.RecordEnum" %> |
<%@ page import="pt.estgp.estgweb.domain.views.CourseUnitGradeView" %> |
<%@ page import="java.util.HashMap" %> |
<%@ page import="java.util.List" %> |
<%@ page import="java.util.Map" %> |
<%@ page contentType="text/html;charset=UTF-8" language="java" %> |
<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %> |
<%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %> |
57,6 → 57,11 |
%> |
<h2 class="warning">Apenas o aluno tem direito a consultar as suas notas</h2> |
<% |
}else if(ProfileForm.getUserView().getGrades() == null || ProfileForm.getUserView().getGrades().size() == 0) |
{ |
%> |
<h2 class="warning">Não tem notas para apresentar</h2> |
<% |
}else if(!ProfileForm.getUserView().isPropinasEmDia()) |
{ |
%> |
75,6 → 80,28 |
} |
); |
</script> |
<div class="block"> |
|
<% |
Map<Long,Integer> unidadeNota = new HashMap<Long,Integer>(); |
for(CourseUnitGradeView grade: ProfileForm.getUserView().getGrades()) |
{ |
Integer notaUnidade = unidadeNota.get(grade.getCourseUnit().getId()); |
if(notaUnidade == null || notaUnidade < grade.getGrade()) |
{ |
if(grade.getGrade() > 0) |
{ |
unidadeNota.put(grade.getCourseUnit().getId(),grade.getGrade()); |
} |
} |
} |
float total = 0; |
for(Integer nota: unidadeNota.values()) |
total+=nota; |
float media = total/((float)unidadeNota.size()); |
%> |
Média: <%=media%> |
</div> |
<table id="myTable" class="dataTable tablesorter"> |
<thead> |
<tr> |
131,5 → 158,6 |
<% |
} |
%> |
|
</div> |
</div> |