Subversion Repositories bacoAlunos

Rev

Rev 1032 | Rev 1077 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<%@ page import="pt.utl.ist.berserk.logic.serviceManager.IServiceManager" %>
<%@ page import="pt.utl.ist.berserk.logic.serviceManager.ServiceManager" %>
<%@ page import="java.util.List" %>
<%@ page import="pt.estgp.estgweb.web.utils.RequestUtils" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="pt.estgp.estgweb.domain.Teacher" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %>
<%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles" %>
<%@ taglib uri="/WEB-INF/tlds/baco.tld" prefix="baco" %>
<%@ taglib uri="/WEB-INF/tlds/jomm.tld" prefix="jomm" %>
<jsp:useBean id="CourseUnitEvaluationForm" type="pt.estgp.estgweb.web.form.courseunits.CourseUnitEvaluationForm" scope="request"/>
<jsp:useBean id="CourseUnitView" type="pt.estgp.estgweb.domain.views.CourseUnitView" scope="request"/>
<%--<jsp:useBean id="CourseUnitProgramView" type="pt.estgp.estgweb.domain.views.CourseUnitProgramView" scope="request"/>--%>
<jsp:useBean id="UserSession" type="pt.estgp.estgweb.domain.UserSession" scope="request"/>
<div id="contentIntranet">
<div id="contentPane">
<html:errors/>
<jomm:messages/>

<%
    IServiceManager sm = ServiceManager.getInstance();

    List<pt.estgp.estgweb.domain.views.CourseUnitView> otherYearUnits;
    otherYearUnits = new ArrayList<pt.estgp.estgweb.domain.views.CourseUnitView>();
    try{
        String[] names = new String[]{};
        Object[] args = new Object[]{new Long(CourseUnitView.getId())};
        otherYearUnits =
                (List<pt.estgp.estgweb.domain.views.CourseUnitView>)
                        sm.execute(RequestUtils.getRequester(request, response), "LoadUnitOtherYearsWithProgram", args, names);
        request.setAttribute("OtherYearUnits", otherYearUnits);


        names = new String[]{};
        args = new Object[]{};
        List<Teacher> teachers = (List<Teacher>)
                        sm.execute(RequestUtils.getRequester(request, response), "LoadTeachers", args, names);
        request.setAttribute("teachers", teachers);
    }catch(Exception e)
    {
        System.err.print(e.toString());
        e.printStackTrace();
    }

    boolean closed = CourseUnitEvaluationForm.getCourseUnitEvaluationView().getCourseUnitEvaluation().isClosed();
    boolean teacherComplete = CourseUnitEvaluationForm.getCourseUnitEvaluationView().getCourseUnitEvaluation().isTeacherComplete();


%>
<div class="seccao">
<h2>
    <bean:message key="courseunit.evaluation"/> - <%=CourseUnitView.getName()%> / <%=CourseUnitView.getImportYear()%>

</h2>
<%
    if(!closed)
    {
%>
<p class="WARNING"><bean:message key="courseunit.evaluation.warning"/></p>
<%
    }
%>

    <%
        boolean editCoordinatorPart = false;
        boolean editTeacherPart = false;
        pt.estgp.estgweb.domain.User u = UserSession.getUser();
        if(u.isSuperuserOrAdmin())
        {
            editCoordinatorPart = true;
            editTeacherPart = true;
        }
        else
        {
            if(u instanceof pt.estgp.estgweb.domain.Teacher)
            {
                pt.estgp.estgweb.domain.Teacher t = (pt.estgp.estgweb.domain.Teacher) u;
                if(t.isTeacherOfCourseUnit(CourseUnitView.getId()) || (CourseUnitView.getResponsableTeacher() != null && CourseUnitView.getResponsableTeacher().getId() == t.getId()))
                {
                    editTeacherPart = true;
                }
                if(CourseUnitView.getCourseView().getCoordinator() != null && (t.getId() == CourseUnitView.getCourseView().getCoordinator().getId() || t.hasRole(CourseUnitView.getCourseView().getValidationRole())))
                {
                    editCoordinatorPart = true;
                }

            }
        }
%>


    <%

        //todo é necessário um servico para ver se tem estes papeis
        if((CourseUnitView.getResponsableTeacher() != null && CourseUnitView.getResponsableTeacher().getId() == UserSession.getUser().getId())
                ||
                CourseUnitView.isOwnedBy(UserSession.getUser(),false)
                ||
                //Validation Role e o papel da comissão de curso
                UserSession.getUser().hasRole(CourseUnitView.getCourseView().getValidationRole()))
        {


%>

<%
            if(closed)
            {
%>
                <table>
                    <tr>
                        <td>
                            <table style="width: 100%" class="processActivity" cellpadding="0" cellspacing="0">
                                <tr>
                                    <td class="processActivityTail"><img src="<%=request.getContextPath()%>/imgs/process/leftProcess.gif"/></td>
                                    <td class="processActivityName" style="width: 100%">Criado</td>
                                    <td class="processActivityArrow"><img src="<%=request.getContextPath()%>/imgs/process/rightProcess.gif"/></td>
                                </tr>
                            </table>
                        </td>
                        <td>
                            <table style="width: 100%" class="processActivity" cellpadding="0" cellspacing="0">
                                <tr>
                                    <td class="processActivityTail"><img src="<%=request.getContextPath()%>/imgs/process/leftProcess.gif"/></td>
                                    <td class="processActivityName" style="width: 100%">Entregue</td>
                                    <td class="processActivityArrow"><img src="<%=request.getContextPath()%>/imgs/process/rightProcess.gif"/></td>
                                </tr>
                            </table>
                        </td>
                        <td>
                            <table style="width: 100%" class="processActivity" cellpadding="0" cellspacing="0">
                                <tr>
                                    <td class="processActivityTail"><img src="<%=request.getContextPath()%>/imgs/process/leftProcess.gif"/></td>
                                    <td class="processActivityName" style="width: 100%">Aceite</td>
                                    <td class="processActivityArrow"><img src="<%=request.getContextPath()%>/imgs/process/rightProcess.gif"/></td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
                <p class="success">Este formulário foi <label style="background-color: green">ACEITE</label> pela <bean:message key="user.role.${CourseUnitView.courseView.validationRole}"/></p>
<%
                if(editCoordinatorPart)
                {
%>
                <html:form action="/user/courseUnitEvaluationController">
                    <input type="hidden" name="dispatch" value="openEvaluation">
                    <html:hidden property="courseUnitView.id"/>

                <p>Caro <%=UserSession.getName()%>, membro da <bean:message key="user.role.${CourseUnitView.courseView.validationRole}"/>,
                    está autorizado a reabrir o relatório de avaliação para o corpo docente da unidade de ${CourseUnitView.name} poder editar.</p>
                    <input type="submit" value="Reabrir para edição (Comissão de Curso)"/> (Esta operação está disponível apenas a membros da Comissão de Curso)
                </html:form>

<%
                }
            }
            else if(!closed && teacherComplete)
            {
%>
                <h2>Relatório em estado <label style="background-color: yellow">ENTREGUE</label> à coordenação, aguarde que a coordenação aceite o relatório ou o abra novamente</h2>

                <table>
                    <tr>
                        <td>
                            <table style="width: 100%" class="processActivity" cellpadding="0" cellspacing="0">
                                <tr>
                                    <td class="processActivityTail"><img src="<%=request.getContextPath()%>/imgs/process/leftProcess.gif"/></td>
                                    <td class="processActivityName" style="width: 100%">Criado</td>
                                    <td class="processActivityArrow"><img src="<%=request.getContextPath()%>/imgs/process/rightProcess.gif"/></td>
                                </tr>
                            </table>
                        </td>
                        <td>
                            <table style="width: 100%" class="processActivity" cellpadding="0" cellspacing="0">
                                <tr>
                                    <td class="processActivityTail"><img src="<%=request.getContextPath()%>/imgs/process/leftProcess.gif"/></td>
                                    <td class="processActivityName" style="width: 100%">Entregue</td>
                                    <td class="processActivityArrow"><img src="<%=request.getContextPath()%>/imgs/process/rightProcess.gif"/></td>
                                </tr>
                            </table>
                        </td>
                        <td>
                            <table style="width: 100%" class="processActivity" cellpadding="0" cellspacing="0">
                                <tr>
                                    <td class="processActivityTail"><img src="<%=request.getContextPath()%>/imgs/process/leftProcessGray.gif"/></td>
                                    <td class="processActivityNameGray" style="width: 100%">Aceite</td>
                                    <td class="processActivityArrow"><img src="<%=request.getContextPath()%>/imgs/process/rightProcessGray.gif"/></td>
                                </tr>
                            </table>
                        </td>
                    </tr>



                </table>
<%
                    if(editCoordinatorPart)
                    {
%>
                <html:form action="/user/courseUnitEvaluationController">
                    <input type="hidden" name="dispatch" value="openEvaluation">
                    <html:hidden property="courseUnitView.id"/>

                    <p>Caro <%=UserSession.getName()%>, membro da <bean:message key="user.role.${CourseUnitView.courseView.validationRole}"/>,
                        está autorizado a reabrir o relatório de avaliação para o corpo docente da unidade de ${CourseUnitView.name}. poder editar</p>
                    <input type="submit" value="Reverter o estado ENTREGUE (Comissão de Curso)"/> (Esta operação está disponível apenas a membros da Comissão de Curso)
                </html:form>

<%
                    }
            }
            else
            {
%>
                    <h2>Formulário em estado <label style="background-color: red">NÃO ENTREGUE</label> para edição</h2>

                    <table>
                        <tr>
                            <td>
                                <table style="width: 100%" class="processActivity" cellpadding="0" cellspacing="0">
                                    <tr>
                                        <td class="processActivityTail"><img src="<%=request.getContextPath()%>/imgs/process/leftProcess.gif"/></td>
                                        <td class="processActivityName" style="width: 100%">Criado</td>
                                        <td class="processActivityArrow"><img src="<%=request.getContextPath()%>/imgs/process/rightProcess.gif"/></td>
                                    </tr>
                                </table>
                            </td>
                            <td>
                                <table style="width: 100%" class="processActivity" cellpadding="0" cellspacing="0">
                                    <tr>
                                        <td class="processActivityTail"><img src="<%=request.getContextPath()%>/imgs/process/leftProcessGray.gif"/></td>
                                        <td class="processActivityNameGray" style="width: 100%">Entregue</td>
                                        <td class="processActivityArrow"><img src="<%=request.getContextPath()%>/imgs/process/rightProcessGray.gif"/></td>
                                    </tr>
                                </table>
                            </td>
                            <td>
                                <table style="width: 100%" class="processActivity" cellpadding="0" cellspacing="0">
                                    <tr>
                                        <td class="processActivityTail"><img src="<%=request.getContextPath()%>/imgs/process/leftProcessGray.gif"/></td>
                                        <td class="processActivityNameGray" style="width: 100%">Aceite</td>
                                        <td class="processActivityArrow"><img src="<%=request.getContextPath()%>/imgs/process/rightProcessGray.gif"/></td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
<%
            }

%>

    <script>
        $( document ).ready(function() {
            <%
            if(closed)
            {
                %>
                $("#formEdit :input").attr("disabled", true);
                <%
            }
            if(!editTeacherPart && !editCoordinatorPart)
            {
                %>
                $("#formEdit :input").attr("disabled", true);
                <%
            }
            %>
        });

    </script>
<div id="formEdit">
    <html:form action="/user/courseUnitEvaluationController">
        <input type="hidden" name="dispatch" value="saveEvaluation">
        <html:hidden property="id"/>
        <html:hidden property="courseUnitView.id"/>



        <%--DOCENTE--%>
    <logic:equal value="true" name="CourseUnitEvaluationForm" property="courseUnitEvaluationView.fechar">
        <p class="alert-success">Esta avaliação será publicada no DTP em formato PDF após ordens dos orgãos competentes</p>
    </logic:equal>

    <%
    if(closed)
    {
    %>
        <%
            if(editCoordinatorPart || editTeacherPart)
            {
        %>
        <p>
            <a href="<%=request.getContextPath()%>/repositoryStream/<%=CourseUnitView.getEvaluationStreamId()%>">Relatório de avaliação em PDF
                <img src="<%=request.getContextPath()%>/imgs/mime/pdf.gif"/>
            </a>
        </p>
        <%
            }
        %>
    <%
        }
    %>

    <table class="dataTable tableDisabled" width="100%">
        <tr>
            <th colspan="2">Dados alterados pelo Docente da Unidade</th>
        </tr>

        <tr>
            <th align="right"><bean:message key="courseunit.evaluation.mapa1"/></th>
            <td  width="80%">
                <h3><bean:message key="courseunit.evaluation.mapa1.desc"/></h3>

                <table class="dataTable" width="100%">
                    <tr>
                        <th rowspan="2">
                            Nº Alunos Inscritos
                        </th>
                        <th rowspan="2">
                            Nº de alunos sem elementos de avaliação
                        </th>
                        <th colspan="5">
                            Nº de alunos aprovados em
                        </th>
                        <th rowspan="2">
                            Aprovados com a classificação entre 10 e 13 valores (%)
                        </th>
                        <th rowspan="2">
                            Aprovados com a classificação entre 14 e 16 valores (%)
                        </th>
                        <th rowspan="2">
                            Aprovados com a classificação entre 17 e 20 valores (%)
                        </th>
                    </tr>
                    <tr>
                        <th>Avaliação de frequência</th>
                        <th>Exame Época Normal</th>
                        <th>Exame Época Recurso</th>
                        <th>Exame Época Especial</th>
                        <th>Total</th>
                    </tr>
                    <tr>
                        <td align="center">
                            <html:text size="4" property="courseUnitEvaluationView.courseUnitEvaluation.numAlunosInscritos"/>
                        </td>
                        <td align="center">
                            <html:text size="4" property="courseUnitEvaluationView.courseUnitEvaluation.numAlunosSemElementosAvaliacao"/>
                        </td>
                        <td align="center">
                            <html:text size="4" property="courseUnitEvaluationView.courseUnitEvaluation.numAlunosAprovFrequencia"/>
                        </td>
                        <td align="center">
                            <html:text size="4" property="courseUnitEvaluationView.courseUnitEvaluation.numAlunosAprovNormal"/>
                        </td>
                        <td align="center">
                            <html:text size="4" property="courseUnitEvaluationView.courseUnitEvaluation.numAlunosAprovRecurso"/>
                        </td>
                        <td align="center">
                            <html:text size="4" property="courseUnitEvaluationView.courseUnitEvaluation.numAlunosAprovEspecial"/>
                        </td>
                        <td align="center">
                            <html:text size="4" property="courseUnitEvaluationView.courseUnitEvaluation.numAlunosAprovTotal"/>
                        </td>
                        <td align="center">
                            <html:text size="4" property="courseUnitEvaluationView.courseUnitEvaluation.numAlunosAprov1013"/>
                        </td>
                        <td align="center">
                            <html:text size="4" property="courseUnitEvaluationView.courseUnitEvaluation.numAlunosAprov1416"/>
                        </td>
                        <td align="center">
                            <html:text size="4" property="courseUnitEvaluationView.courseUnitEvaluation.numAlunosAprov1720"/>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <th>
                Auto-avaliação
            </th>
            <td>
                <table class="dataTable" width="100%">
                    <tr>
                        <th>Apreciação dos resultados quantitativos obtidos pelos estudantes</th>
                        <td width="80%">
                            <html:textarea style="width:100%;height: 200px" property="courseUnitEvaluationView.courseUnitEvaluation.qualApreciacaoQuantitivos"/>
                        </td>
                    </tr>
                    <tr>
                        <th>Apreciação do funcionamento da UC<br/>
                            (Condições de funcionamento da UC; problemas detetados; identificação de práticas pedagógicas de mérito ou deficientes; etc.)</th>
                        <td  width="80%">
                            <html:textarea style="width:100%;height: 200px" property="courseUnitEvaluationView.courseUnitEvaluation.qualApreciacaoUC"/>
                        </td>
                    </tr>
                    <tr>
                        <th>Apreciação do cumprimento do programa da UC<br/>
                            (Adequação das metodologias de ensino/aprendizagem utilizadas; competências efetivamente adquiridas e cumprimento dos conteúdos planificados)
                        </th>
                        <td  width="80%">
                            <html:textarea style="width:100%;height: 200px" property="courseUnitEvaluationView.courseUnitEvaluation.qualApreciacaoCumprimentoPrograma"/>
                        </td>
                    </tr>
                    <tr>
                        <th>
                            Conclusões<br/>
                            (Pontos fortes e fracos; sugestões de melhoria e respetivo plano de ação para a sua concretização)
                        </th>
                        <td  width="80%">
                            <html:textarea style="width:100%;height: 200px" property="courseUnitEvaluationView.courseUnitEvaluation.qualConclusoes"/>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td colspan="2">
            <%
            if(!teacherComplete && !closed && (editCoordinatorPart || editTeacherPart))
            {
            %>

            <input type="button" value="<bean:message key="save"/>" onclick="set(form,'saveEvaluation');form.submit()"/>

            <%
            }

            if(!closed && !teacherComplete && editTeacherPart)
                {
            %>

            <input type="button" value="<bean:message key="deliverEvaluation"/>" onclick="set(form,'teacherCompleteEvaluation');form.submit()"/>

            <%
            }


            if(!closed && editCoordinatorPart)
                {
            %>

            <input type="button" value="VALIDAR e FECHAR pela Comissão de Curso" onclick="set(form,'publishEvaluation');form.submit()"/>
            <%
                }
            %>
            </td>

        </tr>
    </table>


</html:form>
    <%
        }
    %>
</div>
</div>
</div>
</div>

Generated by GNU Enscript 1.6.5.2.