Subversion Repositories bacoAlunos

Rev

Rev 1994 | Blame | Compare with Previous | Last modification | View Log | RSS feed

<%@ page
        import="pt.estgp.estgweb.services.courses.coursereport.documentmodel.learningresults.components.UnitsLearningResultYear" %>
<%@ page
        import="pt.estgp.estgweb.services.courses.coursereport.documentmodel.learningresults.components.UnitsLearningResultSemester" %>
<%@ page
        import="pt.estgp.estgweb.services.courses.coursereport.documentmodel.learningresults.components.UnitsLearningResultUc" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<!--
@section objeto com seccoes e componentes
@optional @chapter capitulo do documento para esta seccao para contcatenar às subsections
-->

<script type="text/ng-template" id="pt_estgp_estgweb_services_courses_coursereport_documentmodel_CourseUnitsReportsSection">
    <div class="sections">
        <a name="indexCus"></a>
        <span ng-repeat="cu in section.sections" ng-init="cu.taxaAprovacao = 100 * cu.courseUnitEvaluation.numAlunosAprovTotal/(cu.courseUnitEvaluation.numAlunosInscritos - cu.courseUnitEvaluation.numAlunosSemElementosAvaliacao)">
            <a href="#cu{{$index}}" ng-class="{ 'alert-danger': (cu.courseUnitEvaluation.cumprimentoProgramaPercent &lt; 100) || cu.taxaAprovacao &lt; 75 || !cu.courseUnitEvaluation.closed || !cu.courseUnitEvaluation.teacherComplete}">
                {{cu.title}}
            </a> |
        </span>
        <div ng-repeat="cu in section.sections"
             class="section panel-primary">

            <a name="cu{{$index}}"></a>
            <span ng-if="$index != 0" class="glyphicon glyphicon-backward" ></span><a ng-if="$index != 0" href="#indexCus"> Voltar atrás</a>
            <div class="panel-heading"><h2>{{cu.title}}</h2></div>

            <div style="padding-left:20px">
                <div><h3><label class="label label-primary">Estado do Relatório</label></h3></div>

                <div ng-if="cu.courseUnitEvaluation.closed">
                    Entregue e Aceite
                </div>
                <div class="alert-danger" ng-if="cu.courseUnitEvaluation.closed && !cu.courseUnitEvaluation.teacherComplete">
                    Entregue mas não foi aprovado pela comissão
                </div>
                <div class="alert-danger" ng-if="!cu.courseUnitEvaluation.closed  && !cu.courseUnitEvaluation.teacherComplete">
                    Não foi entregue pelo docente para validação
                </div>

            </div>


            <div style="padding-left:20px">
                <div><h3><label class="label label-primary">Resultados</label></h3></div>
                <div>
                    <table class="tablesorter-blue"   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 colspan="2">
                                Aprovados com a classificação entre 10 e 13 valores
                            </th>
                            <th colspan="2">
                                Aprovados com a classificação entre 14 e 16 valores
                            </th>
                            <th colspan="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>
                            <th>Nº</th>
                            <th>%</th>
                            <th>Nº</th>
                            <th>%</th>
                            <th>Nº</th>
                            <th>%</th>
                        </tr>
                        <tr>
                            <td class="text-center">
                                {{cu.courseUnitEvaluation.numAlunosInscritos}}
                            </td>
                            <td class="text-center">
                                {{cu.courseUnitEvaluation.numAlunosSemElementosAvaliacao}}
                            </td>
                            <td class="text-center">
                                {{cu.courseUnitEvaluation.numAlunosAprovFrequencia}}
                            </td>
                            <td class="text-center">
                                {{cu.courseUnitEvaluation.numAlunosAprovNormal}}
                            </td>
                            <td class="text-center">
                                {{cu.courseUnitEvaluation.numAlunosAprovRecurso}}
                            </td>
                            <td style="text-align: center">
                                {{cu.courseUnitEvaluation.numAlunosAprovEspecial}}
                            </td>
                            <td class="text-center">
                                {{cu.courseUnitEvaluation.numAlunosAprovTotal}}
                            </td>
                            <td class="text-center">
                                {{cu.courseUnitEvaluation.numAlunosAprov1013}}
                            </td>
                            <td class="text-center">
                                {{cu.courseUnitEvaluation.numAlunosAprov1013Percent}}
                            </td>
                            <td class="text-center">
                                {{cu.courseUnitEvaluation.numAlunosAprov1416}}
                            </td>
                            <td class="text-center">
                                {{cu.courseUnitEvaluation.numAlunosAprov1416Percent}}
                            </td>
                            <td class="text-center">
                                {{cu.courseUnitEvaluation.numAlunosAprov1720}}
                            </td>
                            <td class="text-center">
                                {{cu.courseUnitEvaluation.numAlunosAprov1720Percent}}
                            </td>
                        </tr>
                    </table>
                </div>
            </div>

            <div style="padding-left:20px" >
                <div><h3><label class="label label-primary">Taxa de Aprovação</label></h3></div>
                <div ng-class="{ 'alert-danger': cu.taxaAprovacao &lt; 75 }">{{cu.taxaAprovacao}}%</div>
            </div>



            <div style="padding-left:20px">
                <div><h3><label class="label label-primary">Apreciação dos resultados quantitativos obtidos pelos estudantes</label></h3></div>
                <div>{{cu.courseUnitEvaluation.qualApreciacaoQuantitivos}}</div>
            </div>
            <div style="padding-left:20px">
                <div><h3><label class="label label-primary">Apreciação do funcionamento da UC</label></h3></div>
                <div>{{cu.courseUnitEvaluation.qualApreciacaoUC}}</div>
            </div>
            <div style="padding-left:20px">
                <div><h3><label class="label label-primary">Percentagem de cumprimento do programa da UC</label></h3></div>
                <div ng-class="{ 'alert-danger': (cu.courseUnitEvaluation.cumprimentoProgramaPercent &lt; 100) }">
                    {{cu.courseUnitEvaluation.cumprimentoProgramaPercent}}%
                </div>
            </div>
            <div style="padding-left:20px">
                <div><h3><label class="label label-primary">Apreciação do cumprimento do programa da UC</label></h3></div>
                <div>{{cu.courseUnitEvaluation.qualApreciacaoCumprimentoPrograma}}</div>
            </div>
            <div style="padding-left:20px">
                <div><h3><label class="label label-primary">Conclusões</label></h3></div>
                <div>{{cu.courseUnitEvaluation.qualConclusoes}}</div>
            </div>
        </div>
    </div>
</script>



<style>
    .dtpstats td, .dtpstats th{
        text-align: center !important;
    }
</style>
<script type="text/ng-template" id="pt_estgp_estgweb_services_courses_coursereport_documentmodel_reportucsummary_UnitsDtpTable">
    <div class="sections">

        <table class="table dtpstats">
            <thead>
            <tr>
                <th rowspan="2">Unidade Curricular</th>
                <th colspan="2">Planeamento</th>
                <th rowspan="2">Ficha Curricular</th>
                <th rowspan="2">Sumários</th>
                <th colspan="2">Avaliação</th>
                <th rowspan="2">Relatório de Avaliação</th>
                <th rowspan="2">Inquerito Pedagógico</th>
            </tr>
            <tr>
                <th>Conteúdos</th>
                <th>Calendarização</th>
                <th>Enunciados</th>
                <th>Pautas</th>
            </tr>
            </thead>
            <tbody>
            <tr>
                <th colspan="9">Semestre 1</th>
            </tr>
            <tr ng-repeat="dtpStat in comp.semester1.courseUnitDtpStats">
                <td>{{dtpStat.name}}</td>
                <td ng-class="{ 'alert-danger' : !dtpStat.planeamentoConteudos }"><input type="checkbox" ng-model="dtpStat.planeamentoConteudos"/></td>
                <td ng-class="{ 'alert-danger' : !dtpStat.planeamentoCalendarizacao }"><input  type="checkbox" ng-model="dtpStat.planeamentoCalendarizacao"/></td>
                <td ng-class="{ 'alert-danger' : !dtpStat.ficha }"><input  type="checkbox" ng-model="dtpStat.ficha"/></td>
                <td ng-class="{ 'alert-danger' : !dtpStat.sumarios }"><input  type="checkbox" ng-model="dtpStat.sumarios"/></td>
                <td ng-class="{ 'alert-danger' : !dtpStat.avaliacaoEnunciados }"><input  type="checkbox" ng-model="dtpStat.avaliacaoEnunciados"/></td>
                <td ng-class="{ 'alert-danger' : !dtpStat.avaliacaoPautas }"><input  type="checkbox" ng-model="dtpStat.avaliacaoPautas"/></td>
                <td ng-class="{ 'alert-danger' : !dtpStat.relatorio }"><input  type="checkbox" ng-model="dtpStat.relatorio"/></td>
                <td ng-class="{ 'alert-danger' : !dtpStat.inquerito }"><input  type="checkbox" ng-model="dtpStat.inquerito"/></td>
            </tr>
            <tr>
                <th colspan="9">Semestre 2</th>
            </tr>
            <tr ng-repeat="dtpStat in comp.semester2.courseUnitDtpStats">
                <td>{{dtpStat.name}}</td>
                <td ng-class="{ 'alert-danger' : !dtpStat.planeamentoConteudos }"><input type="checkbox" ng-model="dtpStat.planeamentoConteudos"/></td>
                <td ng-class="{ 'alert-danger' : !dtpStat.planeamentoCalendarizacao }"><input  type="checkbox" ng-model="dtpStat.planeamentoCalendarizacao"/></td>
                <td ng-class="{ 'alert-danger' : !dtpStat.ficha }"><input  type="checkbox" ng-model="dtpStat.ficha"/></td>
                <td ng-class="{ 'alert-danger' : !dtpStat.sumarios }"><input  type="checkbox" ng-model="dtpStat.sumarios"/></td>
                <td ng-class="{ 'alert-danger' : !dtpStat.avaliacaoEnunciados }"><input  type="checkbox" ng-model="dtpStat.avaliacaoEnunciados"/></td>
                <td ng-class="{ 'alert-danger' : !dtpStat.avaliacaoPautas }"><input  type="checkbox" ng-model="dtpStat.avaliacaoPautas"/></td>
                <td ng-class="{ 'alert-danger' : !dtpStat.relatorio }"><input  type="checkbox" ng-model="dtpStat.relatorio"/></td>
                <td ng-class="{ 'alert-danger' : !dtpStat.inquerito }"><input  type="checkbox" ng-model="dtpStat.inquerito"/></td>
            </tr>
            </tbody>
        </table>
    </div>
</script>



<style>
    .learning td
    {
        font-size: 0.7em;
    }
    .learning td input{
        width: 50px;
    }

    .learning td input:read-only{
        width: 50px;
        background-color: #cccccc;
    }
    .learning tr.year td {
        vertical-align: top;
        background-color: #aaaaaa;

        font-weight: bold;
    }
    .learning tr.period td {
        vertical-align: top;
        background-color: #dfdfdf;

    }
</style>
<script type="text/ng-template" id="pt_estgp_estgweb_services_courses_coursereport_documentmodel_learningresults_components_UnitsLearningResultsTable">
    <unitslearningresultstable>
    </unitslearningresultstable>
</script>



<script>
    angular.module("courseReportApp").directive('boundModel', function() {
        return {
            require: 'ngModel',
            link: function(scope, elem, attrs, ngModel) {
                scope.$watch(attrs.boundModel, function(newValue, oldValue) {
                    if(newValue != oldValue) {
                        ngModel.$setViewValue(newValue);
                        ngModel.$render();
                    }
                });
            }
        }
    });
    angular.module("courseReportApp").directive('unitslearningresultstable', function() {

        return {
            restrict: 'E',
            link: function($scope, element, attrs)
            {

                $scope.checkedDocuments = [];
                $scope.checkUnit = function(document,collection)
                {
                    if(document.checked)
                    {
                        var docContainer =
                            {
                                "document" : document,
                                "collection" : collection
                            }
                        $scope.checkedDocuments.push(docContainer);
                    }
                    else
                    {
                        angular.forEach($scope.checkedDocuments, function(documentContainer, key)
                        {
                            if(documentContainer.document == document)
                            {
                                var index = $scope.checkedDocuments.indexOf(documentContainer);
                                $scope.checkedDocuments.splice(index, 1);
                            }
                        });
                    }
                }
                $scope.changeDocumentCollection = function(collection)
                {
                    angular.forEach($scope.checkedDocuments, function(documentContainer, key)
                    {
                        collection.ucs.push(documentContainer.document);
                        delete documentContainer.document.checked;
                    });
                    angular.forEach($scope.checkedDocuments, function(documentContainer, key)
                    {
                        var index = documentContainer.collection.ucs.indexOf(documentContainer.document);
                        documentContainer.collection.ucs.splice(index, 1);
                    });
                    $scope.checkedDocuments = [];
                }
                $scope.avg = function(field,container, childs)
                {
                    if(!childs || childs.length == 0)
                        return 0;
                    var sum = 0;
                    var c;
                    for(c in childs)
                    {
                        if(childs[c] && childs[c][field])
                            sum += 1*childs[c][field];
                    }
                    container[field] = sum / childs.length;
                    return container[field];
                }
                $scope.percent = function(n,total)
                {
                    if(!n || n == 0 || !total || total == 0)
                        return 0;
                    return 100 * n / total;
                }
                $scope.reprovados = function(comp)
                {
                    if(comp.alunosInscritos && comp.semElementos && comp.aprovados)
                        return comp.alunosInscritos - comp.semElementos - comp.aprovados;
                    return 0;
                }
                $scope.removeComponent = function(index,list)
                {
                    list.splice(index,1);
                }
                $scope.hasYearUnits = function(year)
                {
                    for(s in year.semesters)
                    {
                        if(year.semesters[s].ucs && year.semesters[s].ucs.length > 0)
                            return true;
                    }
                    return false;
                }
                $scope.isInvalidAnfHaveUcs = function(year,years,index)
                {
                    if(year.ano > 0)
                        return false;

                    var s;
                    for(s in year.semesters)
                    {
                        if(year.semesters[s].ucs && year.semesters[s].ucs.length > 0)
                            return true;
                    }
                    years.splice(index,1);
                    return false;
                }
                $scope.addUc = function(semestre)
                {
                    semestre.ucs.push(
                        {
                            "@class" : "<%=UnitsLearningResultUc.class.getName()%>",
                            manual : true,
                            periodo : semestre.semestre,
                            alunosInscritos: 0,
                            aprovados: 0,
                            aprovados1013: 0,
                            aprovados1013Percent: 0,
                            aprovados1416: 0,
                            aprovados1416Percent: 0,
                            aprovados1720: 0,
                            aprovados1720Percent: 0,
                            aprovadosPercent: 0,
                            cumprimentoProgramaPercent: 0,
                            reprovados: 0,
                            reprovadosPercent: 0,
                            semElementos: 0,
                            semElementosPercent: 0,
                            sigesCode : 0
                        }
                    );
                }
                $scope.addAno = function(comp)
                {
                    if(!comp.years)
                        comp.years = [];
                    comp.years.push(
                        {
                            ano : 1,
                            "@class" : "<%=UnitsLearningResultYear.class.getName()%>",
                            manual : true,
                            "alunosInscritos": 0,
                            "aprovados": 0,
                            "aprovados1013": 0,
                            "aprovados1013Percent": 0,
                            "aprovados1416": 0,
                            "aprovados1416Percent": 0,
                            "aprovados1720": 0,
                            "aprovados1720Percent": 0,
                            "aprovadosPercent": 0,
                            "cumprimentoProgramaPercent": 0,
                            "reprovados": 0,
                            "reprovadosPercent": 0,
                            "semElementos": 0,
                            "semElementosPercent": 0,
                            semesters : [
                                {
                                    "@class" : "<%=UnitsLearningResultSemester.class.getName()%>",
                                    manual : true,
                                    semestre : "S1",
                                    alunosInscritos: 0,
                                    aprovados: 0,
                                    aprovados1013: 0,
                                    aprovados1013Percent: 0,
                                    aprovados1416: 0,
                                    aprovados1416Percent: 0,
                                    aprovados1720: 0,
                                    aprovados1720Percent: 0,
                                    aprovadosPercent: 0,
                                    cumprimentoProgramaPercent: 0,
                                    reprovados: 0,
                                    reprovadosPercent: 0,
                                    semElementos: 0,
                                    semElementosPercent: 0,
                                    ucs : []
                                },
                                {
                                    "@class" : "<%=UnitsLearningResultSemester.class.getName()%>",
                                    manual : true,
                                    semestre: "S2",
                                    alunosInscritos: 0,
                                    aprovados: 0,
                                    aprovados1013: 0,
                                    aprovados1013Percent: 0,
                                    aprovados1416: 0,
                                    aprovados1416Percent: 0,
                                    aprovados1720: 0,
                                    aprovados1720Percent: 0,
                                    aprovadosPercent: 0,
                                    cumprimentoProgramaPercent: 0,
                                    reprovados: 0,
                                    reprovadosPercent: 0,
                                    semElementos: 0,
                                    semElementosPercent: 0,
                                    ucs : []
                                }
                            ]
                        }
                    );
                }

            },
            templateUrl: function(elem,attrs) {
                return "unitslearningresultstable";
            }
        }
    });
</script>
<script type="text/ng-template" id="unitslearningresultstable">


    <div class="sections">
        <button class="btn btn-success" ng-click="addAno(comp)"><span class="glyphicon glyphicon-plus"></span> Ano Manual</button>
        <table class="table learning">
            <thead>
            <tr>
                <th rowspan="2">Mover</th>
                <th rowspan="2">Codigo</th>
                <th rowspan="2">Unidade Curricular</th>
                <th rowspan="2">Cumprimento do Programa</th>
                <th rowspan="2">Alunos Inscritos</th>
                <th colspan="2">Sem Elementos</th>
                <th colspan="2">Reprovados</th>
                <th colspan="2">Aprovados</th>
                <th colspan="2">Aprovados 10-13</th>
                <th colspan="2">Aprovados 14-16</th>
                <th colspan="2">Aprovados 17-20</th>
            </tr>
            <tr>
                <th>N</th>
                <th>%</th>
                <th>N</th>
                <th>%</th>
                <th>N</th>
                <th>%</th>
                <th>N</th>
                <th>%</th>
                <th>N</th>
                <th>%</th>
                <th>N</th>
                <th>%</th>
            </tr>
            </thead>
            <tbody>
            <tr colspan="17" ng-if="false" ng-repeat-start="year in comp.years"></tr>
            <tr class="year">
                <td colspan="3" ng-if="year.ano &gt; 0">

                    <button ng-disabled="hasYearUnits(year)" class="btn btn-danger btn-xs" ng-click="removeComponent($index,comp.years)"><span class="glyphicon glyphicon-remove"></span></button>
                    <span ng-if="!year.manual">{{year.ano}}ª ano</span>
                    <span ng-if="year.manual">
                        <select ng-model="year.ano" ng-options="c.v as c.n for c in [{v:1,n:'1º Ano'},{v:2,n:'2º Ano'},{v:3,n:'3º Ano'},{v:4,n:'4º Ano'},{v:5,n:'5º Ano'}]">
                        </select>
                    </span>

                </td>
                <td colspan="3" style="font-size: 1.0em !important" ng-if="isInvalidAnfHaveUcs(year,comp.years,$index)">
                    Unidades que não constam do plano (Verifique a situação com os serviços Académicos antes de continuar)
                    poderão constar de um plano antigo ou ter o código siges desatualizado.
                </td>
                <td><input readonly="true" type="number" ng-model="year.cumprimentoProgramaPercent" bound-model="avg('cumprimentoProgramaPercent',year,year.semesters)"></td>
                <td><input readonly="true" type="number" ng-model="year.alunosInscritos" bound-model="avg('alunosInscritos',year,year.semesters)"></td>
                <td><input readonly="true" type="number" ng-model="year.semElementos" bound-model="avg('semElementos',year,year.semesters)"></td>
                <td><input readonly="true" type="number" ng-model="year.semElementosPercent" bound-model="percent(year.semElementos,year.alunosInscritos)"></td>
                <td><input readonly="true" type="number" ng-model="year.reprovados"  bound-model="reprovados(year)"></td>
                <td><input readonly="true" type="number" ng-model="year.reprovadosPercent" bound-model="percent(year.reprovados,year.alunosInscritos)"></td>
                <td><input readonly="true" type="number" ng-model="year.aprovados" bound-model="year.aprovados1013*1 + year.aprovados1416*1 + year.aprovados1720*1"></td>
                <td><input readonly="true" type="number" ng-model="year.aprovadosPercent" bound-model="percent(year.aprovados,year.alunosInscritos)"></td>

                <td><input readonly="true" type="number" ng-model="year.aprovados1013" bound-model="avg('aprovados1013',year,year.semesters)"></td>
                <td><input readonly="true" type="number" ng-model="year.aprovados1013Percent" bound-model="percent(year.aprovados1013,year.aprovados)"></td>
                <td><input readonly="true" type="number" ng-model="year.aprovados1416" bound-model="avg('aprovados1416',year,year.semesters)"></td>
                <td><input readonly="true" type="number" ng-model="year.aprovados1416Percent" bound-model="percent(year.aprovados1416,year.aprovados)"></td>
                <td><input readonly="true" type="number" ng-model="year.aprovados1720" bound-model="avg('aprovados1720',year,year.semesters)"></td>
                <td><input readonly="true" type="number" ng-model="year.aprovados1720Percent" bound-model="percent(year.aprovados1720,year.aprovados)"></td>
            </tr>

            <tr ng-if="false" ng-repeat-start="s in year.semesters" ></tr>
            <tr class="period" ng-if="year.ano &gt; 0 || s.ucs.length > 0">
                <td colspan="3" class="period">Semestre {{s.semestre}} <button ng-click="changeDocumentCollection(s)" data-toggle="tooltip" title="Mover unidades para aqui" class="btn btn-xs btn-warning" ng-show="checkedDocuments.length"><span class="glyphicon glyphicon-arrow-left"></span></button>

                    <button class="btn btn-success pull-right" ng-click="addUc(s)"><span class="glyphicon glyphicon-plus"></span> UC Manual</button>
                </td>
                <td><input readonly="true" type="number" ng-model="s.cumprimentoProgramaPercent" bound-model="avg('cumprimentoProgramaPercent',s,s.ucs)"></td>
                <td><input readonly="true" type="number" ng-model="s.alunosInscritos" bound-model="avg('alunosInscritos',s,s.ucs)"></td>
                <td><input readonly="true" type="number" ng-model="s.semElementos" bound-model="avg('semElementos',s,s.ucs)"></td>
                <td><input readonly="true" type="number" ng-model="s.semElementosPercent" bound-model="percent(s.semElementos,s.alunosInscritos)"></td>
                <td><input readonly="true" type="number" ng-model="s.reprovados"  bound-model="reprovados(s)"></td>
                <td><input readonly="true" type="number" ng-model="s.reprovadosPercent" bound-model="percent(s.reprovados,s.alunosInscritos)"></td>
                <td><input readonly="true" type="number" ng-model="s.aprovados" bound-model="s.aprovados1013*1 + s.aprovados1416*1 + s.aprovados1720*1"></td>
                <td><input readonly="true" type="number" ng-model="s.aprovadosPercent" bound-model="percent(s.aprovados,s.alunosInscritos)"></td>

                <td><input readonly="true" type="number" ng-model="s.aprovados1013" bound-model="avg('aprovados1013',s,s.ucs)"></td>
                <td><input readonly="true" type="number" ng-model="s.aprovados1013Percent" bound-model="percent(s.aprovados1013,s.aprovados)"></td>
                <td><input readonly="true" type="number" ng-model="s.aprovados1416" bound-model="avg('aprovados1416',s,s.ucs)"></td>
                <td><input readonly="true" type="number" ng-model="s.aprovados1416Percent" bound-model="percent(s.aprovados1416,s.aprovados)"></td>
                <td><input readonly="true" type="number" ng-model="s.aprovados1720" bound-model="avg('aprovados1720',s,s.ucs)"></td>
                <td><input readonly="true" type="number" ng-model="s.aprovados1720Percent" bound-model="percent(s.aprovados1720,s.aprovados)"></td>
            </tr>
            <tr ng-repeat="u in s.ucs" ng-class="{'alert-danger': u.error}" >
                <td><input ng-model="u.error" type="hidden" bound-model="u.alunosInscritos < (u.aprovados*1 + u.semElementos*1)">
                    <input ng-model="u.checked" ng-click="checkUnit(u,s)" type="checkbox"></td>
                <td><input type="text" ng-readonly="!u.manual || u.manual == false" ng-model="u.sigesCode"></td>
                <td>

                    <input type="text" style="width: 150px" ng-if="!(!u.manual || u.manual == false)" ng-model="u.name">
                    <span ng-if="(!u.manual || u.manual == false)">{{u.name}}</span>
                    <button class="btn btn-danger btn-xs pull-right" ng-if="!(!u.manual || u.manual == false)" ng-click="removeComponent(index,s.ucs)"><span class="glyphicon glyphicon-remove"></span></button>
                </td>
                <td><input type="number" ng-model="u.cumprimentoProgramaPercent"></td>
                <td><input type="number" ng-model="u.alunosInscritos"></td>
                <td><input type="number" ng-model="u.semElementos"></td>
                <td><input readonly="true" type="number" ng-model="u.semElementosPercent" bound-model="percent(u.semElementos,u.alunosInscritos)"></td>
                <td><input readonly="true" type="number" ng-model="u.reprovados" bound-model="reprovados(u)"></td>
                <td><input readonly="true" type="number" ng-model="u.reprovadosPercent" bound-model="percent(u.reprovados,u.alunosInscritos)"></td>
                <td><input readonly="true" type="number" ng-model="u.aprovados" bound-model="u.aprovados1013*1 + u.aprovados1416*1 + u.aprovados1720*1"></td>
                <td><input readonly="true" type="number" ng-model="u.aprovadosPercent" bound-model="percent(u.aprovados,u.alunosInscritos)"></td>

                <td><input type="number" ng-model="u.aprovados1013"></td>
                <td><input readonly="true" type="number" ng-model="u.aprovados1013Percent" bound-model="percent(u.aprovados1013,u.aprovados)"></td>
                <td><input type="number" ng-model="u.aprovados1416"></td>
                <td><input readonly="true" type="number" ng-model="u.aprovados1416Percent" bound-model="percent(u.aprovados1416,u.aprovados)"></td>
                <td><input type="number" ng-model="u.aprovados1720"></td>
                <td><input readonly="true" type="number" ng-model="u.aprovados1720Percent" bound-model="percent(u.aprovados1720,u.aprovados)"></td>
            </tr>
            <tr ng-if="false" ng-repeat-end></tr>
            <tr ng-if="false" ng-repeat-end></tr>
            <tr class="year">
                <td colspan="3">Resultados Globais</td>


                <td><input readonly="true" type="number" ng-model="comp.cumprimentoProgramaPercent" bound-model="avg('cumprimentoProgramaPercent',comp,comp.years)"></td>
                <td><input readonly="true" type="number" ng-model="comp.alunosInscritos" bound-model="avg('alunosInscritos',comp,comp.years)"></td>
                <td><input readonly="true" type="number" ng-model="comp.semElementos" bound-model="avg('semElementos',comp,comp.years)"></td>
                <td><input readonly="true" type="number" ng-model="comp.semElementosPercent" bound-model="percent(comp.semElementos,comp.alunosInscritos)"></td>
                <td><input readonly="true" type="number" ng-model="comp.reprovados"  bound-model="reprovados(comp)"></td>
                <td><input readonly="true" type="number" ng-model="comp.reprovadosPercent" bound-model="percent(comp.reprovados,comp.alunosInscritos)"></td>
                <td><input readonly="true" type="number" ng-model="comp.aprovados" bound-model="comp.aprovados1013*1 + comp.aprovados1416*1 + comp.aprovados1720*1"></td>
                <td><input readonly="true" type="number" ng-model="comp.aprovadosPercent" bound-model="percent(comp.aprovados,comp.alunosInscritos)"></td>

                <td><input readonly="true" type="number" ng-model="comp.aprovados1013" bound-model="avg('aprovados1013',comp,comp.years)"></td>
                <td><input readonly="true" type="number" ng-model="comp.aprovados1013Percent" bound-model="percent(comp.aprovados1013,comp.aprovados)"></td>
                <td><input readonly="true" type="number" ng-model="comp.aprovados1416" bound-model="avg('aprovados1416',comp,comp.years)"></td>
                <td><input readonly="true" type="number" ng-model="comp.aprovados1416Percent" bound-model="percent(comp.aprovados1416,comp.aprovados)"></td>
                <td><input readonly="true" type="number" ng-model="comp.aprovados1720" bound-model="avg('aprovados1720',comp,comp.years)"></td>
                <td><input readonly="true" type="number" ng-model="comp.aprovados1720Percent" bound-model="percent(comp.aprovados1720,comp.aprovados)"></td>
            </tr>
            </tbody>
        </table>
        <%--<pre class="code">{{ comp | json }}</pre>--%>
    </div>
</script>



<script type="text/ng-template" id="pt_estgp_estgweb_services_courses_coursereport_documentmodel_learningresults_components_GlobalLearningResultsChartImg">
    <globallearningresultschartimg>
    </globallearningresultschartimg>
</script>
<script>
    angular.module("courseReportApp").directive('globallearningresultschartimg', function() {

        return {
            restrict: 'E',
            link: function($scope, element, attrs)
            {
                $scope.generateChart = function(comp)
                {

                    widgetCallWithActionParameters(
                        "<%=request.getContextPath()%>/user/courseReport.do",
                        "generateGlobalLearningResultsChartImg",
                        {
                            "courseReportDocument" : BacoJS.stringifyOrdered(angular.element($("#courseReportApp")).scope().report)
                        },
                        "#courseReportApp",
                        function(repositoryFile4JsonView)
                        {
                            comp.image = repositoryFile4JsonView;
                            comp.imageUrl = "<%=request.getContextPath()%>/repositoryStream/" + comp.image.identifier + "?" + new Date().getTime();
                            angular.element($("#courseReportApp")).scope().$apply();
                        },
                        function(){}
                    );
                }


            },
            templateUrl: function(elem,attrs) {
                return "chartTemplate";
            }
        }
    });
</script>


<script type="text/ng-template" id="chartTemplate">
    <div class="imageComponent component">

        <div class="componentBody">
            <div class="form-group clearfix">
                <label class="col-md-2 control-label">Legenda</label>
                <div class="col-md-10">
                    <input type="text" class="form-control" rows="10" ng-model="comp.title">
                </div>
            </div>
            <div class="form-group clearfix">
                <div class="col-md-2 control-label">
                    <button class="btn btn-default" ng-click="generateChart(comp)">Refrescar/Gerar Grafico</button>
                </div>
                <div class="col-md-10">
                    <label ng-if="comp.image.identifier"> Limites do PDF </label>
                    <div ng-if="comp.image.identifier" style="text-align: center; width: 595px; border: 1px solid black; padding: 45px">
                        <center>
                            <div style="width: 200px;height: 200px; max-width: 500px; max-height: 750px" resizable on-resize="resize($evt, $ui, comp)">
                                <img ng-if="comp.imageUrl" style="width: 100%;height: 100%"  ng-src="{{comp.imageUrl}}">
                                <img ng-if="!comp.imageUrl" style="width: 100%;height: 100%"  ng-src="{{'<%=request.getContextPath()%>/repositoryStream/' + comp.image.identifier}}">
                            </div>
                            (Se desejar altere o tamanho da imagem arrastando no canto inferior direito)
                        </center>
                    </div>
                </div>
            </div>
        </div>
    </div>
</script>


<!-- Grafico 2 -->
<script type="text/ng-template" id="pt_estgp_estgweb_services_courses_coursereport_documentmodel_learningresults_components_GlobalLearningResultsChartYearImg">
    <globallearningresultschartyearimg>
    </globallearningresultschartyearimg>
</script>

<script>
    angular.module("courseReportApp").directive('globallearningresultschartyearimg', function() {

        return {
            restrict: 'E',
            link: function($scope, element, attrs)
            {
                $scope.generateChart = function(comp)
                {

                    widgetCallWithActionParameters(
                        "<%=request.getContextPath()%>/user/courseReport.do",
                        "generateGlobalLearningResultsChartYearImg",
                        {
                            "courseReportDocument" : BacoJS.stringifyOrdered(angular.element($("#courseReportApp")).scope().report)
                        },
                        "#courseReportApp",
                        function(repositoryFile4JsonView)
                        {
                            comp.image = repositoryFile4JsonView;
                            comp.imageUrl = "<%=request.getContextPath()%>/repositoryStream/" + comp.image.identifier + "?" + new Date().getTime();
                            angular.element($("#courseReportApp")).scope().$apply();
                        },
                        function(){}
                    );
                }


            },
            templateUrl: function(elem,attrs) {
                return "chartTemplate";
            }
        }
    });
</script>


<!-- Grafico 3 -->
<script type="text/ng-template" id="pt_estgp_estgweb_services_courses_coursereport_documentmodel_learningresults_components_LearningResultsChartSem">
    <learningresultschartsem>
    </learningresultschartsem>
</script>

<script>
    angular.module("courseReportApp").directive('learningresultschartsem', function() {

        return {
            restrict: 'E',
            link: function($scope, element, attrs)
            {
                $scope.generateChart = function(comp)
                {

                    widgetCallWithActionParameters(
                        "<%=request.getContextPath()%>/user/courseReport.do",
                        "generateLearningResultsChartSem",
                        {
                            "courseReportDocument" : BacoJS.stringifyOrdered(angular.element($("#courseReportApp")).scope().report)
                        },
                        "#courseReportApp",
                        function(repositoryFile4JsonView)
                        {
                            comp.image = repositoryFile4JsonView;
                            comp.imageUrl = "<%=request.getContextPath()%>/repositoryStream/" + comp.image.identifier + "?" + new Date().getTime();
                            angular.element($("#courseReportApp")).scope().$apply();
                        },
                        function(){}
                    );
                }

            },
            templateUrl: function(elem,attrs) {
                return "chartTemplate";
            }
        }
    });
</script>