Subversion Repositories bacoAlunos

Compare Revisions

Ignore whitespace Rev 1570 → Rev 1571

/branches/v3/impl/src/java/pt/estgp/estgweb/utils/Dom4jUtil.java
172,7 → 172,20
new StreamResult(new OutputStreamWriter(System.out, "UTF-8")));
}
 
public static void write(org.w3c.dom.Document doc,File f) throws IOException, TransformerException {
TransformerFactory tf = TransformerFactory.newInstance();
Transformer transformer = tf.newTransformer();
transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "no");
transformer.setOutputProperty(OutputKeys.METHOD, "xml");
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");
 
transformer.transform(new DOMSource(doc),
new StreamResult(new FileOutputStream(f)));
}
 
 
public static void writeSout(Document document) throws IOException
{
// Compact format to System.out
/branches/v3/impl/src/java/pt/estgp/estgweb/services/questionarios/utils/DataTable.java
133,6 → 133,7
cols.add(col);
return col;
}
 
public Col addColTextCenter(String value)
{ Col col = new Col(value);
col.setTypeText();
141,6 → 142,13
return col;
}
 
public Col addColInvisible()
{ Col col = new Col();
col.setTypeInvisible();
cols.add(col);
return col;
}
 
public Col addColPercentageLeft(String value)
{ Col col = new Col(value);
col.setTypePercentage();
331,6 → 339,7
public void setAlignCenter() { align = "center"; }
public void setTypeNumber() { type = "number"; }
public void setTypeText() { type = "text"; }
public void setTypeInvisible() { type = "invisible"; }
public void setTypePercentage() { type = "percentage"; }
public void setTypePercentageDefined() { type = "percentageDefined"; }
public void setTypePercentageDefinedProgress() { type = "percentageDefinedProgress"; }
/branches/v3/impl/src/java/pt/estgp/estgweb/services/questionarios/utils/ChartBuilderUtil.java
54,10 → 54,13
public static Color RED_NOT_OK = new Color(255,200, 164);
public static Color NEUTRAL_TOTAL = new Color(83,83,84);
 
 
public static Color COLOR_SECTION_BLUE = new Color(178,230,254);
public static Color COLOR_SECTION_BLUE_DARK = new Color(82, 162,254);
public static Color COLOR_SECTION_BLUE = new Color(178,230,254);
public static Color COLOR_SECTION_GREEN = new Color(221,253,177);
public static Color COLOR_SECTION_GREEN_DARK = new Color(130,253, 89);
public static Color COLOR_SECTION_ROSE = new Color(255, 157, 169);
public static Color COLOR_SECTION_ROSE_DARK = new Color(223, 116, 128);
 
public static Color COLOR_SECTION_DIM = new Color(255, 200, 237);
public static Color COLOR_SECTION_DIM_DARK = new Color(255, 86, 241);
744,7 → 747,7
new double[]{4.2,3.8},
new double[]{4.5,5.0},
};
createBarChartBarsCategories(series,categories,colors,colorsLabels,values,0,5,"testeBarras",300);
createBarChartBarsCategories(series,categories,colors,colorsLabels,values,0,5,"testeBarras",300,40);
}
 
/**
760,7 → 763,7
* @return devolve caminho final do grafico gerado
* @throws IOException
*/
public static String createBarChartBarsCategories(String[]series, String[] categories,final Color[] seriesColors,final Color[] seriesLabelColors,double[][] values, double min, double max, String pathTemplate,int width) throws IOException
public static String createBarChartBarsCategories(String[]series, String[] categories,final Color[] seriesColors,final Color[] seriesLabelColors,double[][] values, double min, double max, String pathTemplate,int width,int heightPerCategory) throws IOException
{
 
//Exemplo Series são as unidades
839,7 → 842,7
((BarRenderer)barChartPlot.getRenderer()).setItemLabelPaint(null);
 
 
BufferedImage image = chart.createBufferedImage( width*8, categories.length * 320);
BufferedImage image = chart.createBufferedImage( width*8, categories.length * heightPerCategory * 8);
String pathGraficoRespostas = Globals.TMP_DIR + File.separator + pathTemplate + "categoriesBars.png";
ImageIO.write(image, "png", new FileOutputStream(pathGraficoRespostas));
return pathGraficoRespostas;
/branches/v3/impl/src/java/pt/estgp/estgweb/services/questionarios/utils/UnidadeStats.java
228,7 → 228,7
public int unidadesNoCurso;
public int unidadesNaEscola;
 
//criadas no metodo DocenteReportGenerator call UnidadesQueryDao.criarTabelasCadeiras
//criadas no metodo DocenteReportGenerator call UnidadesQueryDao.criarTabelasCadeirasDocente
// >>>UnidadeQueryDao.criarTabelasRespostasCadeira
private ArrayList<PerguntaStats> perguntasStats = new ArrayList<PerguntaStats>();
 
/branches/v3/impl/src/java/pt/estgp/estgweb/services/questionarios/utils/CursoStats.java
1,5 → 1,7
package pt.estgp.estgweb.services.questionarios.utils;
 
import pt.estgp.estgweb.services.questionarios.pedagogico.queries.PerguntasGrupoQueryDao;
 
import java.io.Serializable;
import java.util.ArrayList;
 
23,14 → 25,54
int questionarios;
int respostas;
 
RespostasAgregadasGrupoStats.RespostasAgregadasChartTable respostasAgregadasGrupoUnidade;
RespostasAgregadasGrupoStats.RespostasAgregadasChartTable respostasAgregadasGrupoDocente;
RespostasAgregadasGrupoStats.RespostasAgregadasChartTable respostasAgregadasGrupoSalas;
RespostasAgregadasGrupoStats.RespostasAgregadasChartTable respostasAgregadasGrupoEstagio;
RespostasAgregadasGrupoStats.RespostasAgregadasChartTable respostasAgregadasGrupoPraticaEnsinoClinico;
int docentesDoCurso;
int docentesDaEscola;
int unidadesDoCurso;
int unidadesDaEscola;
 
RespostasAgregadasGrupoStats respostasAgregadasGrupoUnidade = new RespostasAgregadasGrupoStats(PerguntasGrupoQueryDao.GRUPO_UNIDADE_CODE_PERGUNTAS,null);
RespostasAgregadasGrupoStats respostasAgregadasGrupoDocente = new RespostasAgregadasGrupoStats(PerguntasGrupoQueryDao.GRUPO_DOCENTE_CODE_PERGUNTAS,null);
RespostasAgregadasGrupoStats respostasAgregadasGrupoSalas = new RespostasAgregadasGrupoStats(PerguntasGrupoQueryDao.GRUPO_SALAS_CODE_PERGUNTAS,null);
RespostasAgregadasGrupoStats respostasAgregadasGrupoEstagio = new RespostasAgregadasGrupoStats(PerguntasGrupoQueryDao.GRUPO_ESTAGIO_CODE_PERGUNTAS,null);
RespostasAgregadasGrupoStats respostasAgregadasGrupoPraticaEnsinoClinico = new RespostasAgregadasGrupoStats(PerguntasGrupoQueryDao.GRUPO_ENSINO_CLINICO_CODE_PERGUNTAS,null);
 
public ArrayList<UnidadeStats> unidadesStats = new ArrayList<UnidadeStats>();
 
 
public int getUnidadesDoCurso() {
return unidadesDoCurso;
}
 
public void setUnidadesDoCurso(int unidadesDoCurso) {
this.unidadesDoCurso = unidadesDoCurso;
}
 
public int getUnidadesDaEscola() {
return unidadesDaEscola;
}
 
public void setUnidadesDaEscola(int unidadesDaEscola) {
this.unidadesDaEscola = unidadesDaEscola;
}
 
public int getDocentesDoCurso() {
return docentesDoCurso;
}
 
public void setDocentesDoCurso(int docentesDoCurso) {
this.docentesDoCurso = docentesDoCurso;
}
 
public int getDocentesDaEscola() {
return docentesDaEscola;
}
 
public void setDocentesDaEscola(int docentesDaEscola) {
this.docentesDaEscola = docentesDaEscola;
}
 
 
 
public String getAbreviaturaInstituicao() {
return abreviaturaInstituicao;
}
112,43 → 154,43
this.respostas = respostas;
}
 
public RespostasAgregadasGrupoStats.RespostasAgregadasChartTable getRespostasAgregadasGrupoUnidade() {
public RespostasAgregadasGrupoStats getRespostasAgregadasGrupoUnidade() {
return respostasAgregadasGrupoUnidade;
}
 
public void setRespostasAgregadasGrupoUnidade(RespostasAgregadasGrupoStats.RespostasAgregadasChartTable respostasAgregadasGrupoUnidade) {
public void setRespostasAgregadasGrupoUnidade(RespostasAgregadasGrupoStats respostasAgregadasGrupoUnidade) {
this.respostasAgregadasGrupoUnidade = respostasAgregadasGrupoUnidade;
}
 
public RespostasAgregadasGrupoStats.RespostasAgregadasChartTable getRespostasAgregadasGrupoDocente() {
public RespostasAgregadasGrupoStats getRespostasAgregadasGrupoDocente() {
return respostasAgregadasGrupoDocente;
}
 
public void setRespostasAgregadasGrupoDocente(RespostasAgregadasGrupoStats.RespostasAgregadasChartTable respostasAgregadasGrupoDocente) {
public void setRespostasAgregadasGrupoDocente(RespostasAgregadasGrupoStats respostasAgregadasGrupoDocente) {
this.respostasAgregadasGrupoDocente = respostasAgregadasGrupoDocente;
}
 
public RespostasAgregadasGrupoStats.RespostasAgregadasChartTable getRespostasAgregadasGrupoSalas() {
public RespostasAgregadasGrupoStats getRespostasAgregadasGrupoSalas() {
return respostasAgregadasGrupoSalas;
}
 
public void setRespostasAgregadasGrupoSalas(RespostasAgregadasGrupoStats.RespostasAgregadasChartTable respostasAgregadasGrupoSalas) {
public void setRespostasAgregadasGrupoSalas(RespostasAgregadasGrupoStats respostasAgregadasGrupoSalas) {
this.respostasAgregadasGrupoSalas = respostasAgregadasGrupoSalas;
}
 
public RespostasAgregadasGrupoStats.RespostasAgregadasChartTable getRespostasAgregadasGrupoEstagio() {
public RespostasAgregadasGrupoStats getRespostasAgregadasGrupoEstagio() {
return respostasAgregadasGrupoEstagio;
}
 
public void setRespostasAgregadasGrupoEstagio(RespostasAgregadasGrupoStats.RespostasAgregadasChartTable respostasAgregadasGrupoEstagio) {
public void setRespostasAgregadasGrupoEstagio(RespostasAgregadasGrupoStats respostasAgregadasGrupoEstagio) {
this.respostasAgregadasGrupoEstagio = respostasAgregadasGrupoEstagio;
}
 
public RespostasAgregadasGrupoStats.RespostasAgregadasChartTable getRespostasAgregadasGrupoPraticaEnsinoClinico() {
public RespostasAgregadasGrupoStats getRespostasAgregadasGrupoPraticaEnsinoClinico() {
return respostasAgregadasGrupoPraticaEnsinoClinico;
}
 
public void setRespostasAgregadasGrupoPraticaEnsinoClinico(RespostasAgregadasGrupoStats.RespostasAgregadasChartTable respostasAgregadasGrupoPraticaEnsinoClinico) {
public void setRespostasAgregadasGrupoPraticaEnsinoClinico(RespostasAgregadasGrupoStats respostasAgregadasGrupoPraticaEnsinoClinico) {
this.respostasAgregadasGrupoPraticaEnsinoClinico = respostasAgregadasGrupoPraticaEnsinoClinico;
}
 
/branches/v3/impl/src/java/pt/estgp/estgweb/services/questionarios/pedagogico/report.fo.xsl
New file
0,0 → 1,209
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org/1999/XSL/Format http://svn.apache.org/repos/asf/xmlgraphics/fop/trunk/fop/src/foschema/fop.xsd">
<xsl:import href="utilsReports.fo.xsl"/>
 
 
<xsl:param name="site">http://localhost/bacoTESTE</xsl:param>
<xsl:param name="updateDate">EM FALTA</xsl:param>
 
 
<!--Neste caso o portador do unidadesStats -->
<xsl:template match="unidadesStats" mode="unidadePorUnidade">
<xsl:param name="CAP_PONTO"/>
<xsl:param name="CAP_ID"/>
<xsl:variable name="sizeCursos" select="count(./unidadeStats[not(nomeCurso/text() = preceding-sibling::unidadeStats/nomeCurso/text())])"/>
<xsl:for-each select="./unidadeStats[not(nomeCurso/text() = preceding-sibling::unidadeStats/nomeCurso/text())]">
<xsl:sort select="text()" data-type="text" />
<xsl:variable name="nomeCurso" select="nomeCurso/text()"/>
<xsl:variable name="cursoPos" select="position()"/>
<xsl:for-each select="../unidadeStats[nomeCurso/text() = $nomeCurso]">
<xsl:sort select="nomeUnidade/text()" data-type="text" />
 
<fo:block-container padding="0" margin="0" page-break-before="always">
<xsl:if test="$cursoPos = 1 and position()=1"><xsl:attribute name="id"><xsl:value-of select="$CAP_ID"/></xsl:attribute></xsl:if>
<xsl:call-template name="seccaoGreen">
<xsl:with-param name="text"><xsl:value-of select="$CAP_PONTO"/> - Análise das questões individualmente em cada unidade</xsl:with-param>
<xsl:with-param name="marginTop">0</xsl:with-param>
<xsl:with-param name="icon">class.png</xsl:with-param>
</xsl:call-template>
</fo:block-container>
 
 
<xsl:call-template name="subSeccao">
<xsl:with-param name="text"><xsl:value-of select="$CAP_PONTO"/>.<xsl:value-of select="$cursoPos"/> - <xsl:value-of select="nomeCurso/text()"/> (<xsl:value-of select="./codigoCurso[1]/text()"/>) </xsl:with-param>
<xsl:with-param name="marginTop">2px</xsl:with-param>
<xsl:with-param name="marginBottom">2px</xsl:with-param>
</xsl:call-template>
 
 
<fo:block-container padding="0" margin="0" id="UNIDADE_CURICULAR{codigoUnidade}">
<xsl:call-template name="subSubSeccao">
<xsl:with-param name="text"><xsl:value-of select="$CAP_PONTO"/>.<xsl:value-of select="$cursoPos"/>.<xsl:value-of select="position()"/> - <xsl:value-of select="nomeUnidade/text()"/> (<xsl:value-of select="codigoUnidade/text()"/>) </xsl:with-param>
<xsl:with-param name="marginTop">2px</xsl:with-param>
<xsl:with-param name="fontSize">12pt</xsl:with-param>
<xsl:with-param name="fontWeight">bold</xsl:with-param>
</xsl:call-template>
</fo:block-container>
 
 
 
<xsl:if test="unidadeStatsGrupoDocente/respostasTable">
<xsl:call-template name="subSubSubSeccaoBlue">
<xsl:with-param name="text">Respostas ao grupo de questões sobre o Docente</xsl:with-param>
<xsl:with-param name="marginTop">2px</xsl:with-param>
<xsl:with-param name="icon">teacherIcon.png</xsl:with-param>
</xsl:call-template>
 
<fo:block-container padding="0" margin-left="15px" margin="0" margin-bottom="5px">
<fo:block text-align="center" margin="0" font-size="10" font-weight="normal" >
<xsl:apply-templates select="unidadeStatsGrupoDocente/respostasTable" mode="DataTable">
<xsl:with-param name="firstColPercentSize">30%</xsl:with-param>
<xsl:with-param name="backgroundHeader" select="$BLUE_COLOR_SUB_SECTION"/>
</xsl:apply-templates>
</fo:block>
<fo:block text-align="right" margin-top="10px" margin-left="10px" font-size="6.5pt" font-weight="normal" margin-right="10px">
Unidades consideradas no curso de <xsl:value-of select="nomeCurso"/>: <xsl:value-of select="unidadeStatsGrupoDocente/unidadesNoCurso"/>
</fo:block>
<fo:block text-align="right" margin-left="10px" font-size="6.5pt" font-weight="normal" margin-right="10px">
Unidades consideradas na media da <xsl:value-of select="nomeEscola"/>: <xsl:value-of select="unidadeStatsGrupoDocente/unidadesNaEscola"/>
</fo:block>
 
<fo:block padding="0" margin="0" margin-top="5px">
<xsl:apply-templates select="unidadeStatsGrupoDocente/mediasGrupo" mode="mediasGrupo">
<xsl:with-param name="objetoAvaliacao">do docente</xsl:with-param>
<xsl:with-param name="backgroundHeader" select="$BLUE_COLOR_SUB_SECTION"/>
<xsl:with-param name="smileHeight">15</xsl:with-param>
<xsl:with-param name="fontSize">6pt</xsl:with-param>
<xsl:with-param name="fontSizeMedias">7pt</xsl:with-param>
</xsl:apply-templates>
</fo:block>
</fo:block-container>
</xsl:if>
 
 
 
 
<xsl:if test="unidadeStatsGrupoUnidade/respostasTable">
<xsl:call-template name="subSubSubSeccaoGreen">
<xsl:with-param name="text">Respostas ao grupo de questões sobre a Unidade</xsl:with-param>
<xsl:with-param name="marginTop">20px</xsl:with-param>
<xsl:with-param name="icon">cadeiraConteudos.png</xsl:with-param>
</xsl:call-template>
 
<fo:block-container padding="0" margin-left="15px" margin="0" margin-bottom="5px">
<fo:block text-align="center" margin="0" font-size="10" font-weight="normal" >
<xsl:apply-templates select="unidadeStatsGrupoUnidade/respostasTable" mode="DataTable">
<xsl:with-param name="firstColPercentSize">30%</xsl:with-param>
<xsl:with-param name="backgroundHeader" select="$GREEN_COLOR_SUB_SECTION"/>
</xsl:apply-templates>
</fo:block>
 
<fo:block text-align="right" margin-top="10px" margin-left="10px" font-size="6.5pt" font-weight="normal" margin-right="10px">
Unidades consideradas no curso de <xsl:value-of select="nomeCurso"/>: <xsl:value-of select="unidadeStatsGrupoUnidade/unidadesNoCurso"/>
</fo:block>
<fo:block text-align="right" margin-left="10px" font-size="6.5pt" font-weight="normal" margin-right="10px">
Unidades consideradas na <xsl:value-of select="nomeEscola"/>: <xsl:value-of select="unidadeStatsGrupoUnidade/unidadesNaEscola"/>
</fo:block>
 
<fo:block padding="0" margin="0" margin-top="5px">
<xsl:apply-templates select="unidadeStatsGrupoUnidade/mediasGrupo" mode="mediasGrupo">
<xsl:with-param name="objetoAvaliacao">do docente</xsl:with-param>
<xsl:with-param name="backgroundHeader" select="$GREEN_COLOR_SUB_SECTION"/>
<xsl:with-param name="smileHeight">15</xsl:with-param>
<xsl:with-param name="fontSize">6pt</xsl:with-param>
<xsl:with-param name="fontSizeMedias">7pt</xsl:with-param>
</xsl:apply-templates>
</fo:block>
</fo:block-container>
</xsl:if>
 
<xsl:if test="unidadeStatsGrupoSalas/respostasTable">
<xsl:call-template name="subSubSubSeccaoRose">
<xsl:with-param name="text">Respostas ao grupo de questões sobre Instalações/Equipamentos/Outros Recursos</xsl:with-param>
<xsl:with-param name="marginTop">20px</xsl:with-param>
<xsl:with-param name="icon">cadeiraCadeira.png</xsl:with-param>
</xsl:call-template>
 
<fo:block-container padding="0" margin-left="15px" margin="0" margin-bottom="5px">
<fo:block text-align="center" margin="0" font-size="10" font-weight="normal" >
<xsl:apply-templates select="unidadeStatsGrupoSalas/respostasTable" mode="DataTable">
<xsl:with-param name="firstColPercentSize">30%</xsl:with-param>
<xsl:with-param name="backgroundHeader" select="$ROSE_COLOR_SUB_SECTION"/>
</xsl:apply-templates>
</fo:block>
 
<fo:block text-align="right" margin-top="10px" margin-left="10px" font-size="6.5pt" font-weight="normal" margin-right="10px">
Unidades consideradas no curso de <xsl:value-of select="nomeCurso"/>: <xsl:value-of select="unidadeStatsGrupoSalas/unidadesNoCurso"/>
</fo:block>
<fo:block text-align="right" margin-left="10px" font-size="6.5pt" font-weight="normal" margin-right="10px">
Unidades consideradas na <xsl:value-of select="nomeEscola"/>: <xsl:value-of select="unidadeStatsGrupoSalas/unidadesNaEscola"/>
</fo:block>
 
<fo:block padding="0" margin="0" margin-top="5px">
<xsl:apply-templates select="unidadeStatsGrupoSalas/mediasGrupo" mode="mediasGrupo">
<xsl:with-param name="objetoAvaliacao">do docente</xsl:with-param>
<xsl:with-param name="backgroundHeader" select="$ROSE_COLOR_SUB_SECTION"/>
<xsl:with-param name="smileHeight">15</xsl:with-param>
<xsl:with-param name="fontSize">6pt</xsl:with-param>
<xsl:with-param name="fontSizeMedias">7pt</xsl:with-param>
</xsl:apply-templates>
</fo:block>
</fo:block-container>
</xsl:if>
 
</xsl:for-each>
 
</xsl:for-each>
 
 
<!--
<fo:block-container padding="0" margin="0" page-break-before="always">
<xsl:call-template name="seccaoGreen">
<xsl:with-param name="text"><xsl:value-of select="$CAP_PONTO"/> - Análise das questões em cada unidade do docente</xsl:with-param>
<xsl:with-param name="marginTop">0</xsl:with-param>
<xsl:with-param name="icon">class.png</xsl:with-param>
</xsl:call-template>
</fo:block-container>
 
 
<xsl:call-template name="subSeccao">
<xsl:with-param name="text"><xsl:value-of select="$CAP_PONTO"/>.<xsl:value-of select="$sizeCursos+1"/>
- Análise conjunta de todas as unidades curriculares</xsl:with-param>
<xsl:with-param name="marginTop">2px</xsl:with-param>
<xsl:with-param name="marginBottom">5px</xsl:with-param>
</xsl:call-template>
//Grafico de barras laterais duplas com todas as unidades (grupos Docente + Unidade)
//Tabela com todas as Medias de Grupo de todas as unidades
 
<xsl:call-template name="subSubSeccao">
<xsl:with-param name="text"><xsl:value-of select="$CAP_PONTO"/>.<xsl:value-of select="$sizeCursos+1"/>.1
- Análise do grupo de questões relativas ao docente versus questões relativas às unidades para todas as unidades do docente</xsl:with-param>
<xsl:with-param name="marginTop">2px</xsl:with-param>
<xsl:with-param name="marginBottom">2px</xsl:with-param>
</xsl:call-template>
 
<fo:block margin="0" padding="0" text-align="center">
<xsl:variable name="src"><xsl:value-of select="//unidadesAnalGrDocenteGrUnidadeChartAndTable/tempFile"/></xsl:variable>
<fo:external-graphic width="auto" height="auto" content-width="400" src="{$src}"/>
</fo:block>
 
<xsl:call-template name="subSubSeccao">
<xsl:with-param name="text">5.<xsl:value-of select="$sizeCursos+1"/>.2
- Tabela com médias de curso e de escola na agregação das questões</xsl:with-param>
<xsl:with-param name="marginTop">10px</xsl:with-param>
<xsl:with-param name="marginBottom">5px</xsl:with-param>
</xsl:call-template>
<xsl:apply-templates select="//unidadesAnalGrDocenteGrUnidadeChartAndTable/dataTable" mode="DataTable">
 
</xsl:apply-templates>
-->
 
 
</xsl:template>
 
 
</xsl:stylesheet>
Property changes:
Added: svn:executable
+ *
/branches/v3/impl/src/java/pt/estgp/estgweb/services/questionarios/pedagogico/docenteReport.fo.xsl
765,7 → 765,7
<xsl:sort select="text()" data-type="text" />
<xsl:variable name="nomeCurso" select="nomeCurso/text()"/>
<xsl:variable name="cursoPos" select="position()"/>
<xsl:for-each select="//unidadesStats/unidadeStats[nomeCurso/text() = $nomeCurso]">
<xsl:for-each select="../unidadeStats[nomeCurso/text() = $nomeCurso]">
<xsl:sort select="nomeUnidade/text()" data-type="text" />
 
<fo:block-container padding="0" margin="0" page-break-before="always">
/branches/v3/impl/src/java/pt/estgp/estgweb/services/questionarios/pedagogico/utilsReports.fo.xsl
11,11 → 11,14
<xsl:variable name="STD_COLOR_SECTION">#FFEAAE</xsl:variable>
<xsl:variable name="GREEN_COLOR_SECTION">#DDFCB1</xsl:variable>
<xsl:variable name="BLUE_COLOR_SECTION">#B2E6FE</xsl:variable>
<xsl:variable name="DIMENSION_COLOR_SECTION">#FFAFF0</xsl:variable>
<xsl:variable name="DIMENSION_COLOR_SECTION">#E29BD4</xsl:variable>
<xsl:variable name="ROSE_COLOR_SECTION">#DF7480</xsl:variable>
 
<xsl:variable name="STD_COLOR_SUB_SECTION">#D6D9BC</xsl:variable>
<xsl:variable name="GREEN_COLOR_SUB_SECTION">#D0FCCD</xsl:variable>
<xsl:variable name="BLUE_COLOR_SUB_SECTION">#CFF6FE</xsl:variable>
<xsl:variable name="DIMENSION_COLOR_SUB_SECTION">#FFAFF0</xsl:variable>
<xsl:variable name="ROSE_COLOR_SUB_SECTION">#FF9DA9</xsl:variable>
 
<xsl:template name="indexEntry">
<xsl:param name="id"></xsl:param>
25,13 → 28,16
<xsl:param name="colorNumber">white</xsl:param>
<xsl:param name="borderNumber">1px solid #58585A</xsl:param>
<xsl:param name="leaderPattern">dots</xsl:param>
<fo:block font-size="14px" text-align-last="justify">
<fo:block font-size="12px" text-align-last="justify" margin-top="5px">
<fo:basic-link internal-destination="{$id}">
<fo:inline font-weight="bold" padding-top="3px"
padding-bottom="2px" padding-left="3px"
padding-right="3px" margin-right="10px"
<fo:inline font-weight="bold"
padding-top="3px"
padding-bottom="2px"
padding-left="3px"
padding-right="3px"
margin-right="10px"
border-bottom="{$borderNumber}"
font-size="16px" color="{$colorNumber}"
color="{$colorNumber}"
background-color="{$backgroundColorNumber}"><xsl:value-of select="$sectionNumber"/></fo:inline>
<xsl:text> </xsl:text>
<xsl:value-of select="$sectionTitle"/>
40,6 → 46,35
</fo:basic-link>
</fo:block>
</xsl:template>
<xsl:template name="subIndexEntry">
<xsl:param name="id"></xsl:param>
<xsl:param name="sectionNumber"></xsl:param>
<xsl:param name="sectionTitle"></xsl:param>
<xsl:param name="backgroundColorNumber">white</xsl:param>
<xsl:param name="colorNumber">black</xsl:param>
<xsl:param name="borderNumber">0</xsl:param>
<xsl:param name="leaderPattern">dots</xsl:param>
<fo:block font-size="10px" text-align-last="justify" margin-top="5px" margin-left="20px" padding-left="20px">
<fo:basic-link internal-destination="{$id}">
<fo:inline font-weight="bold"
padding-top="3px"
padding-bottom="2px"
padding-left="3px"
padding-right="3px"
margin-right="10px"
border-bottom="{$borderNumber}"
color="{$colorNumber}"
background-color="{$backgroundColorNumber}">
<xsl:value-of select="$sectionNumber"/>
</fo:inline>
<xsl:text> </xsl:text>
<xsl:value-of select="$sectionTitle"/>
<fo:leader leader-pattern="{$leaderPattern}" />
<fo:page-number-citation ref-id="{$id}" />
</fo:basic-link>
</fo:block>
</xsl:template>
 
<xsl:template name="headerIpp">
<fo:static-content flow-name="header">
<fo:block text-align="left">
194,6 → 229,17
<xsl:with-param name="backcolor"><xsl:value-of select="$DIMENSION_COLOR_SECTION"/></xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template name="seccaoRose">
<xsl:param name="text"/>
<xsl:param name="marginTop">0</xsl:param>
<xsl:param name="icon"></xsl:param>
<xsl:call-template name="seccaoGen">
<xsl:with-param name="text" select="$text"/>
<xsl:with-param name="marginTop" select="$marginTop"/>
<xsl:with-param name="icon" select="$icon"/>
<xsl:with-param name="backcolor"><xsl:value-of select="$ROSE_COLOR_SECTION"/></xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template name="seccaoGen">
<xsl:param name="text"/>
<xsl:param name="marginTop">0</xsl:param>
305,6 → 351,23
<xsl:with-param name="textAlign" select="$textAlign"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="subSeccaoRose">
<xsl:param name="text"/>
<xsl:param name="marginTop">8px</xsl:param>
<xsl:param name="marginBottom">20px</xsl:param>
<xsl:param name="marginLeft">10px</xsl:param>
<xsl:param name="textAlign">left</xsl:param>
<xsl:param name="icon"></xsl:param>
<xsl:call-template name="subSeccaoGen">
<xsl:with-param name="text" select="$text"/>
<xsl:with-param name="marginTop" select="$marginTop"/>
<xsl:with-param name="backcolor"><xsl:value-of select="$ROSE_COLOR_SUB_SECTION"/></xsl:with-param>
<xsl:with-param name="marginBottom" select="$marginBottom"/>
<xsl:with-param name="marginLeft" select="$marginLeft"/>
<xsl:with-param name="icon" select="$icon"/>
<xsl:with-param name="textAlign" select="$textAlign"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="subSeccaoGen">
<xsl:param name="text"/>
<xsl:param name="marginTop">8px</xsl:param>
386,7 → 449,7
<xsl:call-template name="subSubSeccaoGen">
<xsl:with-param name="text" select="$text"/>
<xsl:with-param name="marginTop" select="$marginTop"/>
<xsl:with-param name="backcolor">#CFF6FE</xsl:with-param>
<xsl:with-param name="backcolor"><xsl:value-of select="$BLUE_COLOR_SUB_SECTION"/></xsl:with-param>
<xsl:with-param name="fontSize" select="$fontSize"/>
<xsl:with-param name="fontWeight" select="$fontWeight"/>
<xsl:with-param name="marginLeft" select="$marginLeft"/>
405,7 → 468,7
<xsl:call-template name="subSubSeccaoGen">
<xsl:with-param name="text" select="$text"/>
<xsl:with-param name="marginTop" select="$marginTop"/>
<xsl:with-param name="backcolor">#D0FCCD</xsl:with-param>
<xsl:with-param name="backcolor"><xsl:value-of select="$GREEN_COLOR_SUB_SECTION"/></xsl:with-param>
<xsl:with-param name="fontSize" select="$fontSize"/>
<xsl:with-param name="fontWeight" select="$fontWeight"/>
<xsl:with-param name="marginLeft" select="$marginLeft"/>
413,6 → 476,25
<xsl:with-param name="icon" select="$icon"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="subSubSeccaoRose">
<xsl:param name="text"/>
<xsl:param name="marginTop">2px</xsl:param>
<xsl:param name="fontSize">8pt</xsl:param>
<xsl:param name="fontWeight">normal</xsl:param>
<xsl:param name="marginLeft">20px</xsl:param>
<xsl:param name="marginBottom">5px</xsl:param>
<xsl:param name="icon"></xsl:param>
<xsl:call-template name="subSubSeccaoGen">
<xsl:with-param name="text" select="$text"/>
<xsl:with-param name="marginTop" select="$marginTop"/>
<xsl:with-param name="backcolor"><xsl:value-of select="$ROSE_COLOR_SUB_SECTION"/></xsl:with-param>
<xsl:with-param name="fontSize" select="$fontSize"/>
<xsl:with-param name="fontWeight" select="$fontWeight"/>
<xsl:with-param name="marginLeft" select="$marginLeft"/>
<xsl:with-param name="marginBottom" select="$marginBottom"/>
<xsl:with-param name="icon" select="$icon"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="subSubSeccaoGen">
<xsl:param name="text"/>
<xsl:param name="marginTop">2px</xsl:param>
517,6 → 599,23
<xsl:with-param name="paddingRightIcon" select="$paddingRightIcon"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="subSubSubSeccaoRose">
<xsl:param name="text"/>
<xsl:param name="marginTop">2px</xsl:param>
<xsl:param name="icon"></xsl:param>
<xsl:param name="marginLeft">20px</xsl:param>
<xsl:param name="paddingRightBlock">30px</xsl:param>
<xsl:param name="paddingRightIcon">5px</xsl:param>
<xsl:call-template name="subSubSubSeccaoGen">
<xsl:with-param name="text" select="$text"/>
<xsl:with-param name="marginTop" select="$marginTop"/>
<xsl:with-param name="backcolor"><xsl:value-of select="$ROSE_COLOR_SUB_SECTION"/></xsl:with-param>
<xsl:with-param name="icon" select="$icon"/>
<xsl:with-param name="marginLeft" select="$marginLeft"/>
<xsl:with-param name="paddingRightBlock" select="$paddingRightBlock"/>
<xsl:with-param name="paddingRightIcon" select="$paddingRightIcon"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="subSubSubSeccaoGreenSmallSpaces">
<xsl:param name="text"/>
<xsl:param name="icon"></xsl:param>
1033,104 → 1132,105
<xsl:when test="./type='footer'"><xsl:attribute name="background-color"><xsl:value-of select="$backgroundFooter"/></xsl:attribute></xsl:when>
</xsl:choose>
<xsl:for-each select="./cols/col">
<fo:table-cell padding="0" display-align="center">
<xsl:if test="colspan &gt; 0"><xsl:attribute name="number-columns-spanned"><xsl:value-of select="colspan"/></xsl:attribute></xsl:if>
<xsl:if test="fontWeight = 'bold'"><xsl:attribute name="font-weight">bold</xsl:attribute></xsl:if>
<xsl:choose>
 
<xsl:if test="./backgroundColor != ''">
<xsl:attribute name="background-color"><xsl:value-of select="./backgroundColor"/></xsl:attribute>
</xsl:if>
<xsl:choose>
<xsl:when test="../../type='header'"><xsl:attribute name="border"><xsl:value-of select="$borderInHeader"/></xsl:attribute></xsl:when>
<xsl:when test="../../type='normal'"><xsl:attribute name="border"><xsl:value-of select="$borderInCell"/></xsl:attribute></xsl:when>
<xsl:when test="../../type='footer'"><xsl:attribute name="border"><xsl:value-of select="$borderInFooter"/></xsl:attribute></xsl:when>
</xsl:choose>
<xsl:when test="./type='invisible'">
<fo:table-cell border="0" background-color="#FFFFFF">
<xsl:if test="number(colspan) &gt; 0"><xsl:attribute name="number-columns-spanned"><xsl:value-of select="colspan"/></xsl:attribute></xsl:if>
<fo:block> </fo:block>
</fo:table-cell>
</xsl:when>
<xsl:otherwise>
<fo:table-cell padding="0" display-align="center">
<xsl:if test="number(colspan) &gt; 0"><xsl:attribute name="number-columns-spanned"><xsl:value-of select="colspan"/></xsl:attribute></xsl:if>
<xsl:if test="fontWeight = 'bold'"><xsl:attribute name="font-weight">bold</xsl:attribute></xsl:if>
 
<xsl:choose>
<xsl:when test="./align='left'"><xsl:attribute name="text-align">start</xsl:attribute></xsl:when>
<xsl:when test="./align='right'"><xsl:attribute name="text-align">end</xsl:attribute></xsl:when>
<xsl:when test="./align='center'"><xsl:attribute name="text-align">center</xsl:attribute></xsl:when>
</xsl:choose>
<xsl:if test="../../cols/col/type = 'percentage' and ./type != 'percentage'">
<xsl:attribute name="padding-top">2px</xsl:attribute>
</xsl:if>
<xsl:if test="./backgroundColor != ''">
<xsl:attribute name="background-color"><xsl:value-of select="./backgroundColor"/></xsl:attribute>
</xsl:if>
<xsl:choose>
<xsl:when test="../../type='header'"><xsl:attribute name="border"><xsl:value-of select="$borderInHeader"/></xsl:attribute></xsl:when>
<xsl:when test="../../type='normal'"><xsl:attribute name="border"><xsl:value-of select="$borderInCell"/></xsl:attribute></xsl:when>
<xsl:when test="../../type='footer'"><xsl:attribute name="border"><xsl:value-of select="$borderInFooter"/></xsl:attribute></xsl:when>
</xsl:choose>
 
<xsl:if test="../../type='normal'">
<xsl:if test="./type='label' and position()=1">
<xsl:attribute name="border-right"><xsl:value-of select="$borderInHeader"/></xsl:attribute>
</xsl:if>
<xsl:if test="./type='label' and position()=last()">
<xsl:attribute name="border-left"><xsl:value-of select="$borderInHeader"/></xsl:attribute>
</xsl:if>
<xsl:if test="../../../row[invisible='false'][$rowPosition+1]/type='normal'">
<xsl:attribute name="border-bottom"><xsl:value-of select="$borderInCell"/></xsl:attribute>
</xsl:if>
</xsl:if>
<xsl:choose>
<xsl:when test="./align='left'"><xsl:attribute name="text-align">start</xsl:attribute></xsl:when>
<xsl:when test="./align='right'"><xsl:attribute name="text-align">end</xsl:attribute></xsl:when>
<xsl:when test="./align='center'"><xsl:attribute name="text-align">center</xsl:attribute></xsl:when>
</xsl:choose>
<xsl:if test="../../cols/col/type = 'percentage' and ./type != 'percentage'">
<xsl:attribute name="padding-top">2px</xsl:attribute>
</xsl:if>
 
<xsl:if test="../../../row[invisible='false'][$rowPosition - 1]/type='header'">
<xsl:attribute name="border-top"><xsl:value-of select="$borderInHeader"/></xsl:attribute>
</xsl:if>
<xsl:if test="../../../row[invisible='false'][$rowPosition +1]/type='footer'">
<xsl:attribute name="border-bottom"><xsl:value-of select="$borderInFooter"/></xsl:attribute>
</xsl:if>
<xsl:if test="../../type='normal'">
<xsl:if test="./type='label' and position()=1">
<xsl:attribute name="border-right"><xsl:value-of select="$borderInHeader"/></xsl:attribute>
</xsl:if>
<xsl:if test="./type='label' and position()=last()">
<xsl:attribute name="border-left"><xsl:value-of select="$borderInHeader"/></xsl:attribute>
</xsl:if>
<xsl:if test="../../../row[invisible='false'][$rowPosition+1]/type='normal'">
<xsl:attribute name="border-bottom"><xsl:value-of select="$borderInCell"/></xsl:attribute>
</xsl:if>
</xsl:if>
 
 
<xsl:if test="../col[position() + 1 != last()]">
<xsl:attribute name="border-right"><xsl:value-of select="$borderInCellVertical"/></xsl:attribute>
</xsl:if>
 
 
 
 
<fo:block-container margin="0" padding="0">
<xsl:choose>
<xsl:when test="./type='text'"><fo:block margin="0" padding-left="2px" padding-right="2px"><xsl:value-of select="./value"/></fo:block></xsl:when>
<xsl:when test="./type='number'"><fo:block margin="0" padding-left="2px" padding-right="2px"><xsl:value-of select="./value"/></fo:block></xsl:when>
<xsl:when test="./type='label'"><fo:block margin="0" padding-left="2px" padding-right="2px"><xsl:value-of select="./value"/></fo:block></xsl:when>
<xsl:when test="./type='percentage'">
<xsl:attribute name="text-align">left</xsl:attribute>
<xsl:attribute name="padding">0</xsl:attribute>
<xsl:call-template name="barraPercentil">
<xsl:with-param name="valor" select="./value"/>
<xsl:with-param name="colors" select="./usePercentageColor"/>
<xsl:with-param name="backgroundColorPercentage" select="./backgroundColorPercentage"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="./type='percentageDefined'">
<xsl:attribute name="text-align">left</xsl:attribute>
<xsl:attribute name="padding">0</xsl:attribute>
<xsl:call-template name="barraPercentilDefined">
<xsl:with-param name="valor" select="./value"/>
<xsl:with-param name="percentDefined" select="./percentDefined"/>
<xsl:with-param name="colors" select="./usePercentageColor"/>
<xsl:with-param name="backgroundColorPercentage" select="./backgroundColorPercentage"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="./type='percentageDefinedProgress'">
<xsl:attribute name="text-align">left</xsl:attribute>
<xsl:attribute name="padding">0</xsl:attribute>
<xsl:call-template name="barraPercentilDefinedProgress">
<xsl:with-param name="valor" select="./value"/>
<xsl:with-param name="percentDefined" select="./percentDefined"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="./type='percentageProgress'">
<xsl:attribute name="text-align">left</xsl:attribute>
<xsl:attribute name="padding">0</xsl:attribute>
<xsl:call-template name="barraPercentilProgress">
<xsl:with-param name="valor" select="./value"/>
</xsl:call-template>
</xsl:when>
 
</xsl:choose>
 
</fo:block-container>
 
 
</fo:table-cell>
</xsl:for-each>
<xsl:if test="../../../row[invisible='false'][$rowPosition - 1]/type='header'">
<xsl:attribute name="border-top"><xsl:value-of select="$borderInHeader"/></xsl:attribute>
</xsl:if>
<xsl:if test="../../../row[invisible='false'][$rowPosition +1]/type='footer'">
<xsl:attribute name="border-bottom"><xsl:value-of select="$borderInFooter"/></xsl:attribute>
</xsl:if>
<xsl:if test="../col[position() + 1 != last()]">
<xsl:attribute name="border-right"><xsl:value-of select="$borderInCellVertical"/></xsl:attribute>
</xsl:if>
<fo:block-container margin="0" padding="0">
<xsl:choose>
<xsl:when test="./type='text'"><fo:block margin="0" padding-left="2px" padding-right="2px"><xsl:value-of select="./value"/></fo:block></xsl:when>
<xsl:when test="./type='number'"><fo:block margin="0" padding-left="2px" padding-right="2px"><xsl:value-of select="./value"/></fo:block></xsl:when>
<xsl:when test="./type='label'"><fo:block margin="0" padding-left="2px" padding-right="2px"><xsl:value-of select="./value"/></fo:block></xsl:when>
<xsl:when test="./type='percentage'">
<xsl:attribute name="text-align">left</xsl:attribute>
<xsl:attribute name="padding">0</xsl:attribute>
<xsl:call-template name="barraPercentil">
<xsl:with-param name="valor" select="./value"/>
<xsl:with-param name="colors" select="./usePercentageColor"/>
<xsl:with-param name="backgroundColorPercentage" select="./backgroundColorPercentage"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="./type='percentageDefined'">
<xsl:attribute name="text-align">left</xsl:attribute>
<xsl:attribute name="padding">0</xsl:attribute>
<xsl:call-template name="barraPercentilDefined">
<xsl:with-param name="valor" select="./value"/>
<xsl:with-param name="percentDefined" select="./percentDefined"/>
<xsl:with-param name="colors" select="./usePercentageColor"/>
<xsl:with-param name="backgroundColorPercentage" select="./backgroundColorPercentage"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="./type='percentageDefinedProgress'">
<xsl:attribute name="text-align">left</xsl:attribute>
<xsl:attribute name="padding">0</xsl:attribute>
<xsl:call-template name="barraPercentilDefinedProgress">
<xsl:with-param name="valor" select="./value"/>
<xsl:with-param name="percentDefined" select="./percentDefined"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="./type='percentageProgress'">
<xsl:attribute name="text-align">left</xsl:attribute>
<xsl:attribute name="padding">0</xsl:attribute>
<xsl:call-template name="barraPercentilProgress">
<xsl:with-param name="valor" select="./value"/>
</xsl:call-template>
</xsl:when>
</xsl:choose>
</fo:block-container>
</fo:table-cell>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each> <!-- Col -->
</fo:table-row>
</xsl:for-each>
</xsl:for-each> <!--Row-->
</fo:table-body>
</fo:table>
</xsl:template>
/branches/v3/impl/src/java/pt/estgp/estgweb/services/questionarios/pedagogico/DocenteReport.java
89,64 → 89,8
 
 
 
//MEDIAS GLOBAIS
//Preenchidas no UnidadeQueryDao durante o preenchimento das unidadesCurriculares porque sao necessarias as
//medias dos grupos e das perguntas nas escolas e nos cursos das perguntas
//Obtem-se o valor no PerguntaGrupoQueryDao pode-se invocar os metodos por aqui com este proxy
private HashMap<String,PerguntasGrupoQueryDao.MediaGlobalCursoPergunta> mediasPerguntaNoCurso = new HashMap<String, PerguntasGrupoQueryDao.MediaGlobalCursoPergunta>();
private HashMap<String,PerguntasGrupoQueryDao.MediaGlobalEscolaPergunta> mediasPerguntaNaEscola = new HashMap<String, PerguntasGrupoQueryDao.MediaGlobalEscolaPergunta>();
private HashMap<String,PerguntasGrupoQueryDao.MediaGlobalCursoGrupo> mediasGrupoNoCurso = new HashMap<String, PerguntasGrupoQueryDao.MediaGlobalCursoGrupo>();
private HashMap<String,PerguntasGrupoQueryDao.MediaGlobalEscolaGrupo> mediasGrupoNaEscola = new HashMap<String, PerguntasGrupoQueryDao.MediaGlobalEscolaGrupo>();
 
public PerguntasGrupoQueryDao.MediaGlobalCursoPergunta mediaPerguntaNoCurso(String codigoCurso, String anoLectivo, String numeroPergunta,String[] periodos,String[]degrees)
{
return PerguntasGrupoQueryDao.getMediaCursoPergunta(this,codigoCurso,anoLectivo,numeroPergunta,periodos);
}
public PerguntasGrupoQueryDao.MediaGlobalCursoGrupo mediaGrupoNoCurso(String codigoCurso, String anoLectivo, String grupo,String subGrupo,String[] periodos,String[]degrees)
{
return PerguntasGrupoQueryDao.getMediaCursoGrupo(this, codigoCurso,anoLectivo,grupo,subGrupo,periodos);
}
public PerguntasGrupoQueryDao.MediaGlobalEscolaPergunta mediaPerguntaNaEscola(String codigoEscola, String anoLectivo, String numeroPergunta,String[] periodos,String[]degrees)
{
return PerguntasGrupoQueryDao.getMediaEscolaPergunta(this, codigoEscola, anoLectivo, numeroPergunta,periodos,degrees);
}
public PerguntasGrupoQueryDao.MediaGlobalEscolaGrupo mediaGrupoNaEscola(String codigoEscola, String anoLectivo, String grupo,String subGrupo,String[] periodos,String[]degrees)
{
return PerguntasGrupoQueryDao.getMediaEscolaGrupo(this, codigoEscola, anoLectivo, grupo,subGrupo, periodos,degrees);
}
 
public HashMap<String, PerguntasGrupoQueryDao.MediaGlobalCursoPergunta> getMediasPerguntaNoCurso() {
return mediasPerguntaNoCurso;
}
 
public void setMediasPerguntaNoCurso(HashMap<String, PerguntasGrupoQueryDao.MediaGlobalCursoPergunta> mediasPerguntaNoCurso) {
this.mediasPerguntaNoCurso = mediasPerguntaNoCurso;
}
 
public HashMap<String, PerguntasGrupoQueryDao.MediaGlobalEscolaPergunta> getMediasPerguntaNaEscola() {
return mediasPerguntaNaEscola;
}
 
public void setMediasPerguntaNaEscola(HashMap<String, PerguntasGrupoQueryDao.MediaGlobalEscolaPergunta> mediasPerguntaNaEscola) {
this.mediasPerguntaNaEscola = mediasPerguntaNaEscola;
}
 
public HashMap<String, PerguntasGrupoQueryDao.MediaGlobalCursoGrupo> getMediasGrupoNoCurso() {
return mediasGrupoNoCurso;
}
 
public void setMediasGrupoNoCurso(HashMap<String, PerguntasGrupoQueryDao.MediaGlobalCursoGrupo> mediasGrupoNoCurso) {
this.mediasGrupoNoCurso = mediasGrupoNoCurso;
}
 
public HashMap<String, PerguntasGrupoQueryDao.MediaGlobalEscolaGrupo> getMediasGrupoNaEscola() {
return mediasGrupoNaEscola;
}
 
public void setMediasGrupoNaEscola(HashMap<String, PerguntasGrupoQueryDao.MediaGlobalEscolaGrupo> mediasGrupoNaEscola) {
this.mediasGrupoNaEscola = mediasGrupoNaEscola;
}
 
public ChartWithDataTable getDimensoesGeralChartAndTable() {
return dimensoesGeralChartAndTable;
}
/branches/v3/impl/src/java/pt/estgp/estgweb/services/questionarios/pedagogico/cursoPublicReport.fo.xsl
4,6 → 4,7
 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org/1999/XSL/Format http://svn.apache.org/repos/asf/xmlgraphics/fop/trunk/fop/src/foschema/fop.xsd">
<xsl:import href="report.fo.xsl"/>
<xsl:import href="utilsReports.fo.xsl"/>
<xsl:import href="docenteReportGuiaoAvaliacaoDesempenho.fo.xsl"/>
 
106,7 → 107,7
 
 
<fo:flow flow-name="body">
<fo:block font-size="20px" padding="4px" margin-top="40px" text-align="center" >
<fo:block font-size="20px" padding="4px" margin-top="5px" text-align="center" >
<fo:inline text-decoration="underline" font-weight="bold">Índice</fo:inline>
</fo:block>
<fo:block text-align-last="justify" font-weight="bold" margin-bottom="5px">
127,6 → 128,94
<xsl:with-param name="id">capTaxasResposta</xsl:with-param>
</xsl:call-template>
 
<xsl:call-template name="indexEntry">
<xsl:with-param name="sectionNumber">3</xsl:with-param>
<xsl:with-param name="sectionTitle">Evolução das Taxas de Resposta</xsl:with-param>
<xsl:with-param name="id">capEvoTaxasResposta</xsl:with-param>
</xsl:call-template>
 
<xsl:call-template name="indexEntry">
<xsl:with-param name="sectionNumber">4</xsl:with-param>
<xsl:with-param name="sectionTitle">Análise das questões agregadas do grupo Unidade Curricular</xsl:with-param>
<xsl:with-param name="id">capQuestoesAgregadasUnidades</xsl:with-param>
</xsl:call-template>
 
<xsl:call-template name="indexEntry">
<xsl:with-param name="sectionNumber">5</xsl:with-param>
<xsl:with-param name="sectionTitle">Análise das questões agregadas do grupo Instalações/Equipamentos/Outros Recursos </xsl:with-param>
<xsl:with-param name="id">capQuestoesAgregadasSalas</xsl:with-param>
</xsl:call-template>
 
<xsl:call-template name="indexEntry">
<xsl:with-param name="sectionNumber">6</xsl:with-param>
<xsl:with-param name="sectionTitle">Análise das questões em cada Unidade curricular do curso individualmente </xsl:with-param>
<xsl:with-param name="id">capQuestoesUnidade</xsl:with-param>
</xsl:call-template>
 
<!-- Estes fors organizam primeiro por curso, neste caso o curso é so um mas o for fica assim para se reaproveitar para
o relatorio de Cursos com todo os cursos -->
<xsl:for-each select="//cursoStats/unidadesStats/unidadeStats[not(nomeCurso/text() = preceding-sibling::unidadeStats/nomeCurso/text())]">
<xsl:sort select="text()" data-type="text" />
<xsl:variable name="nomeCurso" select="nomeCurso/text()"/>
<xsl:for-each select="../unidadeStats[nomeCurso/text() = $nomeCurso]">
<xsl:sort select="nomeUnidade/text()" data-type="text" />
<xsl:call-template name="subIndexEntry">
<xsl:with-param name="sectionNumber">6.<xsl:value-of select="position()"/></xsl:with-param>
<xsl:with-param name="sectionTitle"><xsl:value-of select="nomeUnidade"/></xsl:with-param>
<xsl:with-param name="id">UNIDADE_CURICULAR<xsl:value-of select="codigoUnidade"/></xsl:with-param>
</xsl:call-template>
</xsl:for-each>
</xsl:for-each>
 
<!--
Grafico de barras horizontais com media unidades e media salas
Tabela com todas as metricas Media Desvios e Média Curso Média Escola + respostas
Tabela com todas as métricas de todas as questões mais média + nº respostas
-->
<xsl:call-template name="indexEntry">
<xsl:with-param name="sectionNumber">7</xsl:with-param>
<xsl:with-param name="sectionTitle">Análise comparativa das Unidades Curriculares</xsl:with-param>
<xsl:with-param name="id">capComparativaUnidades</xsl:with-param>
</xsl:call-template>
 
<xsl:call-template name="subIndexEntry">
<xsl:with-param name="sectionNumber">7.1</xsl:with-param>
<xsl:with-param name="sectionTitle">Gráfico de comparativo de todas as unidades</xsl:with-param>
<xsl:with-param name="id">capComparativaUnidades</xsl:with-param>
</xsl:call-template>
capComparativaUnidadesSortMediaUnidade
<xsl:call-template name="subIndexEntry">
<xsl:with-param name="sectionNumber">7.2</xsl:with-param>
<xsl:with-param name="sectionTitle">Gráfico de comparativo de todas as unidades (ordenado pela Média da Unidade)</xsl:with-param>
<xsl:with-param name="id">capComparativaUnidadesSortMediaUnidades</xsl:with-param>
</xsl:call-template>
 
<xsl:call-template name="subIndexEntry">
<xsl:with-param name="sectionNumber">7.3</xsl:with-param>
<xsl:with-param name="sectionTitle">Gráfico de comparativo de todas as unidades (ordenado pela Média das Instalações/Equipamentos/Outros Recursos)</xsl:with-param>
<xsl:with-param name="id">capComparativaUnidadesSortMediaSalas</xsl:with-param>
</xsl:call-template>
 
<xsl:call-template name="subIndexEntry">
<xsl:with-param name="sectionNumber">7.4</xsl:with-param>
<xsl:with-param name="sectionTitle">Tabela de médias de todas as unidades vs curso e escola</xsl:with-param>
<xsl:with-param name="id">capComparativaUnidadesTable</xsl:with-param>
</xsl:call-template>
 
<xsl:call-template name="subIndexEntry">
<xsl:with-param name="sectionNumber">7.5</xsl:with-param>
<xsl:with-param name="sectionTitle">Tabela das médias de todas as questões por unidade</xsl:with-param>
<xsl:with-param name="id">capComparativaUnidadesPerguntas</xsl:with-param>
</xsl:call-template>
 
 
<xsl:call-template name="indexEntry">
<xsl:with-param name="sectionNumber">8</xsl:with-param>
<xsl:with-param name="sectionTitle">Evolução das médias das Unidades Curriculares</xsl:with-param>
<xsl:with-param name="id">capQuestoesUnidade</xsl:with-param>
</xsl:call-template>
 
 
</fo:flow>
</xsl:template>
 
179,16 → 268,25
 
<xsl:call-template name="CAP_taxasResposta"/>
 
<xsl:call-template name="CAP_evoTaxasResposta"/>
 
<xsl:call-template name="CAP_analise_questoes_UNIDADE"/>
 
<xsl:call-template name="CAP_analise_questoes_SALAS"/>
 
<xsl:apply-templates select="//cursoStats/unidadesStats" mode="unidadePorUnidade">
<xsl:with-param name="CAP_PONTO">6</xsl:with-param>
<xsl:with-param name="CAP_ID">capQuestoesUnidade</xsl:with-param>
</xsl:apply-templates>
 
<xsl:call-template name="CAP_analise_comparativa_unidades"/>
 
 
</fo:flow>
</xsl:template>
 
<!-- UTILITARIO PARA LINHAS NA TABELA DE FORCAS E FRAQUESAS -->
 
 
 
<!-- ############################################################# -->
<!-- 1 - CAPITULO ANALISE PARTICIPACAO PONTOS -->
<!-- ############################################################# -->
388,8 → 486,14
<xsl:with-param name="fontSize">12pt</xsl:with-param>
</xsl:apply-templates>
</fo:block>
</xsl:template>
 
<fo:block-container padding="0" margin="0" border="0" page-break-before="always">
<!-- ############################################################# -->
<!-- 3 - CAPITULO Evolução das Taxas de Resposta -->
<!-- ############################################################# -->
 
<xsl:template name="CAP_evoTaxasResposta">
<fo:block-container padding="0" margin="0" border="0" id="capEvoTaxasResposta" page-break-before="always">
<xsl:call-template name="seccao">
<xsl:with-param name="text">3 - Evolução das Taxas de resposta</xsl:with-param>
<xsl:with-param name="marginTop">0</xsl:with-param>
411,10 → 515,244
<xsl:with-param name="fontSize">12pt</xsl:with-param>
</xsl:apply-templates>
</fo:block>
</xsl:template>
 
<!-- ############################################################# -->
<!-- 4 - CAPITULO Análise de Respostas Agregadas UNIDADES -->
<!-- ############################################################# -->
 
<xsl:template name="CAP_analise_questoes_UNIDADE">
 
<fo:block-container padding="0" margin="0" id="capQuestoesAgregadasUnidades" page-break-before="always">
<xsl:call-template name="seccaoGreen">
<xsl:with-param name="text">4 - Análise das questões sobre as Unidade</xsl:with-param>
<xsl:with-param name="marginTop">0</xsl:with-param>
<xsl:with-param name="icon">cadeiraConteudos.png</xsl:with-param>
</xsl:call-template>
</fo:block-container>
 
<xsl:call-template name="subSeccaoGreen">
<xsl:with-param name="text">4.1 - Gráficos de respostas agregadas de todas as unidades do Curso</xsl:with-param>
<xsl:with-param name="marginTop">2px</xsl:with-param>
</xsl:call-template>
 
<xsl:apply-templates select="//respostasAgregadasGrupoUnidade/respostasAgregadasChartTable/respostasAgregadasCharts/chartsRow" mode="graficosPerguntas"/>
 
 
<fo:block-container padding="0" margin="0" page-break-before="always">
<xsl:call-template name="seccaoGreen">
<xsl:with-param name="text">4 - Análise das questões sobre as Unidades</xsl:with-param>
<xsl:with-param name="marginTop">0</xsl:with-param>
<xsl:with-param name="icon">cadeiraConteudos.png</xsl:with-param>
</xsl:call-template>
</fo:block-container>
 
<xsl:call-template name="subSeccaoGreen">
<xsl:with-param name="text">4.2 - Tabela de respostas agregadas de todas as unidades do curso</xsl:with-param>
<xsl:with-param name="marginTop">2px</xsl:with-param>
</xsl:call-template>
 
 
<fo:block text-align="center" margin="0" font-size="10" font-weight="normal" >
<xsl:apply-templates select="//cursoStats/respostasAgregadasGrupoUnidade/respostasAgregadasChartTable/respostasTable" mode="DataTable">
<xsl:with-param name="firstColPercentSize">40%</xsl:with-param>
</xsl:apply-templates>
</fo:block>
 
<fo:block text-align="right" margin-top="10px" margin-left="10px" font-size="6.5pt" font-weight="normal" margin-right="10px">
Unidades avaliadas em <xsl:value-of select="//cursoStats/nomeCurso"/>: <xsl:value-of select="//cursoStats/unidadesDoCurso"/>
</fo:block>
<fo:block text-align="right" margin-left="10px" font-size="6.5pt" font-weight="normal" margin-right="10px">
Unidades avaliadas na <xsl:value-of select="//cursoStats/nomeInstituicao"/>: <xsl:value-of select="//cursoStats/unidadesDaEscola"/>
</fo:block>
 
<fo:block-container margin-top="20px" margin-bottom="5px">
<xsl:apply-templates select="//cursoStats/respostasAgregadasGrupoUnidade/mediasGrupo" mode="mediasGrupo">
<xsl:with-param name="objetoAvaliacao">das unidades</xsl:with-param>
</xsl:apply-templates>
</fo:block-container>
 
<!--Considerando Respostas Superiores a 2 segindos-->
<fo:block-container background-color="#aaaaaa" padding="5px" margin="0" margin-top="20px">
<fo:block-container padding="0" margin="0">
<xsl:call-template name="subSubSeccao">
<xsl:with-param name="text">Considerando apenas respostas de tempo superior a 2 segundos (Estes dados são apenas para efeitos de comparação)</xsl:with-param>
</xsl:call-template>
</fo:block-container>
 
<fo:block text-align="center" margin-left="10px" font-size="10" font-weight="normal" margin-right="10px">
 
<xsl:apply-templates select="//cursoStats/respostasAgregadasGrupoUnidade/respostasAgregadasChartTable2Secs/respostasTable" mode="DataTable">
<xsl:with-param name="firstColPercentSize">40%</xsl:with-param>
</xsl:apply-templates>
</fo:block>
</fo:block-container>
</xsl:template>
 
<!-- ############################################################# -->
<!-- 5 - CAPITULO Análise de Respostas Agregadas SALAS -->
<!-- ############################################################# -->
 
<xsl:template name="CAP_analise_questoes_SALAS">
 
<xsl:variable name="title">Análise das questões sobre as Instalações/Equipamentos/Outros Recursos</xsl:variable>
<fo:block-container padding="0" margin="0" id="capQuestoesAgregadasSalas" page-break-before="always">
<xsl:call-template name="seccaoRose">
<xsl:with-param name="text">5 - <xsl:value-of select="$title"/></xsl:with-param>
<xsl:with-param name="marginTop">0</xsl:with-param>
<xsl:with-param name="icon">cadeiraCadeira.png</xsl:with-param>
</xsl:call-template>
</fo:block-container>
 
<xsl:call-template name="subSeccaoRose">
<xsl:with-param name="text">5.1 - Gráficos de respostas agregadas de todas as unidades do Curso</xsl:with-param>
<xsl:with-param name="marginTop">2px</xsl:with-param>
</xsl:call-template>
 
<xsl:apply-templates select="//respostasAgregadasGrupoSalas/respostasAgregadasChartTable/respostasAgregadasCharts/chartsRow" mode="graficosPerguntas"/>
 
 
<fo:block-container padding="0" margin="0" page-break-before="always">
<xsl:call-template name="seccaoRose">
<xsl:with-param name="text">5 - <xsl:value-of select="$title"/></xsl:with-param>
<xsl:with-param name="marginTop">0</xsl:with-param>
<xsl:with-param name="icon">cadeiraCadeira.png</xsl:with-param>
</xsl:call-template>
</fo:block-container>
 
<xsl:call-template name="subSeccaoRose">
<xsl:with-param name="text">5.2 - Tabela de respostas agregadas de todas as unidades do curso</xsl:with-param>
<xsl:with-param name="marginTop">2px</xsl:with-param>
</xsl:call-template>
 
 
<fo:block text-align="center" margin="0" font-size="10" font-weight="normal" >
<xsl:apply-templates select="//cursoStats/respostasAgregadasGrupoSalas/respostasAgregadasChartTable/respostasTable" mode="DataTable">
<xsl:with-param name="firstColPercentSize">40%</xsl:with-param>
</xsl:apply-templates>
</fo:block>
 
<fo:block text-align="right" margin-top="10px" margin-left="10px" font-size="6.5pt" font-weight="normal" margin-right="10px">
Unidades avaliadas em <xsl:value-of select="//cursoStats/nomeCurso"/>: <xsl:value-of select="//cursoStats/unidadesDoCurso"/>
</fo:block>
<fo:block text-align="right" margin-left="10px" font-size="6.5pt" font-weight="normal" margin-right="10px">
Unidades avaliadas na <xsl:value-of select="//cursoStats/nomeInstituicao"/>: <xsl:value-of select="//cursoStats/unidadesDaEscola"/>
</fo:block>
 
<fo:block-container margin-top="20px" margin-bottom="5px">
<xsl:apply-templates select="//cursoStats/respostasAgregadasGrupoSalas/mediasGrupo" mode="mediasGrupo">
<xsl:with-param name="objetoAvaliacao">das instalações</xsl:with-param>
</xsl:apply-templates>
</fo:block-container>
 
<!--Considerando Respostas Superiores a 2 segindos-->
<fo:block-container background-color="#aaaaaa" padding="5px" margin="0" margin-top="20px">
<fo:block-container padding="0" margin="0">
<xsl:call-template name="subSubSeccao">
<xsl:with-param name="text">Considerando apenas respostas de tempo superior a 2 segundos (Estes dados são apenas para efeitos de comparação)</xsl:with-param>
</xsl:call-template>
</fo:block-container>
 
<fo:block text-align="center" margin-left="10px" font-size="10" font-weight="normal" margin-right="10px">
 
<xsl:apply-templates select="//cursoStats/respostasAgregadasGrupoSalas/respostasAgregadasChartTable2Secs/respostasTable" mode="DataTable">
<xsl:with-param name="firstColPercentSize">40%</xsl:with-param>
</xsl:apply-templates>
</fo:block>
</fo:block-container>
</xsl:template>
 
<!-- ############################################################# -->
<!-- 7 - CAPITULO Análise Comparativa de Unidades -->
<!-- ############################################################# -->
<xsl:template name="CAP_analise_comparativa_unidades">
 
<xsl:variable name="title">Análise Comparativa de Unidades Curriculares</xsl:variable>
<fo:block-container padding="0" margin="0" id="capComparativaUnidades" page-break-before="always">
<xsl:call-template name="seccao">
<xsl:with-param name="text">7 - <xsl:value-of select="$title"/></xsl:with-param>
<xsl:with-param name="marginTop">2px</xsl:with-param>
</xsl:call-template>
</fo:block-container>
 
<xsl:call-template name="subSeccao">
<xsl:with-param name="text">7.1 - Comparação entre a média a Unidade Curricular e as Instalações/Equipamentos/Outros Recursos</xsl:with-param>
<xsl:with-param name="marginTop">2px</xsl:with-param>
</xsl:call-template>
 
<fo:block margin="0" padding="0" text-align="center">
<xsl:variable name="src"><xsl:value-of select="//analiseConjuntaChartWithTable/tempFile"/></xsl:variable>
<fo:external-graphic width="auto" height="auto" content-height="500" src="{$src}"/>
</fo:block>
 
 
 
 
<fo:block-container padding="0" margin="0" page-break-before="always" id="capComparativaUnidadesSortMediaUnidades">
<xsl:call-template name="seccao">
<xsl:with-param name="text">7 - <xsl:value-of select="$title"/></xsl:with-param>
<xsl:with-param name="marginTop">2px</xsl:with-param>
</xsl:call-template>
</fo:block-container>
<xsl:call-template name="subSeccao">
<xsl:with-param name="text">7.2 - Comparação entre a média a Unidade Curricular e as Instalações/Equipamentos/Outros Recursos (Ordenado por Média do Grupo Unidade)</xsl:with-param>
<xsl:with-param name="marginTop">2px</xsl:with-param>
</xsl:call-template>
<fo:block margin="0" padding="0" text-align="center">
<xsl:variable name="src"><xsl:value-of select="//analiseConjuntaChartOrderMediaUnidades"/></xsl:variable>
<fo:external-graphic width="auto" height="auto" content-height="500" src="{$src}"/>
</fo:block>
 
 
 
 
<fo:block-container padding="0" margin="0" page-break-before="always" id="capComparativaUnidadesSortMediaSalas">
<xsl:call-template name="seccao">
<xsl:with-param name="text">7 - <xsl:value-of select="$title"/></xsl:with-param>
<xsl:with-param name="marginTop">2px</xsl:with-param>
</xsl:call-template>
</fo:block-container>
<xsl:call-template name="subSeccao">
<xsl:with-param name="text">7.3 - Comparação entre a média a Unidade Curricular e as Instalações/Equipamentos/Outros Recursos (Ordenado por Média do Grupo Instalações/Equipamentos/Outros Recursos)</xsl:with-param>
<xsl:with-param name="marginTop">2px</xsl:with-param>
</xsl:call-template>
 
<fo:block margin="0" padding="0" text-align="center">
<xsl:variable name="src"><xsl:value-of select="//analiseConjuntaChartOrderMediaSalas"/></xsl:variable>
<fo:external-graphic width="auto" height="auto" content-height="500" src="{$src}"/>
</fo:block>
 
 
 
 
 
<fo:block-container padding="0" margin="0" page-break-before="always" id="capComparativaUnidadesTable">
<xsl:call-template name="seccao">
<xsl:with-param name="text">7 - <xsl:value-of select="$title"/></xsl:with-param>
<xsl:with-param name="marginTop">2px</xsl:with-param>
</xsl:call-template>
</fo:block-container>
<xsl:call-template name="subSeccao">
<xsl:with-param name="text">7.4 - Tabela de valores para a agregação das respostas em todas as perguntas dos dois grupos</xsl:with-param>
<xsl:with-param name="marginTop">2px</xsl:with-param>
</xsl:call-template>
 
<xsl:apply-templates select="//analiseConjuntaChartWithTable/dataTable" mode="DataTable">
<!--<xsl:with-param name="ignoreColumns">true</xsl:with-param>-->
</xsl:apply-templates>
 
 
<fo:block-container padding="0" margin="0" page-break-before="always" id="capComparativaUnidadesPerguntas">
<xsl:call-template name="seccao">
<xsl:with-param name="text">7 - <xsl:value-of select="$title"/></xsl:with-param>
<xsl:with-param name="marginTop">2px</xsl:with-param>
</xsl:call-template>
</fo:block-container>
<xsl:call-template name="subSeccao">
<xsl:with-param name="text">7.5 - Tabela das médias de todas as questões por unidade</xsl:with-param>
<xsl:with-param name="marginTop">2px</xsl:with-param>
</xsl:call-template>
 
</xsl:template>
 
</xsl:stylesheet>
/branches/v3/impl/src/java/pt/estgp/estgweb/services/questionarios/pedagogico/ReportGenerator.java
1,11 → 1,30
package pt.estgp.estgweb.services.questionarios.pedagogico;
 
import jomm.dao.impl.AbstractDao;
import org.apache.log4j.Logger;
import org.hibernate.Query;
import pt.estgp.estgweb.domain.OlapStarFactQuestionarioAnswer;
import pt.estgp.estgweb.services.questionarios.PedagogicoAlunosProcessor;
import pt.estgp.estgweb.services.questionarios.pedagogico.queries.PerguntasGrupoQueryDao;
import pt.estgp.estgweb.services.questionarios.pedagogico.queries.QueryDaoUtils;
import pt.estgp.estgweb.services.questionarios.pedagogico.queries.QuestionariosQueryDao;
import pt.estgp.estgweb.services.questionarios.utils.*;
import pt.estgp.estgweb.utils.ConfigProperties;
 
import java.awt.*;
import java.io.IOException;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;
 
/**
* Created by jorgemachado on 16/12/16.
*/
public class ReportGenerator
{
 
private static final Logger logger = Logger.getLogger(ReportGenerator.class);
 
protected String anoLectivo;
protected String[] periodos;
protected String[] degrees;
21,4 → 40,351
 
 
}
 
/**
* Gera um gráfico com todas as respostas agregadas por questao para um professor
* @param codes
* @param anoLectivo
* @param report
*/
public static void criarGraficosRespostasAgregadas(String[] codes,
EntityEvaluated entityEvaluated,
String anoLectivo,
QuestionariosAlunosReport report,
List<String> codigosCurso,
List<String> codigosEscola,
double tempoMinimo,
RespostasAgregadasGrupoStats.RespostasAgregadasChartTable respostasAgregadasChartTable,
RespostasAgregadasGrupoStats respostasAgregadasGrupo,
String grupo,
String subGrupo,
String[] periodos,
String[] degrees,
boolean generateChart)
{
String periodosQuery = QueryDaoUtils.createPeriodosQuery(periodos, "quest", true);
String degreesQuery = QueryDaoUtils.createDegreesQuery(degrees, "curso", true);
 
String whereFragmentEntity = QuestionariosQueryDao.getWhereEntityCodesFragment(codes,entityEvaluated);
 
Query query;//*****CRIAR REPOSTAS DO GRUPO DOCENTE*****///
 
 
query = AbstractDao.getCurrentSession().createQuery("" +
"SELECT " +
"avg(fc.intResposta) as media," +
"sum(case when fc.intResposta = 1 then 1 else 0 end) as r1," +
"sum(case when fc.intResposta = 2 then 1 else 0 end) as r2," +
"sum(case when fc.intResposta = 3 then 1 else 0 end) as r3," +
"sum(case when fc.intResposta = 4 then 1 else 0 end) as r4," +
"sum(case when fc.intResposta = 5 then 1 else 0 end) as r5," +
"std(fc.intResposta) as desvio," +
"count(fc.id) as total, " +
"prgp.pergunta as pergunta, " +
"prgp.numero as numero, " +
"avg(fc.tempoLevado) as tempoMedioLevado " +
 
"FROM " + OlapStarFactQuestionarioAnswer.class.getName() + " fc " +
"JOIN fc.olapPergunta prgp " +
"JOIN fc.olapTipologia tipo " +
"JOIN fc.olapQuestionario quest " +
"JOIN fc.olapCurso curso " +
"JOIN fc.olapTimeLine timeLine " +
 
"where " +
 
" quest.ano = :ano " +
whereFragmentEntity +
"and timeLine.nome = '" + PedagogicoAlunosProcessor.getHistoryDriveConstraintStatic() + "' " +
(tempoMinimo > 0 ? " and fc.tempoLevado > :tempoLevado " : "" ) +
periodosQuery +
degreesQuery +
(grupo == null ? "" : " and prgp.grupoCode = :grupoCode ") +
(subGrupo == null ? "" : " and prgp.subGrupoCode = :subGrupoCode ") +
"group by prgp.numero " +
"order by prgp.numero ");
if(grupo != null)
query.setString("grupoCode",grupo);
if(subGrupo != null)
query.setString("subGrupoCode",subGrupo);
// query.setString("codigoSiges",teacherCode);
query.setString("ano",anoLectivo);
if(tempoMinimo > 0)
{
query.setDouble("tempoLevado",tempoMinimo);
}
 
 
DataTable tableRespostasAgregadas = new DataTable();
 
 
 
DataTable.Row header = tableRespostasAgregadas.addRowHeader();
header.addColTextCenter("Questão");
header.addColTextCenter("Resps.");
header.addColTextCenter("Tempo Médio de Resposta (seg.)");
header.addColTextCenter("Nada Satisf. %");
header.addColTextCenter("Pouco Satisf. %");
header.addColTextCenter("Satisf. %");
header.addColTextCenter("Bastante Satisf. %");
header.addColTextCenter("Muito Satisf. %");
header.addColTextCenter("Média");
header.addColTextCenter("Desvio Padrão");
 
if(entityEvaluated == EntityEvaluated.DOCENTE)
{
header.addColTextCenter("Média dos Cursos em que Lecciona");
header.addColTextCenter("Diff Cursos");
header.addColTextCenter("Média das Escolas em que Lecciona");
header.addColTextCenter("Diff Escolas");
}
else if(entityEvaluated == EntityEvaluated.CURSO)
{
header.addColTextCenter("Média da Escola");
header.addColTextCenter("Diff Escola");
}
else
{
throw new RuntimeException("Não implementado");
}
 
 
 
List<Object[]> resultsTest = query.list();
for(Object[] resultTest : resultsTest)
{
Double tempoMedioLevado = (Double) resultTest[10];
Double mediaDocente = (Double) resultTest[0];
Double desvio = (Double) resultTest[6];
Long total = (Long) resultTest[7];
double min = mediaDocente - (desvio*2);
double max = mediaDocente + (desvio*2);
if(max > 5) max = 5;
DecimalFormat df = new DecimalFormat("#.##");
 
String questao = resultTest[8].toString();
String numero = resultTest[9].toString();
 
 
DataTable.Row rowUnidade = tableRespostasAgregadas.addRowNormal();
rowUnidade.addColLabelCenter(questao);
rowUnidade.addColTextCenter(""+total);
rowUnidade.addColTextCenter(df.format(tempoMedioLevado/1000.0));
DataTable.Row.Col colResposta1 = rowUnidade.addColTextCenter(resultTest[1].toString());
DataTable.Row.Col colResposta2 = rowUnidade.addColTextCenter(resultTest[2].toString());
DataTable.Row.Col colResposta3 = rowUnidade.addColTextCenter(resultTest[3].toString());
DataTable.Row.Col colResposta4 = rowUnidade.addColTextCenter(resultTest[4].toString());
DataTable.Row.Col colResposta5 = rowUnidade.addColTextCenter(resultTest[5].toString());
 
Long respostas1 = (Long) resultTest[1];
Long respostas2 = (Long) resultTest[2];
Long respostas3 = (Long) resultTest[3];
Long respostas4 = (Long) resultTest[4];
Long respostas5 = (Long) resultTest[5];
 
if(respostas1 >= respostas2 && respostas1 >= respostas3 && respostas1 >= respostas4 && respostas1 >= respostas5)
{
colResposta1.setBackgroundColor(ChartBuilderUtil.COLOR_1_HEX);
}else if(respostas2 >= respostas1 && respostas2 >= respostas3 && respostas2 >= respostas4 && respostas2 >= respostas5)
{
colResposta2.setBackgroundColor(ChartBuilderUtil.COLOR_2_HEX);
}else if(respostas3 >= respostas1 && respostas3 >= respostas2 && respostas3 >= respostas4 && respostas3 >= respostas5)
{
colResposta3.setBackgroundColor(ChartBuilderUtil.COLOR_3_HEX);
}else if(respostas4 >= respostas1 && respostas4 >= respostas2 && respostas4 >= respostas3 && respostas4 >= respostas5)
{
colResposta4.setBackgroundColor(ChartBuilderUtil.COLOR_4_HEX);
}else if(respostas5 >= respostas1 && respostas5 >= respostas2 && respostas5 >= respostas3 && respostas5 >= respostas4)
{
colResposta5.setBackgroundColor(ChartBuilderUtil.COLOR_5_HEX);
}
 
 
 
 
 
double mediaCursos = QueryDaoUtils.getMediaCursos(codigosCurso, anoLectivo, numero, tempoMinimo, grupo,subGrupo, periodos, degrees);
double mediaEscolas = QueryDaoUtils.getMediaEscolas(codigosEscola, anoLectivo, numero, tempoMinimo, grupo,subGrupo, periodos, degrees);
 
 
 
try {
PerguntaStats perguntaStatsAndChart;
 
if(tempoMinimo <= 0 && generateChart)
{
List<String> info = new ArrayList<String>();
info.add("Desvio Padrão: " + df.format(desvio));
info.add("Média: " + df.format(mediaDocente));
info.add("Respostas: " + total);
info.add("95% respostas entre: " + df.format(min) + " e " + df.format(max));
perguntaStatsAndChart = ChartBuilderUtil.createChartRespostasPergunta(questao, info,
new int[]{
((Long) resultTest[1]).intValue(),
((Long) resultTest[2]).intValue(),
((Long) resultTest[3]).intValue(),
((Long) resultTest[4]).intValue(),
((Long) resultTest[5]).intValue(),
}, "resposta" + tempoMinimo + numero, report.getQuestionariosReqRespondidos());
 
}
else
perguntaStatsAndChart = new PerguntaStats();
 
perguntaStatsAndChart.setPergunta(questao);
perguntaStatsAndChart.setNumero(numero);
perguntaStatsAndChart.setGrupo(grupo);
perguntaStatsAndChart.setSubGrupo(subGrupo);
perguntaStatsAndChart.setMediaCursosPrint(df.format(mediaCursos));
perguntaStatsAndChart.setMediaEscolasPrint(df.format(mediaEscolas));
perguntaStatsAndChart.setMediaCursos(mediaCursos);
perguntaStatsAndChart.setMediaEscolas(mediaEscolas);
perguntaStatsAndChart.setMediaEntidadeEmAvaliacao(mediaDocente);
perguntaStatsAndChart.setMediaEntidadeEmAvaliacaoPrint(df.format(mediaDocente));
perguntaStatsAndChart.setPercentMediaCursos("" + ((int) ((mediaCursos / 5.0) * 100.0)));
perguntaStatsAndChart.setPercentMediaEscolas("" + ((int) ((mediaEscolas / 5.0) * 100.0)));
perguntaStatsAndChart.setPercentMediaEntidadeEmAvaliacao("" + ((int)((mediaDocente/5.0)*100.0)));
 
perguntaStatsAndChart.setDiffMediaCurso(mediaDocente - mediaCursos);
perguntaStatsAndChart.setDiffMediaEscola(mediaDocente - mediaEscolas);
perguntaStatsAndChart.setDiffMediaCursoPrint(df.format(mediaDocente - mediaCursos));
perguntaStatsAndChart.setDiffMediaEscolaPrint(df.format(mediaDocente - mediaEscolas));
 
rowUnidade.addColPercentageDefinedCenter(perguntaStatsAndChart.getMediaEntidadeEmAvaliacaoPrint(), perguntaStatsAndChart.getPercentMediaEntidadeEmAvaliacao(), true);
rowUnidade.addColTextCenter(df.format(desvio));
if(entityEvaluated == EntityEvaluated.DOCENTE)
{
rowUnidade.addColPercentageDefinedCenter(perguntaStatsAndChart.getMediaCursosPrint(),perguntaStatsAndChart.getPercentMediaCursos(),true);
rowUnidade.addColNumberRight(perguntaStatsAndChart.getDiffMediaCursoPrint()).setBackgroundColor(ChartBuilderUtil.getBackgroundColorDiff(perguntaStatsAndChart.getDiffMediaCurso()));
}
else if(entityEvaluated == EntityEvaluated.CURSO)
{
 
}
else
{
throw new RuntimeException("Não implementado"); //para lembrar se implementar o de cima e esquecer este
}
rowUnidade.addColPercentageDefinedCenter(perguntaStatsAndChart.getMediaEscolasPrint(),perguntaStatsAndChart.getPercentMediaEscolas(),true);
rowUnidade.addColNumberRight(perguntaStatsAndChart.getDiffMediaEscolaPrint()).setBackgroundColor(ChartBuilderUtil.getBackgroundColorDiff(perguntaStatsAndChart.getDiffMediaEscola()));
 
respostasAgregadasChartTable.getRespostasAgregadasCharts().addChart(perguntaStatsAndChart);
respostasAgregadasChartTable.setRespostasTable(tableRespostasAgregadas);
 
if(tempoMinimo <= 0)
{
//adicionada segunda vez para ficar na classe de agregação de respostas e medias
//legadamente ja estavam no chart mas metem-se aqui tambem pois estavam em rows e afins
respostasAgregadasGrupo.getPerguntasStats().add(perguntaStatsAndChart);
PerguntasGrupoQueryDao.getMediasGrupo(codes,entityEvaluated, anoLectivo, report, codigosCurso, codigosEscola, grupo, subGrupo, respostasAgregadasGrupo.getMediasGrupo(), periodos, degrees);
}
 
} catch (IOException e) {
logger.error(e,e);
}
}
 
 
}
 
 
protected String criarChartETabelaMediaGruposPorUnidade(int width,int heightCategory,List<UnidadeStats> unidadesStats,String grupo1,String subgrupo1, String grupo2,String subgrupo2,DataTable table,String tmpPathPrefix,Color[] barColors,Color[] labelsColors) throws IOException
{
//Se houver subgrupo usa-se a label do subgrupo
String grupo1propertyIndex = subgrupo1 != null ? ConfigProperties.getProperty("questionario.group.inverse." + subgrupo1) : ConfigProperties.getProperty("questionario.group.inverse." + grupo1);
String grupo1Label = ConfigProperties.getProperty("questionario.group" + grupo1propertyIndex + ".title");
String grupo2propertyIndex = subgrupo2 != null ? grupo2propertyIndex = ConfigProperties.getProperty("questionario.group.inverse." + subgrupo2) : ConfigProperties.getProperty("questionario.group.inverse." + grupo2);
String grupo2Label = ConfigProperties.getProperty("questionario.group" + grupo2propertyIndex + ".title");
 
if(table != null)
{
DataTable.Row headerDefinition = table.addRowHeader();
headerDefinition.setInvisible(true);
headerDefinition.addColTextCenter("Unidade Inv").setWidth("20%");
headerDefinition.addColTextCenter("Código Inv");
headerDefinition.addColTextCenter("Curso Inv").setWidth("20%");
headerDefinition.addColTextCenter("Código Curso Inv");
headerDefinition.addColTextCenter("Respostas Inv");
headerDefinition.addColTextCenter("Média Inv");
headerDefinition.addColTextCenter("Desvio Inv");
headerDefinition.addColTextCenter("Média Curso Inv");
headerDefinition.addColTextCenter("Média Escola Inv");
headerDefinition.addColTextCenter("Média Inv");
headerDefinition.addColTextCenter("Desvio Inv");
headerDefinition.addColTextCenter("Média Curso Inv");
headerDefinition.addColTextCenter("Média Escola Inv");
 
DataTable.Row header = table.addRowHeader();
 
 
header.addColInvisible().setColspan(5);
DataTable.Row.Col colgrupo1 = header.addColTextCenter(grupo1Label);
DataTable.Row.Col colgrupo2 = header.addColTextCenter(grupo2Label);
colgrupo1.setColspan(4);
colgrupo2.setColspan(4);
 
colgrupo1.setBackgroundColor(ChartBuilderUtil.getRgbXslColor(barColors[0]));
colgrupo2.setBackgroundColor(ChartBuilderUtil.getRgbXslColor(barColors[1]));
 
DataTable.Row header2 = table.addRowHeader();
header2.addColTextCenter("Unidade");
header2.addColTextCenter("Código");
header2.addColTextCenter("Curso");
header2.addColTextCenter("Código Curso");
header2.addColTextCenter("Resps");
header2.addColTextCenter("Média").setBackgroundColor(colgrupo1.getBackgroundColor());
header2.addColTextCenter("Desvio").setBackgroundColor(colgrupo1.getBackgroundColor());
header2.addColTextCenter("Média Curso").setBackgroundColor(colgrupo1.getBackgroundColor());
header2.addColTextCenter("Média Escola").setBackgroundColor(colgrupo1.getBackgroundColor());
header2.addColTextCenter("Média").setBackgroundColor(colgrupo2.getBackgroundColor());
header2.addColTextCenter("Desvio").setBackgroundColor(colgrupo2.getBackgroundColor());
header2.addColTextCenter("Média Curso").setBackgroundColor(colgrupo2.getBackgroundColor());
header2.addColTextCenter("Média Escola").setBackgroundColor(colgrupo2.getBackgroundColor());
}
 
double valores[][] = new double[unidadesStats.size()][2];
String [] categories = new String[unidadesStats.size()];
int i = 0;
 
DecimalFormat df =new DecimalFormat("#.##");
for(UnidadeStats unidadeStats : unidadesStats)
{
UnidadeStats.UnidadeStatsGrupo unidadeStatsGrupo1 = unidadeStats.findUnidadeStatsGrupo(grupo1,subgrupo1);
UnidadeStats.UnidadeStatsGrupo unidadeStatsGrupo2 = unidadeStats.findUnidadeStatsGrupo(grupo2,subgrupo2);
valores[i][0] = unidadeStatsGrupo1.getMediasGrupo().getAvaliacaoMedia();
valores[i][1] = unidadeStatsGrupo2.getMediasGrupo().getAvaliacaoMedia();
categories[i] = unidadeStats.getNomeUnidadeComCursoAbreviado();
i++;
 
if(table != null)
{
DataTable.Row rowUnit = table.addRowNormal();
rowUnit.addColTextCenter(unidadeStats.getNomeUnidade());
rowUnit.addColTextCenter(unidadeStats.getCodigoUnidade());
rowUnit.addColTextCenter(unidadeStats.getNomeCurso());
rowUnit.addColTextCenter(unidadeStats.getCodigoCurso());
rowUnit.addColNumberRight("" + unidadeStats.getRespostas());
 
rowUnit.addColPercentageDefinedCenter(df.format(unidadeStatsGrupo1.getMediasGrupo().getAvaliacaoMedia()), unidadeStatsGrupo1.getMediasGrupo().getPercentAvaliacaoMediaForTables(), true);
rowUnit.addColNumberRight(df.format(unidadeStatsGrupo1.getMediasGrupo().getDesvioPadrao()));
rowUnit.addColPercentageDefinedCenter(df.format(unidadeStatsGrupo1.getMediasGrupo().getMediaGlobalNosCursos()), unidadeStatsGrupo1.getMediasGrupo().getPercentMediaGlobalNosCursosForTables(), true);
rowUnit.addColPercentageDefinedCenter(df.format(unidadeStatsGrupo1.getMediasGrupo().getMediaGlobalNasEscolas()), unidadeStatsGrupo1.getMediasGrupo().getPercentMediaGlobalNasEscolasForTables(), true);
 
rowUnit.addColPercentageDefinedCenter(df.format(unidadeStatsGrupo2.getMediasGrupo().getAvaliacaoMedia()), unidadeStatsGrupo2.getMediasGrupo().getPercentAvaliacaoMediaForTables(), true);
rowUnit.addColNumberRight(df.format(unidadeStatsGrupo2.getMediasGrupo().getDesvioPadrao()));
rowUnit.addColPercentageDefinedCenter(df.format(unidadeStatsGrupo2.getMediasGrupo().getMediaGlobalNosCursos()), unidadeStatsGrupo2.getMediasGrupo().getPercentMediaGlobalNosCursosForTables(), true);
rowUnit.addColPercentageDefinedCenter(df.format(unidadeStatsGrupo2.getMediasGrupo().getMediaGlobalNasEscolas()), unidadeStatsGrupo2.getMediasGrupo().getPercentMediaGlobalNasEscolasForTables(), true);
}
 
}
 
String path = ChartBuilderUtil.createBarChartBarsCategories(
new String[]{grupo1Label,grupo2Label},
categories,
barColors,
labelsColors,
valores,
0,5, tmpPathPrefix + "unidadesConjuntas",width,heightCategory);
return path;
}
}
/branches/v3/impl/src/java/pt/estgp/estgweb/services/questionarios/pedagogico/QuestionariosAlunosReport.java
1,9 → 1,11
package pt.estgp.estgweb.services.questionarios.pedagogico;
 
import pt.estgp.estgweb.services.questionarios.pedagogico.queries.PerguntasGrupoQueryDao;
import pt.estgp.estgweb.services.questionarios.utils.DataTable;
 
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
 
/**
* Created by jorgemachado on 07/12/16.
38,6 → 40,77
public ArrayList<ParticipacaoUnidade> participacoesUnidades = new ArrayList<ParticipacaoUnidade>();
 
 
 
 
 
 
 
 
//MEDIAS GLOBAIS
//Preenchidas no UnidadeQueryDao durante o preenchimento das unidadesCurriculares porque sao necessarias as
//medias dos grupos e das perguntas nas escolas e nos cursos das perguntas
//Obtem-se o valor no PerguntaGrupoQueryDao pode-se invocar os metodos por aqui com este proxy
private HashMap<String,PerguntasGrupoQueryDao.MediaGlobalCursoPergunta> mediasPerguntaNoCurso = new HashMap<String, PerguntasGrupoQueryDao.MediaGlobalCursoPergunta>();
private HashMap<String,PerguntasGrupoQueryDao.MediaGlobalEscolaPergunta> mediasPerguntaNaEscola = new HashMap<String, PerguntasGrupoQueryDao.MediaGlobalEscolaPergunta>();
private HashMap<String,PerguntasGrupoQueryDao.MediaGlobalCursoGrupo> mediasGrupoNoCurso = new HashMap<String, PerguntasGrupoQueryDao.MediaGlobalCursoGrupo>();
private HashMap<String,PerguntasGrupoQueryDao.MediaGlobalEscolaGrupo> mediasGrupoNaEscola = new HashMap<String, PerguntasGrupoQueryDao.MediaGlobalEscolaGrupo>();
 
public PerguntasGrupoQueryDao.MediaGlobalCursoPergunta mediaPerguntaNoCurso(String codigoCurso, String anoLectivo, String numeroPergunta,String[] periodos,String[]degrees)
{
return PerguntasGrupoQueryDao.getMediaCursoPergunta(this,codigoCurso,anoLectivo,numeroPergunta,periodos);
}
public PerguntasGrupoQueryDao.MediaGlobalCursoGrupo mediaGrupoNoCurso(String codigoCurso, String anoLectivo, String grupo,String subGrupo,String[] periodos,String[]degrees)
{
return PerguntasGrupoQueryDao.getMediaCursoGrupo(this, codigoCurso,anoLectivo,grupo,subGrupo,periodos);
}
public PerguntasGrupoQueryDao.MediaGlobalEscolaPergunta mediaPerguntaNaEscola(String codigoEscola, String anoLectivo, String numeroPergunta,String[] periodos,String[]degrees)
{
return PerguntasGrupoQueryDao.getMediaEscolaPergunta(this, codigoEscola, anoLectivo, numeroPergunta,periodos,degrees);
}
public PerguntasGrupoQueryDao.MediaGlobalEscolaGrupo mediaGrupoNaEscola(String codigoEscola, String anoLectivo, String grupo,String subGrupo,String[] periodos,String[]degrees)
{
return PerguntasGrupoQueryDao.getMediaEscolaGrupo(this, codigoEscola, anoLectivo, grupo,subGrupo, periodos,degrees);
}
 
public HashMap<String, PerguntasGrupoQueryDao.MediaGlobalCursoPergunta> getMediasPerguntaNoCurso() {
return mediasPerguntaNoCurso;
}
 
public void setMediasPerguntaNoCurso(HashMap<String, PerguntasGrupoQueryDao.MediaGlobalCursoPergunta> mediasPerguntaNoCurso) {
this.mediasPerguntaNoCurso = mediasPerguntaNoCurso;
}
 
public HashMap<String, PerguntasGrupoQueryDao.MediaGlobalEscolaPergunta> getMediasPerguntaNaEscola() {
return mediasPerguntaNaEscola;
}
 
public void setMediasPerguntaNaEscola(HashMap<String, PerguntasGrupoQueryDao.MediaGlobalEscolaPergunta> mediasPerguntaNaEscola) {
this.mediasPerguntaNaEscola = mediasPerguntaNaEscola;
}
 
public HashMap<String, PerguntasGrupoQueryDao.MediaGlobalCursoGrupo> getMediasGrupoNoCurso() {
return mediasGrupoNoCurso;
}
 
public void setMediasGrupoNoCurso(HashMap<String, PerguntasGrupoQueryDao.MediaGlobalCursoGrupo> mediasGrupoNoCurso) {
this.mediasGrupoNoCurso = mediasGrupoNoCurso;
}
 
public HashMap<String, PerguntasGrupoQueryDao.MediaGlobalEscolaGrupo> getMediasGrupoNaEscola() {
return mediasGrupoNaEscola;
}
 
public void setMediasGrupoNaEscola(HashMap<String, PerguntasGrupoQueryDao.MediaGlobalEscolaGrupo> mediasGrupoNaEscola) {
this.mediasGrupoNaEscola = mediasGrupoNaEscola;
}
 
 
 
 
 
 
 
 
public DataTable getTabelaTaxaRespostaUnidadeOrderTaxa() {
return tabelaTaxaRespostaUnidadeOrderTaxa;
}
/branches/v3/impl/src/java/pt/estgp/estgweb/services/questionarios/pedagogico/DocenteReportGenerator.java
217,10 → 217,10
 
 
 
UnidadesQueryDao.criarTabelasCadeiras(teacherCode,
UnidadesQueryDao.criarTabelasCadeirasDocente(teacherCode,
anoLectivo,
docenteReport,
0, periodos, degrees);
0, periodos, degrees,docenteReport.getUnidadesStats());
 
 
criaExtremeCharts(docenteReport);
313,7 → 313,7
new Color[]{ChartBuilderUtil.COLOR_SECTION_DIM_DARK,ChartBuilderUtil.COLOR_SECTION_DIM},
new Color[]{Color.black,Color.black},
valores,
0,5, "dimensoesGeral",300);
0,5, "dimensoesGeral",300,40);
report.setDimensoesGeralChartAndTable(new ChartWithDataTable("Dimensões Geral", "", path, tabelaDimensoesGeral));
} catch (IOException e)
{
406,6 → 406,7
headerDefinition.addColTextCenter("Código Inv");
headerDefinition.addColTextCenter("Curso Inv").setWidth("20%");
headerDefinition.addColTextCenter("Código Curso Inv");
headerDefinition.addColTextCenter("Respostas Inv");
headerDefinition.addColTextCenter("Média Inv");
headerDefinition.addColTextCenter("Desvio Inv");
headerDefinition.addColTextCenter("Média Curso Inv");
417,10 → 418,8
 
DataTable.Row header = table.addRowHeader();
 
header.addColTextCenter("Unidade");
header.addColTextCenter("Código");
header.addColTextCenter("Curso");
header.addColTextCenter("Código Curso");
 
header.addColInvisible().setColspan(5);
DataTable.Row.Col colgrupo1 = header.addColTextCenter(grupo1Label);
DataTable.Row.Col colgrupo2 = header.addColTextCenter(grupo2Label);
colgrupo1.setColspan(4);
430,7 → 429,11
colgrupo2.setBackgroundColor(ChartBuilderUtil.getRgbXslColor(barColors[1]));
 
DataTable.Row header2 = table.addRowHeader();
header2.addColTextCenter("Médias").setColspan(4);
header2.addColTextCenter("Unidade");
header2.addColTextCenter("Código");
header2.addColTextCenter("Curso");
header2.addColTextCenter("Código Curso");
header2.addColTextCenter("Resps");
header2.addColTextCenter("Média").setBackgroundColor(colgrupo1.getBackgroundColor());
header2.addColTextCenter("Desvio").setBackgroundColor(colgrupo1.getBackgroundColor());
header2.addColTextCenter("Média Curso").setBackgroundColor(colgrupo1.getBackgroundColor());
467,6 → 470,7
rowUnit.addColTextCenter(unidadeStats.getCodigoUnidade());
rowUnit.addColTextCenter(unidadeStats.getNomeCurso());
rowUnit.addColTextCenter(unidadeStats.getCodigoCurso());
rowUnit.addColNumberRight("" + unidadeStats.getRespostas());
 
rowUnit.addColPercentageDefinedCenter(df.format(unidadeStatsGrupo1.getMediasGrupo().getAvaliacaoMedia()), unidadeStatsGrupo1.getMediasGrupo().getPercentAvaliacaoMediaForTables(), true);
rowUnit.addColNumberRight(df.format(unidadeStatsGrupo1.getMediasGrupo().getDesvioPadrao()));
486,7 → 490,7
barColors,
labelsColors,
valores,
0,5, tmpPathPrefix + "unidadesConjuntas",400);
0,5, tmpPathPrefix + "unidadesConjuntas",400,40);
return path;
}
 
/branches/v3/impl/src/java/pt/estgp/estgweb/services/questionarios/pedagogico/CursoPublicReport.java
1,5 → 1,6
package pt.estgp.estgweb.services.questionarios.pedagogico;
 
import pt.estgp.estgweb.services.questionarios.utils.ChartWithDataTable;
import pt.estgp.estgweb.services.questionarios.utils.CursoStats;
import pt.estgp.estgweb.services.questionarios.utils.DataTable;
 
15,7 → 16,35
String pathDistribuicaoRespostasSemanalChart;
DataTable tabelaEvolucaoRespostas;
 
ChartWithDataTable analiseConjuntaChartWithTable;
String analiseConjuntaChartOrderMediaUnidades;
String analiseConjuntaChartOrderMediaSalas;
 
 
public String getAnaliseConjuntaChartOrderMediaUnidades() {
return analiseConjuntaChartOrderMediaUnidades;
}
 
public void setAnaliseConjuntaChartOrderMediaUnidades(String analiseConjuntaChartOrderMediaUnidades) {
this.analiseConjuntaChartOrderMediaUnidades = analiseConjuntaChartOrderMediaUnidades;
}
 
public String getAnaliseConjuntaChartOrderMediaSalas() {
return analiseConjuntaChartOrderMediaSalas;
}
 
public void setAnaliseConjuntaChartOrderMediaSalas(String analiseConjuntaChartOrderMediaSalas) {
this.analiseConjuntaChartOrderMediaSalas = analiseConjuntaChartOrderMediaSalas;
}
 
public ChartWithDataTable getAnaliseConjuntaChartWithTable() {
return analiseConjuntaChartWithTable;
}
 
public void setAnaliseConjuntaChartWithTable(ChartWithDataTable analiseConjuntaChartWithTable) {
this.analiseConjuntaChartWithTable = analiseConjuntaChartWithTable;
}
 
public DataTable getTabelaEvolucaoRespostas() {
return tabelaEvolucaoRespostas;
}
43,4 → 72,6
 
 
 
 
 
}
/branches/v3/impl/src/java/pt/estgp/estgweb/services/questionarios/pedagogico/CursoPublicReportGenerator.java
8,23 → 8,20
import pt.estgp.estgweb.Globals;
import pt.estgp.estgweb.domain.Course;
import pt.estgp.estgweb.domain.dao.DaoFactory;
import pt.estgp.estgweb.services.questionarios.pedagogico.queries.AlunosQueryDao;
import pt.estgp.estgweb.services.questionarios.pedagogico.queries.QueryDaoUtils;
import pt.estgp.estgweb.services.questionarios.pedagogico.queries.QuestionariosQueryDao;
import pt.estgp.estgweb.services.questionarios.pedagogico.queries.UnidadesQueryDao;
import pt.estgp.estgweb.services.questionarios.utils.ChartBuilderUtil;
import pt.estgp.estgweb.services.questionarios.utils.DataTable;
import pt.estgp.estgweb.services.questionarios.utils.ReportUtils;
import pt.estgp.estgweb.services.questionarios.pedagogico.queries.*;
import pt.estgp.estgweb.services.questionarios.utils.*;
import pt.estgp.estgweb.utils.ConfigProperties;
import pt.estgp.estgweb.utils.DatesUtils;
import pt.estgp.estgweb.utils.Dom4jUtil;
 
import javax.xml.transform.TransformerException;
import javax.xml.transform.dom.DOMSource;
import java.awt.*;
import java.io.FileOutputStream;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.List;
 
/**
* Created by jorgemachado on 16/12/16.
43,7 → 40,7
String courseCode = "9119";
String anoLectivo = "201516";
String[] periodos = new String[]{"S2","T3","T4","A"};
String[] degrees = new String[]{"L","M","T"};
String[] degrees = new String[]{"L","M","T","E"};
new CursoPublicReportGenerator(anoLectivo,periodos,degrees,courseCode).processCourse();
 
}
76,7 → 73,8
}
 
private void generatePdfReport(CursoPublicReport cursoReport) throws DocumentException, TransformerException, IOException, FOPException {
String path = "/Volumes/Home/jorgemachado/Desktop/reportCurso" + cursoReport.getCursoStats().getCodigoCurso() + ".pdf";
String startPath ="/Volumes/Home/jorgemachado/Desktop/reportCurso" + cursoReport.getCursoStats().getCodigoCurso();
String path = startPath + ".pdf";
 
FileOutputStream out = new FileOutputStream(path);
Map<String,Object> params = new HashMap<String,Object>();
86,6 → 84,7
 
org.w3c.dom.Document dom2 = cursoReport.serialize();
Dom4jUtil.writeSout(dom2);
Dom4jUtil.write(dom2,new java.io.File(startPath + ".xml"));
 
PdfUtils.setAuthority("Relatório de Avaliação Pedagógica - Relatório Público de Curso - " +
cursoReport.getCursoStats().getNomeCurso() + " (" + cursoReport.getCursoStats().getCodigoCurso() + " ) " +
149,92 → 148,92
cursoReport.setTabelaEvolucaoRespostas(tableEvolucaoRespostas);
 
 
//Os cursos na Escola são todos os cursos, na pratica nao serve para nada porque
//A media de todos os cursos na escola é a media da escola considerando a restricao de graus e periodos
//media nas Escolas por pergunta e media nos Cursos por pergunta é igual
//A media da entidade neste caso é a do curso
List<String> codigosTodosCursosDaEscola = QueryDaoUtils.getCodigosCursosEscola(cursoReport.getCursoStats().getCodigoInstituicao(),anoLectivo, periodos, degrees);
 
//List<String> codigosEscola = QueryDaoUtils.getCodigosEscolaDocente(teacherCode, anoLectivo, periodos, degrees);
List<String> codigosEscola = new ArrayList<String>();
codigosEscola.add(cursoReport.getCursoStats().getCodigoInstituicao());
 
/*
docenteReport.setDocentesNosCursos((int) QueryDaoUtils.countDocentesNosCursos(codigosCurso, anoLectivo, periodos, degrees));
docenteReport.setDocentesNasEscolas((int) QueryDaoUtils.countDocentesNasEscolas(codigosEscola, anoLectivo, periodos, degrees));
 
docenteReport.setUnidadesNosCursos((int) QueryDaoUtils.countUnidadesNosCursos(codigosCurso, anoLectivo, periodos, degrees));
docenteReport.setUnidadesNasEscolas((int) QueryDaoUtils.countUnidadesNasEscolas(codigosEscola, anoLectivo, periodos, degrees));
cursoReport.getCursoStats().setDocentesDoCurso((int) QueryDaoUtils.countDocentesNosCursos(courseCode, anoLectivo, periodos, degrees));
cursoReport.getCursoStats().setDocentesDaEscola((int) QueryDaoUtils.countDocentesNasEscolas(cursoReport.getCursoStats().getCodigoInstituicao(), anoLectivo, periodos, degrees));
 
//todo vai buscar às cadeiras temos de fazer override do metodo e puxa-lo para o QuestionarioAlunos
//ou nao porque o UnidadesDaEscola foi introduzido dentro do Curso ão se puxou para o QuestionarioAlunos
//o xsl vai ter de usar este caso o use
cursoReport.getCursoStats().setUnidadesDoCurso((int) QueryDaoUtils.countUnidadesNosCursos(courseCode, anoLectivo, periodos, degrees));
cursoReport.getCursoStats().setUnidadesDaEscola((int) QueryDaoUtils.countUnidadesNasEscolas(cursoReport.getCursoStats().getCodigoInstituicao(), anoLectivo, periodos, degrees));
 
criarGraficosRespostasAgregadas(teacherCode,
 
ReportGenerator.criarGraficosRespostasAgregadas(new String[]{courseCode},
EntityEvaluated.CURSO,
anoLectivo,
docenteReport,
codigosCurso,
cursoReport,
codigosTodosCursosDaEscola,
codigosEscola,
0,
docenteReport.getRespostasAgregadasGrupoDocente().getRespostasAgregadasChartTable(),
docenteReport.getRespostasAgregadasGrupoDocente(),
PerguntasGrupoQueryDao.GRUPO_DOCENTE_CODE_PERGUNTAS,null,
periodos,degrees,true);
cursoReport.getCursoStats().getRespostasAgregadasGrupoUnidade().getRespostasAgregadasChartTable(),
cursoReport.getCursoStats().getRespostasAgregadasGrupoUnidade(),
PerguntasGrupoQueryDao.GRUPO_UNIDADE_CODE_PERGUNTAS, null,
periodos, degrees, true);
 
 
criarGraficosRespostasAgregadas(teacherCode,
ReportGenerator.criarGraficosRespostasAgregadas(new String[]{courseCode},
EntityEvaluated.CURSO,
anoLectivo,
docenteReport,
codigosCurso,
cursoReport,
codigosTodosCursosDaEscola,
codigosEscola,
2000,
docenteReport.getRespostasAgregadasGrupoDocente().getRespostasAgregadasChartTable2Secs(),
docenteReport.getRespostasAgregadasGrupoDocente(),
PerguntasGrupoQueryDao.GRUPO_DOCENTE_CODE_PERGUNTAS,null,
periodos,degrees,false);
cursoReport.getCursoStats().getRespostasAgregadasGrupoUnidade().getRespostasAgregadasChartTable2Secs(),
cursoReport.getCursoStats().getRespostasAgregadasGrupoUnidade(),
PerguntasGrupoQueryDao.GRUPO_UNIDADE_CODE_PERGUNTAS, null,
periodos, degrees, false);
 
criarGraficosRespostasAgregadas(teacherCode,
 
ReportGenerator.criarGraficosRespostasAgregadas(new String[]{courseCode},
EntityEvaluated.CURSO,
anoLectivo,
docenteReport,
codigosCurso,
cursoReport,
codigosTodosCursosDaEscola,
codigosEscola,
0,
docenteReport.getRespostasAgregadasGrupoUnidade().getRespostasAgregadasChartTable(),
docenteReport.getRespostasAgregadasGrupoUnidade(),
PerguntasGrupoQueryDao.GRUPO_UNIDADE_CODE_PERGUNTAS,null,
periodos,degrees,true);
cursoReport.getCursoStats().getRespostasAgregadasGrupoSalas().getRespostasAgregadasChartTable(),
cursoReport.getCursoStats().getRespostasAgregadasGrupoSalas(),
PerguntasGrupoQueryDao.GRUPO_SALAS_CODE_PERGUNTAS, null,
periodos, degrees, true);
 
criarGraficosRespostasAgregadas(teacherCode,
ReportGenerator.criarGraficosRespostasAgregadas(new String[]{courseCode},
EntityEvaluated.CURSO,
anoLectivo,
docenteReport,
codigosCurso,
cursoReport,
codigosTodosCursosDaEscola,
codigosEscola,
2000,
docenteReport.getRespostasAgregadasGrupoUnidade().getRespostasAgregadasChartTable2Secs(),
docenteReport.getRespostasAgregadasGrupoUnidade(),
PerguntasGrupoQueryDao.GRUPO_UNIDADE_CODE_PERGUNTAS,null,
periodos,degrees,false);
cursoReport.getCursoStats().getRespostasAgregadasGrupoSalas().getRespostasAgregadasChartTable2Secs(),
cursoReport.getCursoStats().getRespostasAgregadasGrupoSalas(),
PerguntasGrupoQueryDao.GRUPO_SALAS_CODE_PERGUNTAS, null,
periodos, degrees, false);
 
criarGraficosRespostasAgregadas(teacherCode,
anoLectivo,
docenteReport,
codigosCurso,
codigosEscola,
0,
docenteReport.getRespostasAgregadasGrupoDrelDocenteAluno().getRespostasAgregadasChartTable(),
docenteReport.getRespostasAgregadasGrupoDrelDocenteAluno(),
PerguntasGrupoQueryDao.GRUPO_DOCENTE_CODE_PERGUNTAS,
PerguntasGrupoQueryDao.GRUPO_DOCENTE_REL_ALUNO_CODE_PERGUNTAS,periodos,degrees,true);
 
criarGraficosRespostasAgregadas(teacherCode,
 
UnidadesQueryDao.criarTabelasCadeirasCurso(courseCode,
anoLectivo,
docenteReport,
codigosCurso,
codigosEscola,
0,
docenteReport.getRespostasAgregadasGrupoDdocenteProf().getRespostasAgregadasChartTable(),
docenteReport.getRespostasAgregadasGrupoDdocenteProf(),
PerguntasGrupoQueryDao.GRUPO_DOCENTE_CODE_PERGUNTAS,
PerguntasGrupoQueryDao.GRUPO_DOCENTE_PROFISSIONALISMO_DOCENTE_CODE_PERGUNTAS,periodos,degrees,true);
cursoReport,
0, periodos, degrees,cursoReport.getCursoStats().getUnidadesStats());
 
ChartWithDataTable analiseConjuntaChartWithTable = criarAnaliseConjuntaDeUnidades(cursoReport.getCursoStats().getUnidadesStats());
cursoReport.setAnaliseConjuntaChartWithTable(analiseConjuntaChartWithTable);
 
String pathOrdenadaMediaUnidades = criarAnaliseConjuntaDeUnidadesOrdenadaMediaUnidades(cursoReport.getCursoStats().getUnidadesStats());
cursoReport.setAnaliseConjuntaChartOrderMediaUnidades(pathOrdenadaMediaUnidades);
 
UnidadesQueryDao.criarTabelasCadeiras(teacherCode,
anoLectivo,
docenteReport,
0, periodos, degrees);
 
 
String pathOrdenadaMediaSalas = criarAnaliseConjuntaDeUnidadesOrdenadaMediaSalas(cursoReport.getCursoStats().getUnidadesStats());
cursoReport.setAnaliseConjuntaChartOrderMediaSalas(pathOrdenadaMediaSalas);
/*
criaExtremeCharts(docenteReport);
 
criarProgressoesCharts(docenteReport,codigosCurso,codigosEscola,degrees,periodos);
254,8 → 253,119
return cursoReport;
}
 
private ChartWithDataTable criarAnaliseConjuntaDeUnidades(List<UnidadeStats> unidadesStats)
{
DataTable tabelaDocenteUnidade = new DataTable();
try {
 
Collections.sort(unidadesStats, new Comparator<UnidadeStats>() {
@Override
public int compare(UnidadeStats o1, UnidadeStats o2) {
return o1.getNomeUnidade().compareTo(o2.getNomeUnidade());
}
});
String unidadeSalasPath = criarChartETabelaMediaGruposPorUnidade(500,30, unidadesStats,
PerguntasGrupoQueryDao.GRUPO_UNIDADE_CODE_PERGUNTAS,
null,
PerguntasGrupoQueryDao.GRUPO_SALAS_CODE_PERGUNTAS,
null,
tabelaDocenteUnidade,
"unidadeSalas",
new Color[]{ChartBuilderUtil.COLOR_SECTION_GREEN_DARK,ChartBuilderUtil.COLOR_SECTION_ROSE_DARK},
new Color[]{Color.black,Color.black}
);
 
return
new ChartWithDataTable(
"Analise Conjunta de Unidades",
"Unidade VS Instalações/Equipamentos/Outros Recursos",
unidadeSalasPath,
tabelaDocenteUnidade);
 
} catch (IOException e) {
logger.error(e,e);
}
return null;
 
}
 
private String criarAnaliseConjuntaDeUnidadesOrdenadaMediaUnidades(List<UnidadeStats> unidadesStats)
{
try {
 
Collections.sort(unidadesStats,new Comparator<UnidadeStats>() {
@Override
public int compare(UnidadeStats o1, UnidadeStats o2) {
 
double sub = (o2.getUnidadeStatsGrupoUnidade().getMediasGrupo().getAvaliacaoMedia()
-
o1.getUnidadeStatsGrupoUnidade().getMediasGrupo().getAvaliacaoMedia());
if(sub > 0.0)
return 1;
else if (sub < 0.0)
return -1;
return 0;
}
});
String unidadeSalasPath = criarChartETabelaMediaGruposPorUnidade(500,30, unidadesStats,
PerguntasGrupoQueryDao.GRUPO_UNIDADE_CODE_PERGUNTAS,
null,
PerguntasGrupoQueryDao.GRUPO_SALAS_CODE_PERGUNTAS,
null,
null,
"unidadeSalasOrderMediaUnidades",
new Color[]{ChartBuilderUtil.COLOR_SECTION_GREEN_DARK,ChartBuilderUtil.COLOR_SECTION_ROSE_DARK},
new Color[]{Color.black,Color.black}
);
 
return unidadeSalasPath;
 
} catch (IOException e) {
logger.error(e,e);
}
return null;
 
}
 
private String criarAnaliseConjuntaDeUnidadesOrdenadaMediaSalas(List<UnidadeStats> unidadesStats)
{
try {
 
Collections.sort(unidadesStats,new Comparator<UnidadeStats>() {
@Override
public int compare(UnidadeStats o1, UnidadeStats o2) {
 
double sub = (o2.getUnidadeStatsGrupoSalas().getMediasGrupo().getAvaliacaoMedia()
-
o1.getUnidadeStatsGrupoSalas().getMediasGrupo().getAvaliacaoMedia());
if(sub > 0.0)
return 1;
else if (sub < 0.0)
return -1;
return 0;
}
});
String unidadeSalasPath = criarChartETabelaMediaGruposPorUnidade(500,30, unidadesStats,
PerguntasGrupoQueryDao.GRUPO_UNIDADE_CODE_PERGUNTAS,
null,
PerguntasGrupoQueryDao.GRUPO_SALAS_CODE_PERGUNTAS,
null,
null,
"unidadeSalasOrderMediaSalas",
new Color[]{ChartBuilderUtil.COLOR_SECTION_GREEN_DARK,ChartBuilderUtil.COLOR_SECTION_ROSE_DARK},
new Color[]{Color.black,Color.black}
);
 
return unidadeSalasPath;
 
} catch (IOException e) {
logger.error(e,e);
}
return null;
 
}
 
 
/**
*
* @param semanaContagemCurso List<[count,Week,Year]>
292,9 → 402,9
Calendar calendar = Calendar.getInstance();
calendar.clear();
 
calendar.add( Calendar.YEAR, ano );
calendar.add( Calendar.WEEK_OF_YEAR, semana );
calendar.add( Calendar.DAY_OF_WEEK, 7 );
calendar.set(Calendar.YEAR, ano);
calendar.set(Calendar.WEEK_OF_YEAR, semana);
calendar.set(Calendar.DAY_OF_WEEK, 7);
String dataFinalDaSemana = dateFormat.format(calendar.getTime());
 
DataTable.Row rowSemana = tableEvolucaoRespostas.addRowNormal();
/branches/v3/impl/src/java/pt/estgp/estgweb/services/questionarios/pedagogico/queries/PerguntasGrupoQueryDao.java
5,6 → 5,8
import pt.estgp.estgweb.domain.OlapStarFactQuestionarioAnswer;
import pt.estgp.estgweb.services.questionarios.PedagogicoAlunosProcessor;
import pt.estgp.estgweb.services.questionarios.pedagogico.DocenteReport;
import pt.estgp.estgweb.services.questionarios.pedagogico.EntityEvaluated;
import pt.estgp.estgweb.services.questionarios.pedagogico.QuestionariosAlunosReport;
import pt.estgp.estgweb.services.questionarios.utils.ChartBuilderUtil;
import pt.estgp.estgweb.services.questionarios.utils.DataTable;
import pt.estgp.estgweb.services.questionarios.utils.MediasGrupo;
24,7 → 26,144
public static final String GRUPO_DOCENTE_REL_ALUNO_CODE_PERGUNTAS = "D_RelAluno";
public static final String GRUPO_DOCENTE_PROFISSIONALISMO_DOCENTE_CODE_PERGUNTAS = "D_ProfissRigorDocente";
 
public static final String GRUPO_SALAS_CODE_PERGUNTAS = "Salas";
public static final String GRUPO_ESTAGIO_CODE_PERGUNTAS = "EstagioProj";
public static final String GRUPO_ENSINO_CLINICO_CODE_PERGUNTAS = "PraEnsinoCliPraEnsinoSupervisionado";
 
 
public static void getMediasGrupo(String[] codes,
EntityEvaluated entityEvaluated,
String anoLectivo,
QuestionariosAlunosReport report,
List<String> codigosCurso,
List<String> codigosEscola,
String grupo,
String subGrupo,
MediasGrupo medias,
String[] periodos,
String[] degrees
)
{
Query query;
 
String periodosQuery = QueryDaoUtils.createPeriodosQuery(periodos, "quest", true);
String degreesQuery = QueryDaoUtils.createDegreesQuery(degrees, "curso", true);
String whereFragmentEntity = QuestionariosQueryDao.getWhereEntityCodesFragment(codes,entityEvaluated);
 
query = AbstractDao.getCurrentSession().createQuery("" +
"SELECT " +
"avg(fc.intResposta) as media," +
"std(fc.intResposta) as desvio," +
"count(fc.id) as total " +
 
"FROM " + OlapStarFactQuestionarioAnswer.class.getName() + " fc " +
"JOIN fc.olapTipologia tipo " +
"JOIN fc.olapQuestionario quest " +
"JOIN fc.olapPergunta prgp " +
"JOIN fc.olapCurso curso " +
"JOIN fc.olapTimeLine timeLine " +
 
"where " +
" quest.ano = :ano " +
whereFragmentEntity +
"and timeLine.nome = '" + PedagogicoAlunosProcessor.getHistoryDriveConstraintStatic() + "' " +
periodosQuery +
degreesQuery +
(grupo == null ? "" : " and prgp.grupoCode = :grupoCode ") +
(subGrupo == null ? "" : " and prgp.subGrupoCode = :subGrupoCode ")
);
if(grupo != null)
query.setString("grupoCode",grupo);
if(subGrupo != null)
query.setString("subGrupoCode",subGrupo);
//query.setString("codigoSiges",teacherCode);
query.setString("ano",anoLectivo);
 
DataTable mediasGlobaisTable = new DataTable();
 
 
DataTable.Row header = mediasGlobaisTable.addRowHeader();
header.addColTextCenter("Resps.");
header.addColTextCenter("Média");
header.addColTextCenter("Desvio Padrão");
header.addColTextCenter("95% Resps no intervalo");
if(entityEvaluated == EntityEvaluated.DOCENTE)
{
header.addColTextCenter("Média dos Cursos em que Lecciona");
header.addColTextCenter("Média das Escolas em que Lecciona");
}
else if(entityEvaluated == EntityEvaluated.CURSO)
{
header.addColTextCenter("Média da Escola");
}
else
{
throw new RuntimeException("Não implementado");
}
 
 
 
Object[] result = (Object[]) query.uniqueResult();
 
 
Double mediaGrupo = (Double) result[0];
Double desvio = (Double) result[1];
long total = report.getInquiridosComResposta();
double min = mediaGrupo - (desvio*2);
double max = mediaGrupo + (desvio*2);
if(max > 5) max = 5;
DecimalFormat df = new DecimalFormat("#.##");
DecimalFormat df2 = new DecimalFormat("#.#");
 
DataTable.Row row = mediasGlobaisTable.addRowNormal();
row.addColTextCenter(""+total);
row.addColPercentageDefinedCenter(df.format(mediaGrupo),"" + ((int)((mediaGrupo/5.0)*100.0)), true);
row.addColTextCenter(df.format(desvio));
row.addColTextCenter("[" + df2.format(min) + "<->" + df2.format(max) + "]");
 
 
double mediaCursos = QueryDaoUtils.getMediaCursos(codigosCurso, anoLectivo, grupo, subGrupo, periodos, degrees);
double mediaEscolas = QueryDaoUtils.getMediaEscolas(codigosEscola, anoLectivo, grupo,subGrupo, periodos, degrees);
 
 
if(entityEvaluated == EntityEvaluated.DOCENTE)
{
row.addColPercentageDefinedCenter(df.format(mediaCursos), "" + ((int) ((mediaCursos / 5.0) * 100.0)), true);
}
else if(entityEvaluated == EntityEvaluated.CURSO)
{
 
}
else
{
throw new RuntimeException("Não implementado");
}
 
row.addColPercentageDefinedCenter(df.format(mediaEscolas),"" + ((int)((mediaEscolas/5.0)*100.0)),true);
 
 
 
medias.setAvaliacaoMediaArredondada((int) ReportUtils.round(mediaGrupo, 0));
medias.setAvaliacaoMedia(mediaGrupo);
medias.setDesvioPadrao(desvio);
medias.setMediaGlobalNasEscolas(mediaEscolas);
medias.setMediaGlobalNosCursos(mediaCursos);
medias.setTotal((int) total);
 
medias.setMediasGlobaisTable(mediasGlobaisTable);
 
if(medias.getAvaliacaoMediaArredondada() == 1)
medias.setColorMedia(ChartBuilderUtil.COLOR_1_HEX);
else if(medias.getAvaliacaoMediaArredondada() == 2)
medias.setColorMedia(ChartBuilderUtil.COLOR_2_HEX);
else if(medias.getAvaliacaoMediaArredondada() == 3)
medias.setColorMedia(ChartBuilderUtil.COLOR_3_HEX);
else if(medias.getAvaliacaoMediaArredondada() == 4)
medias.setColorMedia(ChartBuilderUtil.COLOR_4_HEX);
else if(medias.getAvaliacaoMediaArredondada() == 5)
medias.setColorMedia(ChartBuilderUtil.COLOR_5_HEX);
}
 
public static void getMediasGrupo(String teacherCode,
String anoLectivo,
DocenteReport docenteReport,
131,7 → 270,7
medias.setColorMedia(ChartBuilderUtil.COLOR_5_HEX);
}
 
public static MediaGlobalCursoPergunta getMediaCursoPergunta(DocenteReport report,String codigoCurso, String anoLectivo, String numeroPergunta,String[] periodos)
public static MediaGlobalCursoPergunta getMediaCursoPergunta(QuestionariosAlunosReport report,String codigoCurso, String anoLectivo, String numeroPergunta,String[] periodos)
{
 
String key = codigoCurso + "-" + anoLectivo + "-" + numeroPergunta;
199,7 → 338,7
return mediaGlobalCursoPergunta;
}
 
public static MediaGlobalCursoGrupo getMediaCursoGrupo(DocenteReport report,String codigoCurso, String anoLectivo, String grupo,String subGrupo,
public static MediaGlobalCursoGrupo getMediaCursoGrupo(QuestionariosAlunosReport report,String codigoCurso, String anoLectivo, String grupo,String subGrupo,
String[] periodos)
{
 
267,7 → 406,7
 
return mediaGlobalCursoGrupo;
}
public static MediaGlobalEscolaPergunta getMediaEscolaPergunta(DocenteReport report,String codigoEscola, String anoLectivo, String numeroPergunta,
public static MediaGlobalEscolaPergunta getMediaEscolaPergunta(QuestionariosAlunosReport report,String codigoEscola, String anoLectivo, String numeroPergunta,
String[] periodos ,String[] degrees)
{
String key = codigoEscola + "-" + anoLectivo + "-" + numeroPergunta;
333,7 → 472,7
return mediaGlobalEscolaPergunta;
}
 
public static MediaGlobalEscolaGrupo getMediaEscolaGrupo(DocenteReport report,String codigoEscola, String anoLectivo, String grupo,String subGrupo,
public static MediaGlobalEscolaGrupo getMediaEscolaGrupo(QuestionariosAlunosReport report,String codigoEscola, String anoLectivo, String grupo,String subGrupo,
String[] periodos ,String[] degrees)
{
String key = codigoEscola + "-" + anoLectivo + "-" + (grupo == null ? "_" : grupo) + "-" + (subGrupo == null ? "_" : subGrupo);
/branches/v3/impl/src/java/pt/estgp/estgweb/services/questionarios/pedagogico/queries/QuestionariosQueryDao.java
17,7 → 17,7
public class QuestionariosQueryDao
{
 
protected static String getWhereEntityCodesFragment(String[] codes, EntityEvaluated entityEvaluated) {
public static String getWhereEntityCodesFragment(String[] codes, EntityEvaluated entityEvaluated) {
String whereFragmentEntity = "" ;
if(entityEvaluated == EntityEvaluated.DOCENTE)
{
/branches/v3/impl/src/java/pt/estgp/estgweb/services/questionarios/pedagogico/queries/UnidadesQueryDao.java
24,9 → 24,15
 
private static final Logger logger = Logger.getLogger(UnidadesQueryDao.class);
 
public static void getMediasCadeira(String teacherCode,
 
 
 
 
 
public static void getMediasCadeira(String[] codes,
EntityEvaluated entityEvaluated,
String anoLectivo,
DocenteReport docenteReport,
QuestionariosAlunosReport report,
String grupo,
String subGrupo,
MediasGrupo medias,
39,8 → 45,8
)
{
Query query;
String whereFragmentEntity = QuestionariosQueryDao.getWhereEntityCodesFragment(codes,entityEvaluated);
 
 
query = AbstractDao.getCurrentSession().createQuery("" +
"SELECT " +
"avg(fc.intResposta) as media," +
58,7 → 64,7
 
"where " +
" quest.ano = :ano " +
"and tipo.codigoSiges = :codigoSiges " +
whereFragmentEntity +
"and unit.codigo = :codigoUnidade " +
"and curso.codigoCurso = :codigoCurso " +
"and quest.semestre = :semestre " +
70,7 → 76,7
query.setString("grupoCode",grupo);
if(subGrupo != null)
query.setString("subGrupoCode",subGrupo);
query.setString("codigoSiges",teacherCode);
//query.setString("codigoSiges",teacherCode);
query.setString("ano",anoLectivo);
query.setString("semestre",semestre);
query.setString("codigoUnidade",codigoUnidade);
84,6 → 90,8
header.addColTextCenter("Média");
header.addColTextCenter("Desvio Padrão");
header.addColTextCenter("95% Resps no intervalo");
 
 
header.addColTextCenter("Curso");
header.addColTextCenter("Escola");
 
99,23 → 107,24
if(max > 5) max = 5;
DecimalFormat df = new DecimalFormat("#.##");
DecimalFormat df2 = new DecimalFormat("#.#");
DecimalFormat df4 = new DecimalFormat("#.####");
 
DataTable.Row row = mediasGlobaisTable.addRowNormal();
row.addColTextCenter(""+total);
row.addColPercentageDefinedCenter(df.format(mediaGrupo),"" + ((int)((mediaGrupo/5.0)*100.0)), true);
row.addColPercentageDefinedCenter(df4.format(mediaGrupo),"" + ((int)((mediaGrupo/5.0)*100.0)), true);
row.addColTextCenter(df.format(desvio));
row.addColTextCenter("[" + df2.format(min) + "<->" + df2.format(max) + "]");
 
 
 
PerguntasGrupoQueryDao.MediaGlobalEscolaGrupo mediaGlobalEscolaGrupo = PerguntasGrupoQueryDao.getMediaEscolaGrupo(docenteReport, codigoInstituicao, anoLectivo, grupo, subGrupo, periodos, degrees);
PerguntasGrupoQueryDao.MediaGlobalCursoGrupo mediaGlobalCursoGrupo = PerguntasGrupoQueryDao.getMediaCursoGrupo(docenteReport, codigoCurso, anoLectivo, grupo, subGrupo, periodos);
PerguntasGrupoQueryDao.MediaGlobalEscolaGrupo mediaGlobalEscolaGrupo = PerguntasGrupoQueryDao.getMediaEscolaGrupo(report, codigoInstituicao, anoLectivo, grupo, subGrupo, periodos, degrees);
PerguntasGrupoQueryDao.MediaGlobalCursoGrupo mediaGlobalCursoGrupo = PerguntasGrupoQueryDao.getMediaCursoGrupo(report, codigoCurso, anoLectivo, grupo, subGrupo, periodos);
medias.setAvaliacaoMediaArredondada((int) ReportUtils.round(mediaGrupo, 0));
medias.setAvaliacaoMedia(mediaGrupo);
medias.setDesvioPadrao(desvio);
medias.setMediasGlobaisTable(mediasGlobaisTable);
medias.setMediaGlobalNosCursos(mediaGlobalCursoGrupo.media);
medias.setMediaGlobalNasEscolas(mediaGlobalEscolaGrupo.media);
medias.setMediaGlobalNosCursos(mediaGlobalCursoGrupo.media);
medias.setTotal((int) total);
 
row.addColPercentageDefinedCenter(df.format(mediaGlobalCursoGrupo.media),"" + ((int)((mediaGlobalCursoGrupo.media/5.0)*100.0)), true);
134,23 → 143,40
medias.setColorMedia(ChartBuilderUtil.COLOR_5_HEX);
}
 
public static void criarTabelasCadeirasCurso(String courseCode, String anoLectivo, QuestionariosAlunosReport cursoReport, int tempoLevadoMinimo,
String[] periodos, String[] degrees,List<UnidadeStats> unidadeStatsList)
{
criarTabelasCadeiras(new String[]{courseCode},EntityEvaluated.CURSO,anoLectivo,cursoReport,tempoLevadoMinimo,
periodos,degrees,unidadeStatsList);
}
 
public static void criarTabelasCadeirasDocente(String teacherCode, String anoLectivo, QuestionariosAlunosReport docenteReport, int tempoLevadoMinimo,
String[] periodos, String[] degrees,List<UnidadeStats> unidadeStatsList)
{
criarTabelasCadeiras(new String[]{teacherCode},EntityEvaluated.DOCENTE,anoLectivo,docenteReport,tempoLevadoMinimo,
periodos,degrees,unidadeStatsList);
}
 
/**
* Metodo que inicia o processamento das unidades curriculares
* @param teacherCode
*
* @param codes
* @param entityEvaluated
* @param anoLectivo
* @param docenteReport
* @param report
* @param tempoLevadoMinimo
* @param periodos
* @param degrees
*/
public static void criarTabelasCadeiras(String teacherCode, String anoLectivo, DocenteReport docenteReport, int tempoLevadoMinimo,
String[] periodos, String[] degrees)
 
public static void criarTabelasCadeiras(String[] codes,EntityEvaluated entityEvaluated, String anoLectivo, QuestionariosAlunosReport report, int tempoLevadoMinimo,
String[] periodos, String[] degrees,List<UnidadeStats> unidadeStatsList)
{
String periodosQuery = QueryDaoUtils.createPeriodosQuery(periodos, "quest", true);
String degreesQuery = QueryDaoUtils.createDegreesQuery(degrees, "curso", true);
String whereFragmentEntity = QuestionariosQueryDao.getWhereEntityCodesFragment(codes,entityEvaluated);
 
Query query = AbstractDao.getCurrentSession().createQuery(
"select unit.nome, " +
"select unit.nome, " +
"unit.codigo, " +
"quest.semestre, " +
"curso.codigoCurso, " +
172,12 → 198,12
"where " +
"quest.ano = :ano " +
"and timeLine.nome = '" + PedagogicoAlunosProcessor.getHistoryDriveConstraintStatic() + "' " +
"and tipo.codigoSiges = :codigoSiges " +
whereFragmentEntity +
periodosQuery +
degreesQuery +
" group by unit.codigo, quest.semestre, curso.codigoCurso");
 
query.setString("codigoSiges",teacherCode);
//query.setString("codigoSiges",teacherCode);
query.setString("ano",anoLectivo);
List<Object[]> cadeiras = query.list();
for(Object[] cadeira : cadeiras)
194,24 → 220,7
 
 
logger.info("Encontrada cadeira: " + nomeUnidade + " de " + nomeCurso + " (" + codigoUnidade + ";" + semestreUnidade + ";" + codigoCurso + ")");
UnidadeStats.UnidadeStatsGrupo dataDocente = criarTabelasRespostasCadeira(teacherCode,anoLectivo,docenteReport,tempoLevadoMinimo,
PerguntasGrupoQueryDao.GRUPO_DOCENTE_CODE_PERGUNTAS,null,
codigoUnidade,codigoCurso,semestreUnidade,codigoInstituicao,periodos,degrees);
 
UnidadeStats.UnidadeStatsGrupo dataUnidade = criarTabelasRespostasCadeira(teacherCode,anoLectivo,docenteReport,tempoLevadoMinimo,
PerguntasGrupoQueryDao.GRUPO_UNIDADE_CODE_PERGUNTAS,null,
codigoUnidade,codigoCurso,semestreUnidade,codigoInstituicao,periodos,degrees);
 
UnidadeStats.UnidadeStatsGrupo dataDrelDocenteAluno = criarTabelasRespostasCadeira(teacherCode,anoLectivo,docenteReport,tempoLevadoMinimo,
PerguntasGrupoQueryDao.GRUPO_DOCENTE_CODE_PERGUNTAS,
PerguntasGrupoQueryDao.GRUPO_DOCENTE_REL_ALUNO_CODE_PERGUNTAS,
codigoUnidade,codigoCurso,semestreUnidade,codigoInstituicao,periodos,degrees);
 
UnidadeStats.UnidadeStatsGrupo dataDdocenteProf = criarTabelasRespostasCadeira(teacherCode,anoLectivo,docenteReport,tempoLevadoMinimo,
PerguntasGrupoQueryDao.GRUPO_DOCENTE_CODE_PERGUNTAS,
PerguntasGrupoQueryDao.GRUPO_DOCENTE_PROFISSIONALISMO_DOCENTE_CODE_PERGUNTAS,
codigoUnidade,codigoCurso,semestreUnidade,codigoInstituicao,periodos,degrees);
 
UnidadeStats statsUnidade = new UnidadeStats();
statsUnidade.setNomeCurso(nomeCurso);
statsUnidade.setNomeUnidade(nomeUnidade);
223,42 → 232,103
statsUnidade.setInscritos(inscritos.intValue());
statsUnidade.setRespostas(respostas.intValue());
 
statsUnidade.setUnidadeStatsGrupoDocente(dataDocente);
statsUnidade.setUnidadeStatsGrupoUnidade(dataUnidade);
statsUnidade.setUnidadeStatsGrupoDrelDocenteAluno(dataDrelDocenteAluno);
statsUnidade.setUnidadeStatsGrupoDdocenteProf(dataDdocenteProf);
 
docenteReport.getUnidadesStats().add(statsUnidade);
if(entityEvaluated == EntityEvaluated.DOCENTE)
{
UnidadeStats.UnidadeStatsGrupo dataDocente = criarTabelasRespostasCadeira(codes,entityEvaluated,anoLectivo,report,tempoLevadoMinimo,
PerguntasGrupoQueryDao.GRUPO_DOCENTE_CODE_PERGUNTAS,null,
codigoUnidade,codigoCurso,semestreUnidade,codigoInstituicao,periodos,degrees);
 
UnidadeStats.UnidadeStatsGrupo dataUnidade = criarTabelasRespostasCadeira(codes,entityEvaluated,anoLectivo,report,tempoLevadoMinimo,
PerguntasGrupoQueryDao.GRUPO_UNIDADE_CODE_PERGUNTAS,null,
codigoUnidade,codigoCurso,semestreUnidade,codigoInstituicao,periodos,degrees);
 
UnidadeStats.UnidadeStatsGrupo dataDrelDocenteAluno = criarTabelasRespostasCadeira(codes,entityEvaluated,anoLectivo,report,tempoLevadoMinimo,
PerguntasGrupoQueryDao.GRUPO_DOCENTE_CODE_PERGUNTAS,
PerguntasGrupoQueryDao.GRUPO_DOCENTE_REL_ALUNO_CODE_PERGUNTAS,
codigoUnidade,codigoCurso,semestreUnidade,codigoInstituicao,periodos,degrees);
 
UnidadeStats.UnidadeStatsGrupo dataDdocenteProf = criarTabelasRespostasCadeira(codes,entityEvaluated,anoLectivo,report,tempoLevadoMinimo,
PerguntasGrupoQueryDao.GRUPO_DOCENTE_CODE_PERGUNTAS,
PerguntasGrupoQueryDao.GRUPO_DOCENTE_PROFISSIONALISMO_DOCENTE_CODE_PERGUNTAS,
codigoUnidade,codigoCurso,semestreUnidade,codigoInstituicao,periodos,degrees);
UnidadeStats.UnidadeStatsGrupo dataEstagio = criarTabelasRespostasCadeira(codes,entityEvaluated,anoLectivo,report,tempoLevadoMinimo,
PerguntasGrupoQueryDao.GRUPO_ESTAGIO_CODE_PERGUNTAS,null,
codigoUnidade,codigoCurso,semestreUnidade,codigoInstituicao,periodos,degrees);
 
UnidadeStats.UnidadeStatsGrupo dataEnsinoClinico = criarTabelasRespostasCadeira(codes,entityEvaluated,anoLectivo,report,tempoLevadoMinimo,
PerguntasGrupoQueryDao.GRUPO_ENSINO_CLINICO_CODE_PERGUNTAS,null,
codigoUnidade,codigoCurso,semestreUnidade,codigoInstituicao,periodos,degrees);
statsUnidade.setUnidadeStatsGrupoDocente(dataDocente);
statsUnidade.setUnidadeStatsGrupoUnidade(dataUnidade);
statsUnidade.setUnidadeStatsGrupoDrelDocenteAluno(dataDrelDocenteAluno);
statsUnidade.setUnidadeStatsGrupoDdocenteProf(dataDdocenteProf);
statsUnidade.setUnidadeStatsGrupoEstagio(dataEstagio);
statsUnidade.setUnidadeStatsGrupoPraticaEnsinoClinico(dataEnsinoClinico);
}else if(entityEvaluated == EntityEvaluated.CURSO)
{
UnidadeStats.UnidadeStatsGrupo dataSalas = criarTabelasRespostasCadeira(codes,entityEvaluated,anoLectivo,report,tempoLevadoMinimo,
PerguntasGrupoQueryDao.GRUPO_SALAS_CODE_PERGUNTAS,null,
codigoUnidade,codigoCurso,semestreUnidade,codigoInstituicao,periodos,degrees);
UnidadeStats.UnidadeStatsGrupo dataUnidade = criarTabelasRespostasCadeira(codes,entityEvaluated,anoLectivo,report,tempoLevadoMinimo,
PerguntasGrupoQueryDao.GRUPO_UNIDADE_CODE_PERGUNTAS,null,
codigoUnidade,codigoCurso,semestreUnidade,codigoInstituicao,periodos,degrees);
statsUnidade.setUnidadeStatsGrupoUnidade(dataUnidade);
statsUnidade.setUnidadeStatsGrupoSalas(dataSalas);
 
}else
{
throw new RuntimeException("Nao implementado");
}
 
unidadeStatsList.add(statsUnidade);
 
}
}
 
 
public static UnidadeStats.UnidadeStatsGrupo criarTabelasRespostasCadeira(String teacherCode,
String anoLectivo,
DocenteReport docenteReport,
double tempoMinimo,
String grupo,
String subGrupo,
String codigoUnidade,
String codigoCurso,
String semestre,
String codigoInstituicao,
String[] periodos,
String[] degrees)
{
return criarTabelasRespostasCadeira(new String[]{teacherCode},EntityEvaluated.DOCENTE, anoLectivo,
docenteReport,tempoMinimo,grupo,subGrupo,codigoUnidade,codigoCurso,semestre,codigoInstituicao,
periodos,degrees);
}
/**
* Gera um gráfico com todas as respostas agregadas por questao para um professor
*
* Gera as medias por pergunta em cada cadeira e as medias dos seu curso e
* da sua escola
* @param teacherCode
* @param codes
* @param entityEvaluated
* @param anoLectivo
* @param docenteReport
*/
public static UnidadeStats.UnidadeStatsGrupo criarTabelasRespostasCadeira(String teacherCode,
String anoLectivo,
DocenteReport docenteReport,
double tempoMinimo,
String grupo,
String subGrupo,
String codigoUnidade,
String codigoCurso,
String semestre,
String codigoInstituicao,
String[] periodos,
String[] degrees
 
) {
 
 
 
public static UnidadeStats.UnidadeStatsGrupo criarTabelasRespostasCadeira(
String[] codes,
EntityEvaluated entityEvaluated,
String anoLectivo,
QuestionariosAlunosReport docenteReport,
double tempoMinimo,
String grupo,
String subGrupo,
String codigoUnidade,
String codigoCurso,
String semestre,
String codigoInstituicao,
String[] periodos,
String[] degrees)
{
String whereFragmentEntity = QuestionariosQueryDao.getWhereEntityCodesFragment(codes, entityEvaluated);
UnidadeStats.UnidadeStatsGrupo unidadeData = new UnidadeStats.UnidadeStatsGrupo(grupo,subGrupo);
 
Query query;//*****CRIAR REPOSTAS DO GRUPO DOCENTE*****///
279,9 → 349,6
"prgp.numero as numero, " +
"avg(fc.tempoLevado) as tempoMedioLevado " +
 
 
 
 
"FROM " + OlapStarFactQuestionarioAnswer.class.getName() + " fc " +
"JOIN fc.olapPergunta prgp " +
"JOIN fc.olapTipologia tipo " +
291,9 → 358,8
"JOIN fc.olapTimeLine timeLine " +
 
"where " +
 
" quest.ano = :ano " +
"and tipo.codigoSiges = :codigoSiges " +
whereFragmentEntity +
"and unit.codigo = :codigoUnidade " +
"and curso.codigoCurso = :codigoCurso " +
"and quest.semestre = :semestre " +
307,7 → 373,7
query.setString("grupoCode",grupo);
if(subGrupo != null)
query.setString("subGrupoCode",subGrupo);
query.setString("codigoSiges",teacherCode);
//query.setString("codigoSiges",teacherCode);
query.setString("ano",anoLectivo);
query.setString("codigoUnidade",codigoUnidade);
query.setString("codigoCurso",codigoCurso);
323,7 → 389,7
 
unidadeData.setRespostasTable(tableRespostasAgregadas);
 
getMediasCadeira(teacherCode, anoLectivo, docenteReport, grupo,subGrupo, unidadeData.getMediasGrupo(), codigoUnidade, codigoCurso, codigoInstituicao,semestre,periodos,degrees);
getMediasCadeira(codes, entityEvaluated, anoLectivo, docenteReport, grupo, subGrupo, unidadeData.getMediasGrupo(), codigoUnidade, codigoCurso, codigoInstituicao, semestre, periodos, degrees);
 
 
DataTable.Row header = tableRespostasAgregadas.addRowHeader();
/branches/v3/impl/src/java/pt/estgp/estgweb/services/questionarios/pedagogico/queries/QueryDaoUtils.java
5,6 → 5,7
import pt.estgp.estgweb.domain.OlapStarFactQuestionarioAnswer;
import pt.estgp.estgweb.services.questionarios.PedagogicoAlunosProcessor;
 
import java.util.ArrayList;
import java.util.List;
 
/**
259,6 → 260,12
return codigosCurso;
}
 
public static long countDocentesNosCursos(String codigoCurso, String anoLectivo, String[] periodos, String[] degrees)
{
List<String> codigos = new ArrayList<String>();
codigos.add(codigoCurso);
return countDocentesNosCursos(codigos, anoLectivo, periodos, degrees);
}
public static long countDocentesNosCursos(List<String> codigosCurso, String anoLectivo, String[] periodos, String[] degrees) {
 
String periodosQuery = createPeriodosQuery(periodos, "quest", true);
305,6 → 312,11
return profs;
}
 
public static long countDocentesNasEscolas(String codigoEscola, String anoLectivo, String[] periodos, String[] degrees) {
List<String> codigos = new ArrayList<String>();
codigos.add(codigoEscola);
return countDocentesNasEscolas(codigos,anoLectivo,periodos,degrees);
}
public static long countDocentesNasEscolas(List<String> codigosEscola, String anoLectivo, String[] periodos, String[] degrees) {
 
String periodosQuery = createPeriodosQuery(periodos, "quest", true);
351,6 → 363,14
return profs;
}
 
public static long countUnidadesNosCursos(String codigoCurso,String anoLectivo, String[] periodos,String[] degrees)
{
List<String> codigos = new ArrayList<String>();
codigos.add(codigoCurso);
return countUnidadesNosCursos(codigos,anoLectivo,periodos,degrees);
}
 
 
public static long countUnidadesNosCursos(List<String> codigosCurso,String anoLectivo, String[] periodos,String[] degrees) {
 
String periodosQuery = createPeriodosQuery(periodos, "quest", true);
397,6 → 417,12
return unidades;
}
 
public static long countUnidadesNasEscolas(String codigoEscola, String anoLectivo, String[] periodos, String[] degrees)
{
List<String> codigosEscola = new ArrayList<String>();
codigosEscola.add(codigoEscola);
return countUnidadesNasEscolas( codigosEscola, anoLectivo, periodos, degrees) ;
}
public static long countUnidadesNasEscolas(List<String> codigosEscola, String anoLectivo, String[] periodos, String[] degrees) {
 
String periodosQuery = createPeriodosQuery(periodos, "quest", true);