Subversion Repositories bacoAlunos

Compare Revisions

Ignore whitespace Rev 1470 → Rev 1471

/branches/v3/impl/src/java/pt/estgp/estgweb/domain/dao/impl/QuestionarioDaoImpl.java
111,6 → 111,25
else
return 0;
}
public long getNumeroAlunosComRespostas(long questionarioId)
{
Query q = AbstractDao.getCurrentSession().createQuery("SELECT " +
" count(distinct a.aluno.id) AS respostasAlunos " +
"from " + QuestionarioPedagogicoCursoAfeto.class.getName() + " c " +
"JOIN c.questionario q " +
"JOIN c.unidadesAfetas u " +
"JOIN u.tipologiasRequisitadas t " +
"JOIN t.alunosRequisitados a " +
"JOIN a.respostaRequisitada rR " +
"JOIN rR.resposta r " +
"WHERE q.id = :id ");
 
q.setLong("id",questionarioId);
Object result = q.uniqueResult();
if(result != null)
return (Long) result;
return 0;
}
public long getNumeroUnidadesUsadas(long questionarioId)
{
Query q = getCurrentSession().createQuery
285,6 → 304,7
public long profsTimeStudents;
public long respostasRequisitadas;
public long respostasObtidas;
public long alunosQueResponderam;
}
 
 
326,6 → 346,7
questionarioStatsVars.profsDeUsadas = (Long) results[6];
questionarioStatsVars.tipologiasUsadas = (Long) results[7];
questionarioStatsVars.profsTimeStudents = (Long) results[8];
questionarioStatsVars.alunosQueResponderam = getNumeroAlunosComRespostas(questionarioId);
questionarioStatsVars.respostasRequisitadas = getNumeroRespostasRequisitadas(questionarioId);
questionarioStatsVars.respostasObtidas = getNumeroRespostas(questionarioId);
questionarioStatsVars.unidadesUsadas = getNumeroUnidadesUsadas(questionarioId);
/branches/v3/impl/src/java/pt/estgp/estgweb/domain/dao/impl/QuestionarioPedagogicoCursoAfetoDaoImpl.java
128,5 → 128,23
return 0;
}
 
public long countAlunos(long cursoAfetoId)
{
Query q = AbstractDao.getCurrentSession().createQuery("SELECT " +
" count(distinct a.aluno.id) AS respostasAlunos " +
"from " + QuestionarioPedagogicoCursoAfeto.class.getName() + " c " +
"JOIN c.unidadesAfetas u " +
"JOIN u.tipologiasRequisitadas t " +
"JOIN t.alunosRequisitados a " +
"JOIN a.respostaRequisitada rR " +
"WHERE c.id = :id ");
 
q.setLong("id",cursoAfetoId);
Object result = q.uniqueResult();
if(result != null)
return (Long) result;
return 0;
}
 
 
}
/branches/v3/impl/src/web/user/questionarios/pedagogicoEstudante/questionariosDocenteAbertos.jsp
11,7 → 11,8
 
Query q = AbstractDao.getCurrentSession().createQuery(
"select t from t in class " + QuestionarioPedagogicoTipologiaRequisitada.class.getName() +
" where t.docenteAfeto.id = " + UserSession.getUser().getId() + " and " +
" JOIN t.unidadeAfeta ua " +
" where ua.usar = true and t.docenteAfeto.id = " + UserSession.getUser().getId() + " and " +
" (t.unidadeAfeta.cursoAfeto.questionario.state = :s1 OR t.unidadeAfeta.cursoAfeto.questionario.state = :s2)"
);
q.setString("s1","PROCESSING_WITH_ANSWERS");
77,13 → 78,13
if(tipologiaRequisitada.getUnidadeAfeta().getCursoAfeto() == cursoAfeto)
{
%>
<div class="list-group-item clearfix" >
 
 
 
 
 
 
 
<%
Query qRespondidos = AbstractDao.getCurrentSession().createQuery("" +
"select count(distinct r.id) from t in class " + QuestionarioPedagogicoTipologiaRequisitada.class.getName() + " " +
96,18 → 97,24
//List e = qRespondidos.list();
Object respondidos = qRespondidos.uniqueResult();
 
if(tipologiaRequisitada.getAlunosRequisitados().size() > 0)
{
%>
<label class="label label-pill <%=respondidos == null ? "label-warning" : "label-success"%>" style="font-size: 1em"><%=respondidos == null ? 0 : ((Long)respondidos)%></label>
respondidos de
<label class="label label-pill label-info" style="font-size: 1em"><%=tipologiaRequisitada.getAlunosRequisitados().size()%></label>
<div class="list-group-item clearfix" >
<label class="label label-pill <%=respondidos == null ? "label-warning" : "label-success"%>" style="font-size: 1em"><%=respondidos == null ? 0 : ((Long)respondidos)%></label>
respondidos de
<label class="label label-pill label-info" style="font-size: 1em"><%=tipologiaRequisitada.getAlunosRequisitados().size()%></label>
 
<span style="margin-left: 10px" class="glyphicon glyphicon-arrow-right"> </span>
<span style="margin-left: 10px" class="glyphicon glyphicon-arrow-right"> </span>
 
<label class="bg-info " style="padding: 2px"><%=tipologiaRequisitada.getUnidadeAfeta().getNome()%></label>
(<%=tipologiaRequisitada.getUnidadeAfeta().getCodigoUnidade()%>)
<label class="badge badge-info"><%=tipologiaRequisitada.getDsTipologia()%></label>
</div>
<label class="bg-info " style="padding: 2px"><%=tipologiaRequisitada.getUnidadeAfeta().getNome()%></label>
 
(<%=tipologiaRequisitada.getUnidadeAfeta().getCodigoUnidade()%>)
<label class="bg-primary " style="padding: 2px"><%=tipologiaRequisitada.getCdTurma()%></label>
<label class="badge badge-info"><%=tipologiaRequisitada.getDsTipologia()%></label>
</div>
<%
}
}
}
%>
/branches/v3/impl/src/web/user/questionarios/pedagogicoEstudante/questionarioDashBoard.jsp
85,11 → 85,13
<th>Unidades Não Selecionadas</th>
<th>Unidades Selecionadas</th>
<th>Turmas Selecionadas</th>
<th>Alunos com Resposta %</th>
<th>Alunos com Resposta</th>
<th>Alunos Selecionados</th>
<th>Professores Selecionados</th>
<th>Tipologias Selecionadas</th>
<th>Respostas %</th>
<th>Respostas</th>
<th>Por Responder</th>
<th>Respostas Requisitadas</th>
 
</thead>
99,11 → 101,53
<td><%=questionarioStatsVars.unidades - questionarioStatsVars.unidadesUsadas%></td>
<td><%=questionarioStatsVars.unidadesUsadas%></td>
<td><%=questionarioStatsVars.turmas%></td>
<td>
<%
int percentage = (int) (questionarioStatsVars.alunosQueResponderam/questionarioStatsVars.alunosDeUsadas);
 
String percentageColor = "danger";
if(percentage < 20)
percentageColor = "danger";
else if(percentage < 40)
percentageColor = "warning";
else if(percentage < 60)
percentageColor = "info";
else
percentageColor = "success";
%>
<div class="progress">
<div class="progress-bar progress-bar-<%=percentageColor%>" role="progressbar" aria-valuenow="<%=percentage%>"
aria-valuemin="0" aria-valuemax="100" style="width:<%=percentage%>%">
<%=percentage%>%
</div>
</div>
</td>
<td><label class="label label-<%=percentageColor%>" style="font-size: 1em"><%=questionarioStatsVars.alunosQueResponderam%></label></td>
<td><%=questionarioStatsVars.alunosDeUsadas%></td>
<td><%=questionarioStatsVars.profsDeUsadas%></td>
<td><%=questionarioStatsVars.tipologiasUsadas%></td>
<td><label class="label label-success" style="font-size: 1em"><%=questionarioStatsVars.respostasObtidas%></label></td>
<td><label class="label label-danger" style="font-size: 1em"><%=(questionarioStatsVars.respostasRequisitadas-questionarioStatsVars.respostasObtidas)%></label></td>
<td>
<%
percentage = (int) (questionarioStatsVars.respostasObtidas/questionarioStatsVars.respostasRequisitadas);
 
percentageColor = "danger";
if(percentage < 20)
percentageColor = "danger";
else if(percentage < 40)
percentageColor = "warning";
else if(percentage < 60)
percentageColor = "info";
else
percentageColor = "success";
%>
<div class="progress">
<div class="progress-bar progress-bar-<%=percentageColor%>" role="progressbar" aria-valuenow="<%=percentage%>"
aria-valuemin="0" aria-valuemax="100" style="width:<%=percentage%>%">
<%=percentage%>%
</div>
</div>
</td>
<td><label class="label label-<%=percentageColor%>" style="font-size: 1em"><%=questionarioStatsVars.respostasObtidas%></label></td>
<td><label class="label label-info" style="font-size: 1em"><%=questionarioStatsVars.respostasRequisitadas%></label></td>
 
</tbody>
116,9 → 160,11
<th>Código</th>
<th>Curso</th>
<th>Unidades</th>
<th>% Alunos</th>
<th>Alunos com resposta</th>
<th>Alunos</th>
<th>% Respostas</th>
<th>Respostas</th>
<th>Por Responder</th>
<th>Total</th>
<th></th>
</thead>
130,7 → 176,15
QuestionarioPedagogicoCursoAfeto cursoAfeto = DaoFactory.getQuestionarioPedagogicoCursoAfetoDaoImpl().load(cursoId);
long respostasCurso = DaoFactory.getQuestionarioPedagogicoCursoAfetoDaoImpl().countRespostas(cursoId);
long alunosComRespostasCurso = DaoFactory.getQuestionarioPedagogicoCursoAfetoDaoImpl().countAlunosComRespostas(cursoId);
long alunosTotalCurso = DaoFactory.getQuestionarioPedagogicoCursoAfetoDaoImpl().countAlunos(cursoId);
if(alunosTotalCurso == 0)
alunosTotalCurso = 1;
if(alunosTotalCurso == 0)
alunosTotalCurso = 1;
 
request.setAttribute("cursoAfeto",cursoAfeto);
if(cursoAfeto.getStatRespostasRequisitadas() > 0)
{
%>
<tr>
<td><%=cursoAfeto.getNomeInstituicao()%></td>
142,9 → 196,52
</a>
 
</td>
<td><label class="label <%=alunosComRespostasCurso > 0 ? "label-success":"label-warning"%>" style="font-size: 1em"><%=alunosComRespostasCurso%></label></td>
<td><label class="label <%=respostasCurso > 0 ? "label-success":"label-warning"%>" style="font-size: 1em"><%=respostasCurso%></label></td>
<td><label class="label label-danger" style="font-size: 1em"><%=cursoAfeto.getStatRespostasRequisitadas() - respostasCurso%></label></td>
<td>
<%
percentage = (int) (alunosComRespostasCurso/alunosTotalCurso);
 
percentageColor = "danger";
if(percentage < 20)
percentageColor = "danger";
else if(percentage < 40)
percentageColor = "warning";
else if(percentage < 60)
percentageColor = "info";
else
percentageColor = "success";
%>
<div class="progress">
<div class="progress-bar progress-bar-<%=percentageColor%>" role="progressbar" aria-valuenow="<%=percentage%>"
aria-valuemin="0" aria-valuemax="100" style="width:<%=percentage%>%">
<%=percentage%>%
</div>
</div>
 
</td>
<td><label class="label label-<%=percentageColor%>" style="font-size: 1em"><%=alunosComRespostasCurso%></label></td>
<td><label class="label label-info" style="font-size: 1em"><%=alunosTotalCurso%></label></td>
<td>
<%
percentage = (int) (respostasCurso/cursoAfeto.getStatRespostasRequisitadas());
 
percentageColor = "danger";
if(percentage < 20)
percentageColor = "danger";
else if(percentage < 40)
percentageColor = "warning";
else if(percentage < 60)
percentageColor = "info";
else
percentageColor = "success";
%>
<div class="progress">
<div class="progress-bar progress-bar-<%=percentageColor%>" role="progressbar" aria-valuenow="<%=percentage%>"
aria-valuemin="0" aria-valuemax="100" style="width:<%=percentage%>%">
<%=percentage%>%
</div>
</div>
</td>
<td><label class="label label-<%=percentageColor%>" style="font-size: 1em"><%=respostasCurso%></label></td>
<td><label class="label label-info" style="font-size: 1em"><%=cursoAfeto.getStatRespostasRequisitadas()%></label></td>
<td>
<%
157,6 → 254,7
</td>
</tr>
<%
}
}
AbstractDao.getCurrentSession().getTransaction().commit();
%>