Rev 1404 | Rev 1406 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1379 | jmachado | 1 | <%@ page import="jomm.dao.impl.AbstractDao" %> |
1404 | jmachado | 2 | <%@ page import="jomm.utils.MessageResources" %> |
1399 | jmachado | 3 | <%@ page import="pt.estgp.estgweb.domain.JobServiceTaskImpl" %> |
4 | <%@ page import="pt.estgp.estgweb.domain.QuestionarioImpl" %> |
||
1379 | jmachado | 5 | <%@ page import="pt.estgp.estgweb.domain.dao.DaoFactory" %> |
1405 | jmachado | 6 | <%@ page import="pt.estgp.estgweb.domain.dao.impl.QuestionarioDaoImpl" %> |
1379 | jmachado | 7 | <%@ page import="pt.estgp.estgweb.utils.ConfigProperties" %> |
1399 | jmachado | 8 | <%@ page import="pt.estgp.estgweb.web.form.configuration.SchedulleTasksForm" %> |
1379 | jmachado | 9 | <%@ page import="pt.estgp.estgweb.web.utils.RequestUtils" %> |
10 | <%@ page import="pt.utl.ist.berserk.logic.serviceManager.IServiceManager" %> |
||
11 | <%@ page import="pt.utl.ist.berserk.logic.serviceManager.ServiceManager" %> |
||
12 | <%@ page import="java.util.List" %> |
||
13 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> |
||
14 | <%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %> |
||
15 | <%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %> |
||
16 | <%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %> |
||
17 | <%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %> |
||
18 | <%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles" %> |
||
19 | <%@ taglib uri="/WEB-INF/tlds/baco.tld" prefix="baco" %> |
||
20 | <%@ taglib uri="/WEB-INF/tlds/jomm.tld" prefix="jomm" %> |
||
21 | <% |
||
22 | String qId = request.getParameter("questionarioId"); |
||
23 | if(qId == null) |
||
24 | qId = request.getParameter("questionario.id"); |
||
25 | Long questionarioId = Long.parseLong(qId); |
||
26 | |||
27 | IServiceManager sm = ServiceManager.getInstance(); |
||
28 | String[] names = {"questionarioId"}; |
||
29 | Object[] args = {questionarioId}; |
||
30 | QuestionarioImpl questionario = (QuestionarioImpl) sm.execute(RequestUtils.getRequester(request, response),"loadQuestionarioAdmin",args,names); |
||
31 | |||
32 | |||
33 | request.setAttribute("Questionario", questionario); |
||
34 | |||
35 | |||
36 | AbstractDao.getCurrentSession().beginTransaction(); |
||
37 | JobServiceTaskImpl job = questionario.getAnswerGenerationTaskId() > 0 ? |
||
38 | (JobServiceTaskImpl) DaoFactory.getJobServiceTaskDaoImpl().load(questionario.getAnswerGenerationTaskId()) : |
||
39 | null; |
||
40 | request.setAttribute("Job", job); |
||
41 | |||
42 | List<String> institutionCodes = ConfigProperties.getListValues("questionario.instituition."); |
||
43 | |||
44 | %> |
||
45 | |||
46 | |||
47 | |||
48 | <html:form action="/user/questionariosPaeSelectCourses"> |
||
49 | <jsp:useBean id="QuestionarioForm" type="pt.estgp.estgweb.web.form.questionarios.QuestionarioForm" scope="request"/> |
||
50 | |||
51 | <div class="container-fluid"> |
||
52 | |||
53 | |||
54 | <div class="panel panel-primary"> |
||
55 | <div class="panel-heading"> |
||
56 | Atribuição de Questionários/Alunos para o Questionário ${Questionario.id} - Periodo: ${Questionario.semestre} de ${Questionario.year} |
||
57 | </div> |
||
58 | <div class="panel-body"> |
||
59 | <html:errors/> |
||
60 | <jomm:messages/> |
||
61 | |||
62 | |||
63 | |||
64 | <div class="panel panel-primary" id="institutionGerarFinal"> |
||
65 | <div class="panel-heading"> |
||
66 | Atribuição de Questionários/Alunos ao Questionário |
||
67 | </div> |
||
68 | <div class="panel-body"> |
||
69 | |||
1399 | jmachado | 70 | <div class="col-sm-6"> |
71 | <baco:clearOperation name="Questionario" op="QUESTIONARIO_START_ASSIGN_ANSWERS"> |
||
72 | <div class="alert alert-warning">Esta operação vai atribuir questionários aos alunos das unidades curriculares seleccionadas |
||
73 | para o questionário ${Questionario.id} criado para o periodo ${Questionario.semestre} de ${Questionario.year}</div> |
||
74 | <div class="alert alert-info alert-small">Esta operação poderá ser revertida ou então repetida para atualizar os questionários atribuidos</div> |
||
75 | <div class="alert alert-info alert-small">Esta operação poderá demorar alguns instantes, consulte a barra de progresso</div> |
||
76 | <html:hidden property="questionario.id" value="${Questionario.id}"/> |
||
77 | <input type="hidden" name="questionarioId" value="${Questionario.id}"/> |
||
78 | <input type="hidden" name="dispatch" value="assignAnswers"/> |
||
79 | <button class="btn btn-warning" type="button" onclick="this.form.submit()">Atribuir</button> |
||
80 | </baco:clearOperation> |
||
1379 | jmachado | 81 | |
1399 | jmachado | 82 | <baco:notClearOperation name="Questionario" op="QUESTIONARIO_START_ASSIGN_ANSWERS"> |
83 | <baco:clearOperation name="Questionario" op="QUESTIONARIO_SEE_START_ASSIGN_ANSWERS"> |
||
84 | <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> |
||
85 | </baco:clearOperation> |
||
86 | <baco:notClearOperation name="Questionario" op="QUESTIONARIO_SEE_START_ASSIGN_ANSWERS"> |
||
87 | <div class="alert alert-warning">Não têm autorização para ver esta secção</div> |
||
88 | </baco:notClearOperation> |
||
1379 | jmachado | 89 | |
1399 | jmachado | 90 | </baco:notClearOperation> |
91 | <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"> |
||
92 | Registo de Mudanças de Estado |
||
93 | </a> |
||
94 | </div> |
||
95 | |||
96 | <div class="col-sm-6"> |
||
1379 | jmachado | 97 | <baco:clearOperation name="Questionario" op="QUESTIONARIO_SEE_START_ASSIGN_ANSWERS"> |
1399 | jmachado | 98 | <% |
99 | if(job != null) |
||
100 | { |
||
101 | SchedulleTasksForm schedulleTasksForm = new SchedulleTasksForm(); |
||
102 | schedulleTasksForm.setJobServiceTask(job); |
||
103 | schedulleTasksForm.setId(job.getId()); |
||
104 | request.setAttribute("SchedulleTasksForm",schedulleTasksForm); |
||
1404 | jmachado | 105 | if(job.getStatusEnum() == JobServiceTaskImpl.JobStatus.FAILED || |
106 | job.getStatusEnum() == JobServiceTaskImpl.JobStatus.UNKNOWN_ERROR) |
||
107 | { |
||
1399 | jmachado | 108 | %> |
1404 | jmachado | 109 | <div class="alert alert-danger"><%=MessageResources.getInstance(request).getMessage("job.status."+job.getStatus())%>, Consulte o Log</div> |
110 | <% |
||
111 | } |
||
112 | %> |
||
1399 | jmachado | 113 | <div class="task-log task-log-xs" data-href="<%=request.getContextPath()%>/user/questionarioPedagogicoStartAssignAnswers.do?questionarioId=${Questionario.id}"> |
114 | <jsp:include page="/admin/configuration/taskLog.jsp"/> |
||
115 | </div> |
||
116 | <% |
||
117 | } |
||
118 | else |
||
119 | { |
||
120 | %> |
||
121 | <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> |
||
122 | <% |
||
123 | } |
||
124 | %> |
||
125 | |||
1379 | jmachado | 126 | </baco:clearOperation> |
1399 | jmachado | 127 | </div> |
1379 | jmachado | 128 | |
1399 | jmachado | 129 | <div class="col-sm-12" style="margin-top: 20px"> |
130 | |||
1379 | jmachado | 131 | <% |
1405 | jmachado | 132 | QuestionarioDaoImpl.QuestionarioStatsVars questionarioStatsVars = DaoFactory.getQuestionarioDaoImpl().loadQuestionarioStatsPedagogico(questionarioId); |
1399 | jmachado | 133 | |
134 | |||
135 | |||
136 | %> |
||
137 | <div class="alert alert-info">Por favor confira estes valores com os resultados apresentados no LOG</div> |
||
138 | <table class="tablesorter-blue"> |
||
139 | <thead> |
||
140 | <th>Cursos Selecionados</th> |
||
141 | <th>Total de Unidades</th> |
||
142 | <th>Unidades Não Selecionadas</th> |
||
143 | <th>Unidades Selecionadas</th> |
||
144 | <th>Turmas Selecionadas</th> |
||
145 | <th>Alunos Selecionados</th> |
||
146 | <th>Professores Selecionados</th> |
||
147 | <th>Máximo de questionários simples admitidos (Somatorio (Por cada Unidade Profs*Alunos))</th> |
||
148 | </thead> |
||
149 | <tbody> |
||
150 | <td><%=questionarioStatsVars.cursos%></td> |
||
151 | <td><%=questionarioStatsVars.unidades%></td> |
||
152 | <td><%=questionarioStatsVars.unidades - questionarioStatsVars.unidadesUsadas%></td> |
||
153 | <td><%=questionarioStatsVars.unidadesUsadas%></td> |
||
154 | <td><%=questionarioStatsVars.turmas%></td> |
||
155 | <td><%=questionarioStatsVars.alunosDeUsadas%></td> |
||
156 | <td><%=questionarioStatsVars.profsDeUsadas%></td> |
||
1405 | jmachado | 157 | <td><%=questionarioStatsVars.profsTimeStudents%></td> |
1399 | jmachado | 158 | </tbody> |
159 | </table> |
||
160 | </div> |
||
1379 | jmachado | 161 | </div> |
162 | |||
163 | </div> |
||
164 | <div class="col-sm-12"> |
||
165 | <html:link action="/user/adminQuestionario?questionario.id=${Questionario.id}#NOWTASK" styleClass="btn btn-danger">Voltar à administração</html:link> |
||
166 | </div> |
||
167 | |||
1399 | jmachado | 168 | |
1379 | jmachado | 169 | </div> |
170 | </div> |
||
171 | </div> |
||
172 | <% |
||
173 | AbstractDao.getCurrentSession().getTransaction().commit(); |
||
174 | %> |
||
175 | |||
176 | </html:form> |