Rev 1472 | Rev 1476 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1409 | jmachado | 1 | <%@ page import="jomm.dao.impl.AbstractDao" %> |
2 | <%@ page import="pt.estgp.estgweb.domain.Questionario" %> |
||
3 | <%@ page import="pt.estgp.estgweb.domain.QuestionarioImpl" %> |
||
4 | <%@ page import="pt.estgp.estgweb.domain.QuestionarioPedagogicoCursoAfeto" %> |
||
5 | <%@ page import="pt.estgp.estgweb.domain.dao.DaoFactory" %> |
||
6 | <%@ page import="pt.estgp.estgweb.domain.dao.impl.QuestionarioDaoImpl" %> |
||
1426 | jmachado | 7 | <%@ page import="pt.estgp.estgweb.web.form.questionarios.QuestionarioMessage" %> |
8 | <%@ page import="java.net.URLEncoder" %> |
||
1409 | jmachado | 9 | <%@ page import="java.util.List" %> |
10 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> |
||
11 | <%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %> |
||
12 | <%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %> |
||
13 | <%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %> |
||
14 | <%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %> |
||
15 | <%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles" %> |
||
16 | <%@ taglib uri="/WEB-INF/tlds/baco.tld" prefix="baco" %> |
||
17 | <%@ taglib uri="/WEB-INF/tlds/jomm.tld" prefix="jomm" %> |
||
18 | <jsp:useBean id="UserSession" type="pt.estgp.estgweb.domain.UserSessionImpl" scope="request"/> |
||
1426 | jmachado | 19 | <html:errors/> |
20 | <jomm:messages/> |
||
1409 | jmachado | 21 | <% |
22 | String questionarioIdStr = request.getParameter("questionarioId"); |
||
1413 | jmachado | 23 | if(questionarioIdStr == null) |
24 | questionarioIdStr = (String) request.getAttribute("questionarioId"); |
||
25 | if(questionarioIdStr == null) |
||
26 | { |
||
27 | if(request.getAttribute("Questionario")!=null) |
||
28 | { |
||
29 | Questionario quest = (Questionario) request.getAttribute("Questionario"); |
||
30 | questionarioIdStr = quest.getId() + ""; |
||
31 | } |
||
1426 | jmachado | 32 | |
33 | if(request.getAttribute("QuestionarioMessage") != null) |
||
34 | { |
||
35 | questionarioIdStr = "" + ((QuestionarioMessage) request.getAttribute("QuestionarioMessage")).getQuestionarioId(); |
||
36 | } |
||
1413 | jmachado | 37 | } |
38 | |||
1409 | jmachado | 39 | long questionarioId = Long.parseLong(questionarioIdStr); |
40 | |||
41 | AbstractDao.getCurrentSession().beginTransaction(); |
||
42 | |||
43 | QuestionarioImpl questionario = (QuestionarioImpl) DaoFactory.getQuestionarioDaoImpl().load(questionarioId); |
||
44 | questionario.initClearances(UserSession,true); |
||
45 | request.setAttribute("Questionario",questionario); |
||
46 | |||
47 | if(!questionario.isClear(UserSession,QuestionarioImpl.QuestionarioClearancesOperation.QUESTIONARIO_SEE_DASHBOARD.name())) |
||
48 | { |
||
49 | return; //NAO PODE VER O PAINEL |
||
50 | } |
||
51 | else |
||
52 | { |
||
53 | QuestionarioDaoImpl.QuestionarioStatsVars questionarioStatsVars = DaoFactory.getQuestionarioDaoImpl().loadQuestionarioStatsPedagogico(questionarioId); |
||
54 | %> |
||
55 | <div class="col-sm-6"> |
||
56 | <div class="alert alert-info"> |
||
57 | <%=questionarioStatsVars.respostasObtidas%> respostas obtidas de <%=questionarioStatsVars.respostasRequisitadas%> possiveis |
||
58 | </div> |
||
59 | </div> |
||
60 | <div class="col-sm-6"> |
||
61 | <baco:clearOperation name="Questionario" op="QUESTIONARIO_STOP_PROCESSEMENT"> |
||
62 | <button class="btn btn-danger" type="button" data-toggle="modal" data-target="#confirm-ModalGeneric" data-message="Esta operação irá parar o questionário e os alunos não poderão responder!! Tem a certeza que deseja prosseguir?" data-href="<%=request.getContextPath()%>/user/questionariosPaeYearSemestre.do?dispatch=stopProcessement&questionarioId=${Questionario.id}"><span class="icon icon-stop"> </span> Parar Questionário</button> |
||
63 | </baco:clearOperation> |
||
1413 | jmachado | 64 | <baco:clearOperation name="Questionario" op="QUESTIONARIO_START_PROCESSEMENT"> |
65 | <button class="btn btn-success" type="button" data-toggle="modal" data-target="#confirm-ModalGeneric" data-message="Esta operação irá abrir o questionário para os alunos!! Tem a certeza que deseja prosseguir?" data-href="<%=request.getContextPath()%>/user/questionariosPaeYearSemestre.do?dispatch=startProcessement&questionarioId=${Questionario.id}"><span class="icon icon-play"> </span> Iniciar Questionário</button> |
||
66 | </baco:clearOperation> |
||
1426 | jmachado | 67 | |
68 | <td> |
||
69 | <% |
||
70 | String descEncoded = URLEncoder.encode(questionario.getDescription(),"ISO-8859-1"); |
||
71 | request.setAttribute("descEncoded",descEncoded); |
||
72 | %> |
||
73 | <html:link styleClass="btn btn-default" action="/user/startQuestionariosPaeMessagePedagogico.do?questionarioId=${Questionario.id}&formDescription=Mensagem para os alunos: ${descEncoded}&targetDispatch=sendEmailQuestionario&cursoAfetoOrUnidadeAfetaOrQuestionarioAfetoId=${Questionario.id}"> |
||
74 | <span class="glyphicon glyphicon-envelope"> </span> Enviar para todos os Cursos |
||
75 | </html:link> |
||
76 | </td> |
||
77 | |||
78 | <a href="<%=request.getContextPath()%>/user/questionariosPaeMessagePedagogico.do"/> |
||
1409 | jmachado | 79 | </div> |
80 | <div class="col-sm-12"> |
||
81 | <table class="tablesorter-blue"> |
||
82 | <thead> |
||
83 | <th>Cursos Selecionados</th> |
||
84 | <th>Total de Unidades</th> |
||
85 | <th>Unidades Não Selecionadas</th> |
||
86 | <th>Unidades Selecionadas</th> |
||
87 | <th>Turmas Selecionadas</th> |
||
1471 | jmachado | 88 | <th>Alunos com Resposta %</th> |
89 | <th>Alunos com Resposta</th> |
||
1409 | jmachado | 90 | <th>Alunos Selecionados</th> |
91 | <th>Professores Selecionados</th> |
||
1426 | jmachado | 92 | <th>Tipologias Selecionadas</th> |
1471 | jmachado | 93 | <th>Respostas %</th> |
1434 | jmachado | 94 | <th>Respostas</th> |
1409 | jmachado | 95 | <th>Respostas Requisitadas</th> |
96 | |||
97 | </thead> |
||
98 | <tbody> |
||
99 | <td><%=questionarioStatsVars.cursos%></td> |
||
100 | <td><%=questionarioStatsVars.unidades%></td> |
||
101 | <td><%=questionarioStatsVars.unidades - questionarioStatsVars.unidadesUsadas%></td> |
||
102 | <td><%=questionarioStatsVars.unidadesUsadas%></td> |
||
103 | <td><%=questionarioStatsVars.turmas%></td> |
||
1471 | jmachado | 104 | <td> |
105 | <% |
||
1473 | jmachado | 106 | int percentage = (int) (100.0 * ( ((float)questionarioStatsVars.alunosQueResponderam/((float)questionarioStatsVars.alunosDeUsadas)))); |
1471 | jmachado | 107 | |
108 | String percentageColor = "danger"; |
||
109 | if(percentage < 20) |
||
110 | percentageColor = "danger"; |
||
111 | else if(percentage < 40) |
||
112 | percentageColor = "warning"; |
||
113 | else if(percentage < 60) |
||
114 | percentageColor = "info"; |
||
115 | else |
||
116 | percentageColor = "success"; |
||
117 | %> |
||
118 | <div class="progress"> |
||
119 | <div class="progress-bar progress-bar-<%=percentageColor%>" role="progressbar" aria-valuenow="<%=percentage%>" |
||
120 | aria-valuemin="0" aria-valuemax="100" style="width:<%=percentage%>%"> |
||
121 | <%=percentage%>% |
||
122 | </div> |
||
123 | </div> |
||
124 | </td> |
||
125 | <td><label class="label label-<%=percentageColor%>" style="font-size: 1em"><%=questionarioStatsVars.alunosQueResponderam%></label></td> |
||
1409 | jmachado | 126 | <td><%=questionarioStatsVars.alunosDeUsadas%></td> |
127 | <td><%=questionarioStatsVars.profsDeUsadas%></td> |
||
1426 | jmachado | 128 | <td><%=questionarioStatsVars.tipologiasUsadas%></td> |
1471 | jmachado | 129 | <td> |
130 | <% |
||
1473 | jmachado | 131 | percentage = (int) (100.0 * ( ((float)questionarioStatsVars.respostasObtidas/((float)questionarioStatsVars.respostasRequisitadas)))); |
1471 | jmachado | 132 | percentageColor = "danger"; |
133 | if(percentage < 20) |
||
134 | percentageColor = "danger"; |
||
135 | else if(percentage < 40) |
||
136 | percentageColor = "warning"; |
||
137 | else if(percentage < 60) |
||
138 | percentageColor = "info"; |
||
139 | else |
||
140 | percentageColor = "success"; |
||
141 | %> |
||
142 | <div class="progress"> |
||
143 | <div class="progress-bar progress-bar-<%=percentageColor%>" role="progressbar" aria-valuenow="<%=percentage%>" |
||
144 | aria-valuemin="0" aria-valuemax="100" style="width:<%=percentage%>%"> |
||
145 | <%=percentage%>% |
||
146 | </div> |
||
147 | </div> |
||
148 | </td> |
||
149 | <td><label class="label label-<%=percentageColor%>" style="font-size: 1em"><%=questionarioStatsVars.respostasObtidas%></label></td> |
||
1409 | jmachado | 150 | <td><label class="label label-info" style="font-size: 1em"><%=questionarioStatsVars.respostasRequisitadas%></label></td> |
151 | |||
152 | </tbody> |
||
153 | </table> |
||
154 | </div> |
||
155 | <div class="col-sm-12"> |
||
156 | <table class="tablesorterfiltered"> |
||
157 | <thead> |
||
158 | <th class="filter-name filter-select">Instituição</th> |
||
159 | <th>Código</th> |
||
160 | <th>Curso</th> |
||
161 | <th>Unidades</th> |
||
1471 | jmachado | 162 | <th>% Alunos</th> |
163 | <th>Alunos com resposta</th> |
||
1434 | jmachado | 164 | <th>Alunos</th> |
1471 | jmachado | 165 | <th>% Respostas</th> |
1434 | jmachado | 166 | <th>Respostas</th> |
1409 | jmachado | 167 | <th>Total</th> |
1426 | jmachado | 168 | <th></th> |
1409 | jmachado | 169 | </thead> |
170 | <tbody> |
||
171 | <% |
||
172 | List<Long> cursos = DaoFactory.getQuestionarioPedagogicoCursoAfetoDaoImpl().findCursosAfetosIds(questionarioId); |
||
173 | for(Long cursoId: cursos) |
||
174 | { |
||
175 | QuestionarioPedagogicoCursoAfeto cursoAfeto = DaoFactory.getQuestionarioPedagogicoCursoAfetoDaoImpl().load(cursoId); |
||
176 | long respostasCurso = DaoFactory.getQuestionarioPedagogicoCursoAfetoDaoImpl().countRespostas(cursoId); |
||
1423 | jmachado | 177 | long alunosComRespostasCurso = DaoFactory.getQuestionarioPedagogicoCursoAfetoDaoImpl().countAlunosComRespostas(cursoId); |
1471 | jmachado | 178 | long alunosTotalCurso = DaoFactory.getQuestionarioPedagogicoCursoAfetoDaoImpl().countAlunos(cursoId); |
179 | if(alunosTotalCurso == 0) |
||
180 | alunosTotalCurso = 1; |
||
181 | if(alunosTotalCurso == 0) |
||
182 | alunosTotalCurso = 1; |
||
183 | |||
1409 | jmachado | 184 | request.setAttribute("cursoAfeto",cursoAfeto); |
1471 | jmachado | 185 | if(cursoAfeto.getStatRespostasRequisitadas() > 0) |
186 | { |
||
1409 | jmachado | 187 | %> |
188 | <tr> |
||
189 | <td><%=cursoAfeto.getNomeInstituicao()%></td> |
||
190 | <td><%=cursoAfeto.getCodigoCurso()%></td> |
||
191 | <td><%=cursoAfeto.getNome()%></td> |
||
192 | <td> |
||
193 | <a href="#" data-href="<%=request.getContextPath()%>/user/questionarios/pedagogicoEstudante/questionarioCourseDashBoard.jsp?cursoAfetoId=${cursoAfeto.id}" data-title="Acompanhamento de questionários do curso (${cursoAfeto.codigoCurso}) ${cursoAfeto.nome} da ${cursoAfeto.nomeInstituicao})" data-toggle="modal" data-target="#modalAjaxRequest"> |
||
194 | <%=cursoAfeto.getUnidadesAfetas().size()%> |
||
195 | </a> |
||
196 | |||
197 | </td> |
||
1471 | jmachado | 198 | <td> |
199 | <% |
||
1473 | jmachado | 200 | percentage = (int) (100.0 * ( ((float)alunosComRespostasCurso/((float)alunosTotalCurso)))); |
1471 | jmachado | 201 | percentageColor = "danger"; |
202 | if(percentage < 20) |
||
203 | percentageColor = "danger"; |
||
204 | else if(percentage < 40) |
||
205 | percentageColor = "warning"; |
||
206 | else if(percentage < 60) |
||
207 | percentageColor = "info"; |
||
208 | else |
||
209 | percentageColor = "success"; |
||
210 | %> |
||
211 | <div class="progress"> |
||
212 | <div class="progress-bar progress-bar-<%=percentageColor%>" role="progressbar" aria-valuenow="<%=percentage%>" |
||
213 | aria-valuemin="0" aria-valuemax="100" style="width:<%=percentage%>%"> |
||
214 | <%=percentage%>% |
||
215 | </div> |
||
216 | </div> |
||
217 | |||
218 | </td> |
||
219 | <td><label class="label label-<%=percentageColor%>" style="font-size: 1em"><%=alunosComRespostasCurso%></label></td> |
||
220 | <td><label class="label label-info" style="font-size: 1em"><%=alunosTotalCurso%></label></td> |
||
221 | <td> |
||
222 | <% |
||
1473 | jmachado | 223 | percentage = (int) (100.0 * ( ((float)respostasCurso/((float)cursoAfeto.getStatRespostasRequisitadas())))); |
1471 | jmachado | 224 | percentageColor = "danger"; |
225 | if(percentage < 20) |
||
226 | percentageColor = "danger"; |
||
227 | else if(percentage < 40) |
||
228 | percentageColor = "warning"; |
||
229 | else if(percentage < 60) |
||
230 | percentageColor = "info"; |
||
231 | else |
||
232 | percentageColor = "success"; |
||
233 | %> |
||
234 | <div class="progress"> |
||
235 | <div class="progress-bar progress-bar-<%=percentageColor%>" role="progressbar" aria-valuenow="<%=percentage%>" |
||
236 | aria-valuemin="0" aria-valuemax="100" style="width:<%=percentage%>%"> |
||
237 | <%=percentage%>% |
||
238 | </div> |
||
239 | </div> |
||
240 | </td> |
||
241 | <td><label class="label label-<%=percentageColor%>" style="font-size: 1em"><%=respostasCurso%></label></td> |
||
1409 | jmachado | 242 | <td><label class="label label-info" style="font-size: 1em"><%=cursoAfeto.getStatRespostasRequisitadas()%></label></td> |
1426 | jmachado | 243 | <td> |
244 | <% |
||
245 | String nomeCursoEncoded = URLEncoder.encode(cursoAfeto.getNome(),"ISO-8859-1"); |
||
246 | request.setAttribute("nomeCursoEncoded",nomeCursoEncoded); |
||
247 | %> |
||
248 | <html:link styleClass="btn btn-default" action="/user/startQuestionariosPaeMessagePedagogico.do?questionarioId=${Questionario.id}&formDescription=Mensagem para os alunos do curso ${nomeCursoEncoded} (${cursoAfeto.codigoCurso})&targetDispatch=sendEmailQuestionarioCursoAfeto&cursoAfetoOrUnidadeAfetaOrQuestionarioAfetoId=${cursoAfeto.id}"> |
||
249 | <span class="glyphicon glyphicon-envelope"> </span> |
||
250 | </html:link> |
||
251 | </td> |
||
1409 | jmachado | 252 | </tr> |
253 | <% |
||
1471 | jmachado | 254 | } |
1409 | jmachado | 255 | } |
256 | AbstractDao.getCurrentSession().getTransaction().commit(); |
||
257 | %> |
||
258 | </tbody> |
||
259 | </table> |
||
260 | |||
261 | </div> |
||
262 | <% |
||
263 | }//FIM DE PAINEL CLEARED |
||
264 | %> |