Rev 1583 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1379 | jmachado | 1 | <%@ page import="jomm.dao.impl.AbstractDao" %> |
1399 | jmachado | 2 | <%@ page import="pt.estgp.estgweb.domain.QuestionarioImpl" %> |
1379 | jmachado | 3 | <%@ page import="pt.estgp.estgweb.domain.dao.DaoFactory" %> |
1405 | jmachado | 4 | <%@ page import="pt.estgp.estgweb.domain.dao.impl.QuestionarioDaoImpl" %> |
1379 | jmachado | 5 | <%@ page import="pt.estgp.estgweb.utils.ConfigProperties" %> |
6 | <%@ page import="pt.estgp.estgweb.web.utils.RequestUtils" %> |
||
7 | <%@ page import="pt.utl.ist.berserk.logic.serviceManager.IServiceManager" %> |
||
8 | <%@ page import="pt.utl.ist.berserk.logic.serviceManager.ServiceManager" %> |
||
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" %> |
||
1583 | jmachado | 18 | <%@taglib prefix="bacoTemplates" tagdir="/WEB-INF/tags" %> |
1379 | jmachado | 19 | <% |
20 | String qId = request.getParameter("questionarioId"); |
||
21 | if(qId == null) |
||
22 | qId = request.getParameter("questionario.id"); |
||
23 | Long questionarioId = Long.parseLong(qId); |
||
24 | |||
25 | IServiceManager sm = ServiceManager.getInstance(); |
||
26 | String[] names = {"questionarioId"}; |
||
27 | Object[] args = {questionarioId}; |
||
28 | QuestionarioImpl questionario = (QuestionarioImpl) sm.execute(RequestUtils.getRequester(request, response),"loadQuestionarioAdmin",args,names); |
||
29 | |||
30 | |||
31 | request.setAttribute("Questionario", questionario); |
||
32 | |||
33 | |||
34 | AbstractDao.getCurrentSession().beginTransaction(); |
||
1583 | jmachado | 35 | /*JobServiceTaskImpl job = questionario.getAnswerGenerationTaskId() > 0 ? |
1379 | jmachado | 36 | (JobServiceTaskImpl) DaoFactory.getJobServiceTaskDaoImpl().load(questionario.getAnswerGenerationTaskId()) : |
37 | null; |
||
38 | request.setAttribute("Job", job); |
||
1583 | jmachado | 39 | */ |
1379 | jmachado | 40 | |
1692 | jmachado | 41 | |
1379 | jmachado | 42 | %> |
43 | |||
44 | |||
45 | |||
46 | <html:form action="/user/questionariosPaeSelectCourses"> |
||
47 | <jsp:useBean id="QuestionarioForm" type="pt.estgp.estgweb.web.form.questionarios.QuestionarioForm" scope="request"/> |
||
48 | |||
49 | <div class="container-fluid"> |
||
50 | |||
51 | |||
52 | <div class="panel panel-primary"> |
||
53 | <div class="panel-heading"> |
||
54 | Atribuição de Questionários/Alunos para o Questionário ${Questionario.id} - Periodo: ${Questionario.semestre} de ${Questionario.year} |
||
55 | </div> |
||
56 | <div class="panel-body"> |
||
57 | <html:errors/> |
||
58 | <jomm:messages/> |
||
59 | |||
60 | |||
61 | |||
62 | <div class="panel panel-primary" id="institutionGerarFinal"> |
||
63 | <div class="panel-heading"> |
||
64 | Atribuição de Questionários/Alunos ao Questionário |
||
65 | </div> |
||
66 | <div class="panel-body"> |
||
67 | |||
1399 | jmachado | 68 | <div class="col-sm-6"> |
69 | <baco:clearOperation name="Questionario" op="QUESTIONARIO_START_ASSIGN_ANSWERS"> |
||
70 | <div class="alert alert-warning">Esta operação vai atribuir questionários aos alunos das unidades curriculares seleccionadas |
||
71 | para o questionário ${Questionario.id} criado para o periodo ${Questionario.semestre} de ${Questionario.year}</div> |
||
72 | <div class="alert alert-info alert-small">Esta operação poderá ser revertida ou então repetida para atualizar os questionários atribuidos</div> |
||
73 | <div class="alert alert-info alert-small">Esta operação poderá demorar alguns instantes, consulte a barra de progresso</div> |
||
74 | <html:hidden property="questionario.id" value="${Questionario.id}"/> |
||
75 | <input type="hidden" name="questionarioId" value="${Questionario.id}"/> |
||
76 | <input type="hidden" name="dispatch" value="assignAnswers"/> |
||
77 | <button class="btn btn-warning" type="button" onclick="this.form.submit()">Atribuir</button> |
||
78 | </baco:clearOperation> |
||
1379 | jmachado | 79 | |
1399 | jmachado | 80 | <baco:notClearOperation name="Questionario" op="QUESTIONARIO_START_ASSIGN_ANSWERS"> |
81 | <baco:clearOperation name="Questionario" op="QUESTIONARIO_SEE_START_ASSIGN_ANSWERS"> |
||
82 | <div class="alert alert-warning">O sistema agendou a atribuição de cursos e unidades ao questionário ${Questionario.id} criado para o periodo ${Questionario.semestre} de ${Questionario.year}. Veja o progresso em baixo, caso não termine no final de 30 minutos esta tarefa ficará de novo disponivel</div> |
||
83 | </baco:clearOperation> |
||
84 | <baco:notClearOperation name="Questionario" op="QUESTIONARIO_SEE_START_ASSIGN_ANSWERS"> |
||
85 | <div class="alert alert-warning">Não têm autorização para ver esta secção</div> |
||
86 | </baco:notClearOperation> |
||
1379 | jmachado | 87 | |
1399 | jmachado | 88 | </baco:notClearOperation> |
89 | <a class="btn btn-default" href="#" data-href="<%=request.getContextPath()%>/user/questionarios/pedagogicoEstudante/questionarioLogState.jsp?questionarioId=${Questionario.id}" data-title="Registo de mudanças de estado do questionario ${Questionario.id}" data-toggle="modal" data-target="#modalAjaxRequest"> |
||
90 | Registo de Mudanças de Estado |
||
91 | </a> |
||
92 | </div> |
||
93 | |||
94 | <div class="col-sm-6"> |
||
1379 | jmachado | 95 | <baco:clearOperation name="Questionario" op="QUESTIONARIO_SEE_START_ASSIGN_ANSWERS"> |
1583 | jmachado | 96 | |
97 | |||
98 | <bacoTemplates:schedulleTaskProgress |
||
99 | targetUrlWithOutContextPath="/user/questionarioPedagogicoStartAssignAnswers.do?questionarioId=${Questionario.id}" |
||
100 | taskId="${Questionario.answerGenerationTaskId}" |
||
101 | transactional="true" |
||
102 | logSizeXs="true" |
||
103 | /> |
||
104 | <%-- |
||
1399 | jmachado | 105 | if(job != null) |
106 | { |
||
107 | SchedulleTasksForm schedulleTasksForm = new SchedulleTasksForm(); |
||
108 | schedulleTasksForm.setJobServiceTask(job); |
||
109 | schedulleTasksForm.setId(job.getId()); |
||
110 | request.setAttribute("SchedulleTasksForm",schedulleTasksForm); |
||
1404 | jmachado | 111 | if(job.getStatusEnum() == JobServiceTaskImpl.JobStatus.FAILED || |
1406 | jmachado | 112 | job.getStatusEnum() == JobServiceTaskImpl.JobStatus.UNKNOWN_ERROR || |
113 | job.getStatusEnum() == JobServiceTaskImpl.JobStatus.FINISHED_ERRORS ) |
||
1404 | jmachado | 114 | { |
1399 | jmachado | 115 | %> |
1404 | jmachado | 116 | <div class="alert alert-danger"><%=MessageResources.getInstance(request).getMessage("job.status."+job.getStatus())%>, Consulte o Log</div> |
117 | <% |
||
118 | } |
||
119 | %> |
||
1399 | jmachado | 120 | <div class="task-log task-log-xs" data-href="<%=request.getContextPath()%>/user/questionarioPedagogicoStartAssignAnswers.do?questionarioId=${Questionario.id}"> |
121 | <jsp:include page="/admin/configuration/taskLog.jsp"/> |
||
122 | </div> |
||
123 | <% |
||
124 | } |
||
125 | else |
||
126 | { |
||
127 | %> |
||
128 | <div class="alert alert-danger">O sistema não conseguiu encontrar a tarefa de atribuição nas tarefas agendadas, por favor verifique em todos os logs de tarefas <html:link action="/user/configurationJobTasks">Aqui</html:link> </div> |
||
129 | <% |
||
130 | } |
||
1583 | jmachado | 131 | %>--%> |
1399 | jmachado | 132 | |
1379 | jmachado | 133 | </baco:clearOperation> |
1399 | jmachado | 134 | </div> |
1379 | jmachado | 135 | |
1399 | jmachado | 136 | <div class="col-sm-12" style="margin-top: 20px"> |
137 | |||
1379 | jmachado | 138 | <% |
1405 | jmachado | 139 | QuestionarioDaoImpl.QuestionarioStatsVars questionarioStatsVars = DaoFactory.getQuestionarioDaoImpl().loadQuestionarioStatsPedagogico(questionarioId); |
1399 | jmachado | 140 | |
141 | |||
142 | |||
143 | %> |
||
144 | <div class="alert alert-info">Por favor confira estes valores com os resultados apresentados no LOG</div> |
||
145 | <table class="tablesorter-blue"> |
||
146 | <thead> |
||
1426 | jmachado | 147 | <th>Cursos Selecionados</th> |
148 | <th>Total de Unidades</th> |
||
149 | <th>Unidades Não Selecionadas</th> |
||
150 | <th>Unidades Selecionadas</th> |
||
151 | <th>Turmas Selecionadas</th> |
||
152 | <th>Alunos Selecionados</th> |
||
153 | <th>Professores Selecionados</th> |
||
154 | <th>Tipologias Selecionadas</th> |
||
155 | <th>Respondidos</th> |
||
156 | <th>Por Responder</th> |
||
157 | <th>Respostas Requisitadas</th> |
||
158 | |||
1399 | jmachado | 159 | </thead> |
160 | <tbody> |
||
1426 | jmachado | 161 | <td><%=questionarioStatsVars.cursos%></td> |
162 | <td><%=questionarioStatsVars.unidades%></td> |
||
163 | <td><%=questionarioStatsVars.unidades - questionarioStatsVars.unidadesUsadas%></td> |
||
164 | <td><%=questionarioStatsVars.unidadesUsadas%></td> |
||
165 | <td><%=questionarioStatsVars.turmas%></td> |
||
166 | <td><%=questionarioStatsVars.alunosDeUsadas%></td> |
||
167 | <td><%=questionarioStatsVars.profsDeUsadas%></td> |
||
168 | <td><%=questionarioStatsVars.tipologiasUsadas%></td> |
||
169 | <td><label class="label label-success" style="font-size: 1em"><%=questionarioStatsVars.respostasObtidas%></label></td> |
||
170 | <td><label class="label label-danger" style="font-size: 1em"><%=(questionarioStatsVars.respostasRequisitadas-questionarioStatsVars.respostasObtidas)%></label></td> |
||
171 | <td><label class="label label-info" style="font-size: 1em"><%=questionarioStatsVars.respostasRequisitadas%></label></td> |
||
172 | |||
1399 | jmachado | 173 | </tbody> |
174 | </table> |
||
175 | </div> |
||
1379 | jmachado | 176 | </div> |
177 | |||
178 | </div> |
||
179 | <div class="col-sm-12"> |
||
180 | <html:link action="/user/adminQuestionario?questionario.id=${Questionario.id}#NOWTASK" styleClass="btn btn-danger">Voltar à administração</html:link> |
||
181 | </div> |
||
182 | |||
1399 | jmachado | 183 | |
1379 | jmachado | 184 | </div> |
185 | </div> |
||
186 | </div> |
||
187 | <% |
||
188 | AbstractDao.getCurrentSession().getTransaction().commit(); |
||
189 | %> |
||
190 | |||
191 | </html:form> |