Rev 1434 | Rev 1472 | 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 | <% |
||
106 | int percentage = (int) (questionarioStatsVars.alunosQueResponderam/questionarioStatsVars.alunosDeUsadas); |
||
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 | <% |
||
131 | percentage = (int) (questionarioStatsVars.respostasObtidas/questionarioStatsVars.respostasRequisitadas); |
||
132 | |||
133 | percentageColor = "danger"; |
||
134 | if(percentage < 20) |
||
135 | percentageColor = "danger"; |
||
136 | else if(percentage < 40) |
||
137 | percentageColor = "warning"; |
||
138 | else if(percentage < 60) |
||
139 | percentageColor = "info"; |
||
140 | else |
||
141 | percentageColor = "success"; |
||
142 | %> |
||
143 | <div class="progress"> |
||
144 | <div class="progress-bar progress-bar-<%=percentageColor%>" role="progressbar" aria-valuenow="<%=percentage%>" |
||
145 | aria-valuemin="0" aria-valuemax="100" style="width:<%=percentage%>%"> |
||
146 | <%=percentage%>% |
||
147 | </div> |
||
148 | </div> |
||
149 | </td> |
||
150 | <td><label class="label label-<%=percentageColor%>" style="font-size: 1em"><%=questionarioStatsVars.respostasObtidas%></label></td> |
||
1409 | jmachado | 151 | <td><label class="label label-info" style="font-size: 1em"><%=questionarioStatsVars.respostasRequisitadas%></label></td> |
152 | |||
153 | </tbody> |
||
154 | </table> |
||
155 | </div> |
||
156 | <div class="col-sm-12"> |
||
157 | <table class="tablesorterfiltered"> |
||
158 | <thead> |
||
159 | <th class="filter-name filter-select">Instituição</th> |
||
160 | <th>Código</th> |
||
161 | <th>Curso</th> |
||
162 | <th>Unidades</th> |
||
1471 | jmachado | 163 | <th>% Alunos</th> |
164 | <th>Alunos com resposta</th> |
||
1434 | jmachado | 165 | <th>Alunos</th> |
1471 | jmachado | 166 | <th>% Respostas</th> |
1434 | jmachado | 167 | <th>Respostas</th> |
1409 | jmachado | 168 | <th>Total</th> |
1426 | jmachado | 169 | <th></th> |
1409 | jmachado | 170 | </thead> |
171 | <tbody> |
||
172 | <% |
||
173 | List<Long> cursos = DaoFactory.getQuestionarioPedagogicoCursoAfetoDaoImpl().findCursosAfetosIds(questionarioId); |
||
174 | for(Long cursoId: cursos) |
||
175 | { |
||
176 | QuestionarioPedagogicoCursoAfeto cursoAfeto = DaoFactory.getQuestionarioPedagogicoCursoAfetoDaoImpl().load(cursoId); |
||
177 | long respostasCurso = DaoFactory.getQuestionarioPedagogicoCursoAfetoDaoImpl().countRespostas(cursoId); |
||
1423 | jmachado | 178 | long alunosComRespostasCurso = DaoFactory.getQuestionarioPedagogicoCursoAfetoDaoImpl().countAlunosComRespostas(cursoId); |
1471 | jmachado | 179 | long alunosTotalCurso = DaoFactory.getQuestionarioPedagogicoCursoAfetoDaoImpl().countAlunos(cursoId); |
180 | if(alunosTotalCurso == 0) |
||
181 | alunosTotalCurso = 1; |
||
182 | if(alunosTotalCurso == 0) |
||
183 | alunosTotalCurso = 1; |
||
184 | |||
1409 | jmachado | 185 | request.setAttribute("cursoAfeto",cursoAfeto); |
1471 | jmachado | 186 | if(cursoAfeto.getStatRespostasRequisitadas() > 0) |
187 | { |
||
1409 | jmachado | 188 | %> |
189 | <tr> |
||
190 | <td><%=cursoAfeto.getNomeInstituicao()%></td> |
||
191 | <td><%=cursoAfeto.getCodigoCurso()%></td> |
||
192 | <td><%=cursoAfeto.getNome()%></td> |
||
193 | <td> |
||
194 | <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"> |
||
195 | <%=cursoAfeto.getUnidadesAfetas().size()%> |
||
196 | </a> |
||
197 | |||
198 | </td> |
||
1471 | jmachado | 199 | <td> |
200 | <% |
||
201 | percentage = (int) (alunosComRespostasCurso/alunosTotalCurso); |
||
202 | |||
203 | percentageColor = "danger"; |
||
204 | if(percentage < 20) |
||
205 | percentageColor = "danger"; |
||
206 | else if(percentage < 40) |
||
207 | percentageColor = "warning"; |
||
208 | else if(percentage < 60) |
||
209 | percentageColor = "info"; |
||
210 | else |
||
211 | percentageColor = "success"; |
||
212 | %> |
||
213 | <div class="progress"> |
||
214 | <div class="progress-bar progress-bar-<%=percentageColor%>" role="progressbar" aria-valuenow="<%=percentage%>" |
||
215 | aria-valuemin="0" aria-valuemax="100" style="width:<%=percentage%>%"> |
||
216 | <%=percentage%>% |
||
217 | </div> |
||
218 | </div> |
||
219 | |||
220 | </td> |
||
221 | <td><label class="label label-<%=percentageColor%>" style="font-size: 1em"><%=alunosComRespostasCurso%></label></td> |
||
222 | <td><label class="label label-info" style="font-size: 1em"><%=alunosTotalCurso%></label></td> |
||
223 | <td> |
||
224 | <% |
||
225 | percentage = (int) (respostasCurso/cursoAfeto.getStatRespostasRequisitadas()); |
||
226 | |||
227 | percentageColor = "danger"; |
||
228 | if(percentage < 20) |
||
229 | percentageColor = "danger"; |
||
230 | else if(percentage < 40) |
||
231 | percentageColor = "warning"; |
||
232 | else if(percentage < 60) |
||
233 | percentageColor = "info"; |
||
234 | else |
||
235 | percentageColor = "success"; |
||
236 | %> |
||
237 | <div class="progress"> |
||
238 | <div class="progress-bar progress-bar-<%=percentageColor%>" role="progressbar" aria-valuenow="<%=percentage%>" |
||
239 | aria-valuemin="0" aria-valuemax="100" style="width:<%=percentage%>%"> |
||
240 | <%=percentage%>% |
||
241 | </div> |
||
242 | </div> |
||
243 | </td> |
||
244 | <td><label class="label label-<%=percentageColor%>" style="font-size: 1em"><%=respostasCurso%></label></td> |
||
1409 | jmachado | 245 | <td><label class="label label-info" style="font-size: 1em"><%=cursoAfeto.getStatRespostasRequisitadas()%></label></td> |
1426 | jmachado | 246 | <td> |
247 | <% |
||
248 | String nomeCursoEncoded = URLEncoder.encode(cursoAfeto.getNome(),"ISO-8859-1"); |
||
249 | request.setAttribute("nomeCursoEncoded",nomeCursoEncoded); |
||
250 | %> |
||
251 | <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}"> |
||
252 | <span class="glyphicon glyphicon-envelope"> </span> |
||
253 | </html:link> |
||
254 | </td> |
||
1409 | jmachado | 255 | </tr> |
256 | <% |
||
1471 | jmachado | 257 | } |
1409 | jmachado | 258 | } |
259 | AbstractDao.getCurrentSession().getTransaction().commit(); |
||
260 | %> |
||
261 | </tbody> |
||
262 | </table> |
||
263 | |||
264 | </div> |
||
265 | <% |
||
266 | }//FIM DE PAINEL CLEARED |
||
267 | %> |