Rev 1409 | Rev 1474 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
<%@ page import="jomm.dao.impl.AbstractDao" %>
<%@ page import="org.hibernate.Query" %>
<%@ page import="pt.estgp.estgweb.domain.Questionario" %>
<%@ page import="pt.estgp.estgweb.domain.QuestionarioImpl" %>
<%@ page import="pt.estgp.estgweb.domain.QuestionarioPedagogicoCursoAfeto" %>
<%@ page import="pt.estgp.estgweb.domain.QuestionarioPedagogicoUnidadeCurricularAfeta" %>
<%@ page import="pt.estgp.estgweb.domain.dao.DaoFactory" %>
<%@ page import="java.util.List" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %>
<%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles" %>
<%@ taglib uri="/WEB-INF/tlds/baco.tld" prefix="baco" %>
<%@ taglib uri="/WEB-INF/tlds/jomm.tld" prefix="jomm" %>
<jsp:useBean id="UserSession" type="pt.estgp.estgweb.domain.UserSessionImpl" scope="request"/>
<%
String cursoAfetoId = request.getParameter("cursoAfetoId");
AbstractDao.getCurrentSession().beginTransaction();
QuestionarioPedagogicoCursoAfeto cursoAfeto = DaoFactory.getQuestionarioPedagogicoCursoAfetoDaoImpl().load(Long.parseLong(cursoAfetoId));
Questionario questionarioV = cursoAfeto.getQuestionario();
QuestionarioImpl questionario = (QuestionarioImpl) DaoFactory.getQuestionarioDaoImpl().narrow(questionarioV);
questionario.initClearances(UserSession,true);
request.setAttribute("Questionario",questionario);
if(!questionario.isClear(UserSession,QuestionarioImpl.QuestionarioClearancesOperation.QUESTIONARIO_SEE_DASHBOARD.name()))
{
return; //NAO PODE VER O PAINEL
}
else
{
Query q = AbstractDao.getCurrentSession().createQuery(
"select " +
" u.codigoUnidade " +
",u.nome " +
",t.cdDocente " +
",t.nomeDocente " +
",t.dsTipologia " +
",t.cdTurma " +
",sum (case when u.usar = true AND rR.resposta is null then 1 else 0 end) AS porResponder " +
",sum (case when u.usar = true AND rR.resposta is null then 0 else 1 end) AS respostasObtidas " +
",count(distinct a.aluno)" +
" from u in class " + QuestionarioPedagogicoUnidadeCurricularAfeta.class.getName() + " " +
" join u.cursoAfeto c " +
" join u.tipologiasRequisitadas t " +
" join t.alunosRequisitados a " +
" join a.respostaRequisitada rR " +
" left join rR.resposta r " +
" where c.id = :id group by t.id order by u.nome asc");
q.setLong("id",cursoAfeto.getId());
List<Object[]> tipologias = q.list();
%>
<div class="col-sm-12">
<table class="tablesorterfiltered">
<thead>
<th>Código</th>
<th>Unidade</th>
<th>Código Docente</th>
<th class="filter-name filter-select">Docente</th>
<th>Tipologia</th>
<th>Turma</th>
<th>Por Responder</th>
<th>Respondidos</th>
<th>Estudantes</th>
</thead>
<tbody>
<%
for(Object[] tipologia: tipologias)
{
%>
<tr>
<td><%=tipologia[0]%></td>
<td><%=tipologia[1]%></td>
<td><%=tipologia[2]%></td>
<td><%=tipologia[3]%></td>
<td><%=tipologia[4]%></td>
<td><%=tipologia[5]%></td>
<td><label class="label label-danger" style="font-size: 1em"><%=tipologia[6]%></label></td>
<td><label class="label <%=((Long)tipologia[7]) > 0 ? "label-success":"label-warning"%>" style="font-size: 1em"><%=tipologia[7]%></label></td>
<td><label class="label label-info" style="font-size: 1em"><%=tipologia[8]%></label></td>
</tr>
<%
}
%>
</tbody>
</table>
</div>
<%
AbstractDao.getCurrentSession().getTransaction().commit();
}//FIM DE PAINEL CLEARED
%>
Generated by GNU Enscript 1.6.5.2.