Subversion Repositories bacoAlunos

Rev

Rev 1409 | Rev 1413 | 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" %>
7
<%@ page import="java.util.List" %>
8
<%@ page import="pt.estgp.estgweb.web.exceptions.NotAuthorizedException" %>
9
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
10
<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %>
11
<%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %>
12
<%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %>
13
<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %>
14
<%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles" %>
15
<%@ taglib uri="/WEB-INF/tlds/baco.tld" prefix="baco" %>
16
<%@ taglib uri="/WEB-INF/tlds/jomm.tld" prefix="jomm" %>
17
<jsp:useBean id="UserSession" type="pt.estgp.estgweb.domain.UserSessionImpl" scope="request"/>
18
 
19
<%
20
    String questionarioIdStr = request.getParameter("questionarioId");
21
    long questionarioId = Long.parseLong(questionarioIdStr);
22
 
23
    AbstractDao.getCurrentSession().beginTransaction();
24
 
25
    QuestionarioImpl questionario = (QuestionarioImpl) DaoFactory.getQuestionarioDaoImpl().load(questionarioId);
26
    questionario.initClearances(UserSession,true);
27
    request.setAttribute("Questionario",questionario);
28
 
29
    if(!questionario.isClear(UserSession,QuestionarioImpl.QuestionarioClearancesOperation.QUESTIONARIO_SEE_DASHBOARD.name()))
30
    {
31
        return; //NAO PODE VER O PAINEL
32
    }
33
    else
34
    {
35
        QuestionarioDaoImpl.QuestionarioStatsVars questionarioStatsVars = DaoFactory.getQuestionarioDaoImpl().loadQuestionarioStatsPedagogico(questionarioId);
36
%>
37
<div class="col-sm-6">
38
    <div class="alert alert-info">
39
        <%=questionarioStatsVars.respostasObtidas%> respostas obtidas de <%=questionarioStatsVars.respostasRequisitadas%> possiveis
40
    </div>
41
</div>
42
<div class="col-sm-6">
43
    <baco:clearOperation name="Questionario" op="QUESTIONARIO_STOP_PROCESSEMENT">
44
        <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>
45
    </baco:clearOperation>
46
</div>
47
<div class="col-sm-12">
48
        <table class="tablesorter-blue">
49
            <thead>
50
            <th>Cursos Selecionados</th>
51
            <th>Total de Unidades</th>
52
            <th>Unidades Não Selecionadas</th>
53
            <th>Unidades Selecionadas</th>
54
            <th>Turmas Selecionadas</th>
55
            <th>Alunos Selecionados</th>
56
            <th>Professores Selecionados</th>
57
            <th>Respondidos</th>
58
            <th>Por Responder</th>
59
            <th>Respostas Requisitadas</th>
60
 
61
            </thead>
62
            <tbody>
63
            <td><%=questionarioStatsVars.cursos%></td>
64
            <td><%=questionarioStatsVars.unidades%></td>
65
            <td><%=questionarioStatsVars.unidades - questionarioStatsVars.unidadesUsadas%></td>
66
            <td><%=questionarioStatsVars.unidadesUsadas%></td>
67
            <td><%=questionarioStatsVars.turmas%></td>
68
            <td><%=questionarioStatsVars.alunosDeUsadas%></td>
69
            <td><%=questionarioStatsVars.profsDeUsadas%></td>
70
            <td><label class="label label-success" style="font-size: 1em"><%=questionarioStatsVars.respostasObtidas%></label></td>
71
            <td><label class="label label-danger" style="font-size: 1em"><%=(questionarioStatsVars.respostasRequisitadas-questionarioStatsVars.respostasObtidas)%></label></td>
72
            <td><label class="label label-info" style="font-size: 1em"><%=questionarioStatsVars.respostasRequisitadas%></label></td>
73
 
74
            </tbody>
75
        </table>
76
</div>
77
<div class="col-sm-12">
78
    <table class="tablesorterfiltered">
79
        <thead>
80
            <th class="filter-name filter-select">Instituição</th>
81
            <th>Código</th>
82
            <th>Curso</th>
83
            <th>Unidades</th>
84
            <th>Respondidos</th>
85
            <th>Por Responder</th>
86
            <th>Total</th>
87
        </thead>
88
        <tbody>
89
    <%
90
        List<Long> cursos = DaoFactory.getQuestionarioPedagogicoCursoAfetoDaoImpl().findCursosAfetosIds(questionarioId);
91
        for(Long cursoId: cursos)
92
        {
93
            QuestionarioPedagogicoCursoAfeto cursoAfeto = DaoFactory.getQuestionarioPedagogicoCursoAfetoDaoImpl().load(cursoId);
94
            long respostasCurso = DaoFactory.getQuestionarioPedagogicoCursoAfetoDaoImpl().countRespostas(cursoId);
95
            request.setAttribute("cursoAfeto",cursoAfeto);
96
    %>
97
        <tr>
98
            <td><%=cursoAfeto.getNomeInstituicao()%></td>
99
            <td><%=cursoAfeto.getCodigoCurso()%></td>
100
            <td><%=cursoAfeto.getNome()%></td>
101
            <td>
102
                <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">
103
                    <%=cursoAfeto.getUnidadesAfetas().size()%>
104
                </a>
105
 
106
            </td>
1412 jmachado 107
            <td><label class="label <%=respostasCurso > 0 ? "label-success":"label-warning"%>" style="font-size: 1em"><%=respostasCurso%></label></td>
1409 jmachado 108
            <td><label class="label label-danger" style="font-size: 1em"><%=cursoAfeto.getStatRespostasRequisitadas() - respostasCurso%></label></td>
109
            <td><label class="label label-info" style="font-size: 1em"><%=cursoAfeto.getStatRespostasRequisitadas()%></label></td>
110
        </tr>
111
    <%
112
        }
113
        AbstractDao.getCurrentSession().getTransaction().commit();
114
    %>
115
        </tbody>
116
    </table>
117
 
118
</div>
119
<%
120
    }//FIM DE PAINEL CLEARED
121
%>