/branches/v3/impl/src/java/pt/estgp/estgweb/services/questionarios/utils/DataTable.java |
---|
252,6 → 252,7 |
String type = null; |
boolean usePercentageColor = false; |
String backgroundColor = ""; |
String backgroundColorPercentage = ""; |
public String getBackgroundColor() { |
262,6 → 263,14 |
this.backgroundColor = backgroundColor; |
} |
public String getBackgroundColorPercentage() { |
return backgroundColorPercentage; |
} |
public void setBackgroundColorPercentage(String backgroundColorPercentage) { |
this.backgroundColorPercentage = backgroundColorPercentage; |
} |
public void setAlignLeft() { align = "left"; } |
public void setAlignRight() { align = "right"; } |
public void setAlignCenter() { align = "center"; } |
275,8 → 284,27 |
return usePercentageColor; |
} |
public void setUsePercentageColor(boolean usePercentageColor) { |
public void setUsePercentageColor(boolean usePercentageColor) |
{ |
this.usePercentageColor = usePercentageColor; |
//new Approach for percentage color using degrade |
if(usePercentageColor) |
{ |
double percentage = type.equals("percentageDefined") ? Double.parseDouble(percentDefined.replace(",",".")) : Double.parseDouble(value.replace(",",".")); |
percentage = percentage / 100.0; |
if(percentage < 0.5) |
{ |
int green = (int) (255.0*(percentage*2)); |
setBackgroundColorPercentage("rgb(255," + green + ",0)"); |
} |
else |
{ |
int red = (int) (255.0*((1.0-percentage)*2)); |
setBackgroundColorPercentage("rgb(" + red + ",255,0)"); |
} |
} |
} |
public String getValue() { return value; } |
286,7 → 314,11 |
return percentDefined; |
} |
public void setPercentDefined(String percentDefined) { |
public void setPercentDefined(String percentDefined) { |
if(percentDefined.contains(".")) |
this.percentDefined = percentDefined.substring(0,percentDefined.indexOf(".")); |
else if(percentDefined.contains(",")) |
this.percentDefined = percentDefined.substring(0,percentDefined.indexOf(",")); |
this.percentDefined = percentDefined; |
} |
} |
/branches/v3/impl/src/java/pt/estgp/estgweb/services/questionarios/utils/ChartBuilderUtil.java |
---|
570,6 → 570,11 |
return 100.0 * ((double)(parcela/(double)total)); |
} |
public static String getPercentagemPrint0Slots(double parcela, int total) |
{ |
double percent = getPercentagem(parcela,total); |
return "" + (int) percent; |
} |
public static String getPercentagemPrint2Slots(double parcela, int total) |
{ |
double percent = getPercentagem(parcela,total); |
587,4 → 592,81 |
return df1.format(percent); |
} |
public static void main(String[] args) throws IOException |
{ |
for(int i = 1; i < 100;i++) |
{ |
createChartRingOneDimension(i, 100, true, true,true,"ring" + i); |
} |
} |
public static void createChartRingOneDimension(double value, double max,boolean colorsPercent,boolean degrade,boolean putPercentInCenter, String pathTemplate) throws IOException { |
DefaultPieDataset data = new DefaultPieDataset(); |
Number n; |
data.setValue("A", value); |
data.setValue("B", max-value); |
JFreeChart chart = ChartFactory.createRingChart(null, data, false, false, false); |
chart.setBackgroundPaint(new Color(255,255,255)); |
RingPlot plot = (RingPlot) chart.getPlot(); |
//plot.setLabelBackgroundPaint(new Color(255, 249, 235)); |
//plot.setLabelPaint(new Color(88, 88, 90)); |
plot.setLabelGenerator(null); |
plot.setDrawingSupplier(new ChartDrawingSupplier()); |
//CategoryItemRenderer render = chart.getCategoryPlot().getRenderer(); |
//render.setSeriesPaint(0,new Color(255,201,92)); |
plot.setBackgroundPaint(new Color(255, 255, 255)); |
plot.setOutlineVisible(false); |
if(degrade) |
{ |
double percent = (value/max); |
if(percent < 0.5) |
{ |
plot.setSectionPaint("A", new Color(255, (int) (255.0*(percent*2)), 0)); |
} |
else |
{ |
plot.setSectionPaint("A", new Color((int) (255.0*((1.0-percent)*2)), 255, 0)); |
} |
} |
else if(colorsPercent) |
{ |
double fraction = max / 5.0; |
if(value < fraction) |
plot.setSectionPaint("A", COLOR_1); |
else if(value < fraction*2) |
plot.setSectionPaint("A", COLOR_2); |
else if(value < fraction*3) |
plot.setSectionPaint("A", COLOR_3); |
else if(value < fraction*4) |
plot.setSectionPaint("A", COLOR_4); |
else |
plot.setSectionPaint("A", COLOR_5); |
} |
else |
plot.setSectionPaint("A", new Color(113, 154, 181)); |
plot.setSectionPaint("B", new Color(100, 100, 100)); |
plot.setCenterTextMode(CenterTextMode.FIXED); |
plot.setCenterText("" + df1.format(value) + (putPercentInCenter?" %":"")); |
plot.setCenterTextColor(Color.black); |
plot.setCenterTextFont(new Font(Font.SANS_SERIF, Font.BOLD, 40)); |
BufferedImage image = chart.createBufferedImage( 300, 300); |
String pathGraficoTiposAlunos = Globals.TMP_DIR + File.separator + pathTemplate + "graficoContribuicaoUnidades.png"; |
ImageIO.write(image, "png", new FileOutputStream(pathGraficoTiposAlunos)); |
} |
} |
/branches/v3/impl/src/java/pt/estgp/estgweb/services/questionarios/utils/ChartTable.java |
---|
2,7 → 2,6 |
import java.io.Serializable; |
import java.util.ArrayList; |
import java.util.List; |
/** |
* Created by jorgemachado on 07/12/16. |
13,7 → 12,7 |
ArrayList<ChartsRow> chartsRow = new ArrayList<ChartsRow>(); |
public List<PerguntaStats> generateCompleteListPerguntas() |
/*public List<PerguntaStats> generateCompleteListPerguntas() |
{ |
List<PerguntaStats> perguntas = new ArrayList<PerguntaStats>(); |
for(ChartsRow row: chartsRow) |
22,7 → 21,7 |
perguntas.add(p); |
} |
return perguntas; |
} |
}*/ |
public void addChart(PerguntaStats chart) |
{ |
/branches/v3/impl/src/java/pt/estgp/estgweb/services/questionarios/pedagogico/QuestionariosReport.java |
---|
69,44 → 69,63 |
//MEDIAS GLOBAIS |
//Preenchidas no UnidadeQueryDao |
HashMap<String,PerguntasGrupoQueryDao.MediaGlobalCursoPergunta> mediasCursoPergunta = new HashMap<String, PerguntasGrupoQueryDao.MediaGlobalCursoPergunta>(); |
HashMap<String,PerguntasGrupoQueryDao.MediaGlobalEscolaPergunta> mediasEscolaPergunta = new HashMap<String, PerguntasGrupoQueryDao.MediaGlobalEscolaPergunta>(); |
HashMap<String,PerguntasGrupoQueryDao.MediaGlobalCursoGrupo> mediasCursoGrupo = new HashMap<String, PerguntasGrupoQueryDao.MediaGlobalCursoGrupo>(); |
HashMap<String,PerguntasGrupoQueryDao.MediaGlobalEscolaGrupo> mediasEscolaGrupo = new HashMap<String, PerguntasGrupoQueryDao.MediaGlobalEscolaGrupo>(); |
//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 HashMap<String, PerguntasGrupoQueryDao.MediaGlobalCursoPergunta> getMediasCursoPergunta() { |
return mediasCursoPergunta; |
public PerguntasGrupoQueryDao.MediaGlobalCursoPergunta mediaPerguntaNoCurso(String codigoCurso, String anoLectivo, String numeroPergunta,String[] periodos,String[]degrees) |
{ |
return PerguntasGrupoQueryDao.getMediaCursoPergunta(this,codigoCurso,anoLectivo,numeroPergunta,periodos,degrees); |
} |
public PerguntasGrupoQueryDao.MediaGlobalCursoGrupo mediaGrupoNoCurso(String codigoCurso, String anoLectivo, String grupo,String[] periodos,String[]degrees) |
{ |
return PerguntasGrupoQueryDao.getMediaCursoGrupo(this, codigoCurso,anoLectivo,grupo,periodos,degrees); |
} |
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[] periodos,String[]degrees) |
{ |
return PerguntasGrupoQueryDao.getMediaEscolaGrupo(this, codigoEscola, anoLectivo, grupo,periodos,degrees); |
} |
public void setMediasCursoPergunta(HashMap<String, PerguntasGrupoQueryDao.MediaGlobalCursoPergunta> mediasCursoPergunta) { |
this.mediasCursoPergunta = mediasCursoPergunta; |
public HashMap<String, PerguntasGrupoQueryDao.MediaGlobalCursoPergunta> getMediasPerguntaNoCurso() { |
return mediasPerguntaNoCurso; |
} |
public HashMap<String, PerguntasGrupoQueryDao.MediaGlobalEscolaPergunta> getMediasEscolaPergunta() { |
return mediasEscolaPergunta; |
public void setMediasPerguntaNoCurso(HashMap<String, PerguntasGrupoQueryDao.MediaGlobalCursoPergunta> mediasPerguntaNoCurso) { |
this.mediasPerguntaNoCurso = mediasPerguntaNoCurso; |
} |
public void setMediasEscolaPergunta(HashMap<String, PerguntasGrupoQueryDao.MediaGlobalEscolaPergunta> mediasEscolaPergunta) { |
this.mediasEscolaPergunta = mediasEscolaPergunta; |
public HashMap<String, PerguntasGrupoQueryDao.MediaGlobalEscolaPergunta> getMediasPerguntaNaEscola() { |
return mediasPerguntaNaEscola; |
} |
public HashMap<String, PerguntasGrupoQueryDao.MediaGlobalCursoGrupo> getMediasCursoGrupo() { |
return mediasCursoGrupo; |
public void setMediasPerguntaNaEscola(HashMap<String, PerguntasGrupoQueryDao.MediaGlobalEscolaPergunta> mediasPerguntaNaEscola) { |
this.mediasPerguntaNaEscola = mediasPerguntaNaEscola; |
} |
public void setMediasCursoGrupo(HashMap<String, PerguntasGrupoQueryDao.MediaGlobalCursoGrupo> mediasCursoGrupo) { |
this.mediasCursoGrupo = mediasCursoGrupo; |
public HashMap<String, PerguntasGrupoQueryDao.MediaGlobalCursoGrupo> getMediasGrupoNoCurso() { |
return mediasGrupoNoCurso; |
} |
public HashMap<String, PerguntasGrupoQueryDao.MediaGlobalEscolaGrupo> getMediasEscolaGrupo() { |
return mediasEscolaGrupo; |
public void setMediasGrupoNoCurso(HashMap<String, PerguntasGrupoQueryDao.MediaGlobalCursoGrupo> mediasGrupoNoCurso) { |
this.mediasGrupoNoCurso = mediasGrupoNoCurso; |
} |
public void setMediasEscolaGrupo(HashMap<String, PerguntasGrupoQueryDao.MediaGlobalEscolaGrupo> mediasEscolaGrupo) { |
this.mediasEscolaGrupo = mediasEscolaGrupo; |
public HashMap<String, PerguntasGrupoQueryDao.MediaGlobalEscolaGrupo> getMediasGrupoNaEscola() { |
return mediasGrupoNaEscola; |
} |
public void setMediasGrupoNaEscola(HashMap<String, PerguntasGrupoQueryDao.MediaGlobalEscolaGrupo> mediasGrupoNaEscola) { |
this.mediasGrupoNaEscola = mediasGrupoNaEscola; |
} |
public String getColor1Hex() { |
return color1Hex; |
} |
/branches/v3/impl/src/java/pt/estgp/estgweb/services/questionarios/pedagogico/docenteReport.fo.xsl |
---|
838,7 → 838,7 |
<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 relativas ao grupo unidade para as unidades do docente</xsl:with-param> |
<xsl:with-param name="text">4 - Análise das questões sobre as Unidades do docente</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> |
940,6 → 940,12 |
<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"> |
967,6 → 973,13 |
</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> |
1234,45 → 1247,20 |
<xsl:template name="barraPercentil"> |
<xsl:param name="valor"/> |
<xsl:param name="colors">false</xsl:param> |
<fo:block-container margin="1px" border="1px solid #C6C6CA" padding="0"> |
<xsl:choose> |
<xsl:when test="$colors = 'false'"> |
<xsl:attribute name="border">1px solid #C6C6CA</xsl:attribute> |
</xsl:when> |
<xsl:otherwise> |
<xsl:attribute name="border">1px solid <xsl:value-of select="$STD_COLOR_SECTION"/></xsl:attribute> |
</xsl:otherwise> |
</xsl:choose> |
<fo:block-container border="1px solid #C6C6CA" margin="0" padding-top="1px" padding-bottom="0"> |
<xsl:choose> |
<xsl:when test="$colors = 'false'"> |
<xsl:attribute name="background-color">#B9F1B1</xsl:attribute> |
</xsl:when> |
<xsl:otherwise> |
<xsl:choose> |
<xsl:when test="$valor < 21"> |
<xsl:attribute name="background-color"><xsl:value-of select="//color1Hex"/></xsl:attribute> |
</xsl:when> |
<xsl:when test="$valor < 41"><xsl:attribute name="background-color"><xsl:value-of select="//color2Hex"/></xsl:attribute></xsl:when> |
<xsl:when test="$valor < 61"><xsl:attribute name="background-color"><xsl:value-of select="//color3Hex"/></xsl:attribute></xsl:when> |
<xsl:when test="$valor < 81"><xsl:attribute name="background-color"><xsl:value-of select="//color4Hex"/></xsl:attribute></xsl:when> |
<xsl:otherwise> |
<xsl:attribute name="background-color"><xsl:value-of select="//color5Hex"/></xsl:attribute> |
</xsl:otherwise> |
</xsl:choose> |
</xsl:otherwise> |
</xsl:choose> |
<xsl:attribute name="width"><xsl:value-of select="$valor"/>%</xsl:attribute> |
<fo:block><xsl:value-of select="$valor"/>%</fo:block> |
</fo:block-container> |
</fo:block-container> |
<xsl:param name="backgroundColorPercentage"/> |
<xsl:call-template name="barraPercentilDefined"> |
<xsl:with-param name="colors" select="$colors"/> |
<xsl:with-param name="backgroundColorPercentage" select="$backgroundColorPercentage"/> |
<xsl:with-param name="valor" select="$valor"/> |
<xsl:with-param name="percentDefined" select="$valor"/> |
</xsl:call-template> |
</xsl:template> |
<xsl:template name="barraPercentilDefined"> |
<xsl:param name="valor"/> |
<xsl:param name="percentDefined"/> |
<xsl:param name="colors">false</xsl:param> |
<xsl:param name="backgroundColorPercentage"/> |
<fo:block-container margin="1px" border="1px solid #C6C6CA" padding="0"> |
1281,10 → 1269,28 |
<xsl:when test="$colors = 'false'"> |
<xsl:attribute name="border">1px solid #8D7F5C</xsl:attribute> |
<xsl:attribute name="background-color">#B9F1B1</xsl:attribute> |
</xsl:when> |
<xsl:when test="$backgroundColorPercentage != ''"> |
<xsl:attribute name="background-color"><xsl:value-of select="$backgroundColorPercentage"/></xsl:attribute> |
<xsl:choose> |
<xsl:when test="$percentDefined < 21"> |
<xsl:attribute name="border">1px solid #B10000</xsl:attribute> |
</xsl:when> |
<xsl:when test="$percentDefined < 41"> |
<xsl:attribute name="border">1px solid #B85C00</xsl:attribute> |
</xsl:when> |
<xsl:when test="$percentDefined < 61"> |
<xsl:attribute name="border">1px solid #868600</xsl:attribute> |
</xsl:when> |
<xsl:when test="$percentDefined < 81"> |
<xsl:attribute name="border">1px solid #157C00</xsl:attribute> |
</xsl:when> |
<xsl:otherwise> |
<xsl:attribute name="border">1px solid #157C00</xsl:attribute> |
</xsl:otherwise> |
</xsl:choose> |
</xsl:when> |
<xsl:otherwise> |
<xsl:choose> |
<xsl:when test="$percentDefined < 21"> |
<xsl:attribute name="border">1px solid #B10000</xsl:attribute> |
1512,6 → 1518,7 |
<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:choose> |
/branches/v3/impl/src/java/pt/estgp/estgweb/services/questionarios/pedagogico/OlapGenerationProcessor.java |
---|
9,6 → 9,7 |
import pt.estgp.estgweb.services.logresults.LogMessageTypeEnum; |
import pt.estgp.estgweb.services.logresults.impl.DefaultLogMessage; |
import pt.estgp.estgweb.services.logresults.impl.DefaultLogMessages; |
import pt.estgp.estgweb.utils.ConfigProperties; |
import pt.estgp.estgweb.utils.DistritosUtils; |
import java.util.*; |
527,6 → 528,7 |
questionarioCurso.setNomeCurso(cu.getNome()); |
questionarioCurso.setNomeInstituicao(cu.getNomeInstituicao()); |
questionarioCurso.setCodigoInstituicao(cu.getCodigoInstituicao()); |
questionarioCurso.setCodigoNacionalInstituicao(ConfigProperties.getProperty("institution.national.code."+cu.getCodigoInstituicao())); |
DaoFactory.getOlapEntityQuestionarioCursoDaoImpl().save(questionarioCurso); |
return questionarioCurso; |
} |
/branches/v3/impl/src/java/pt/estgp/estgweb/services/questionarios/pedagogico/DocenteReport.java |
---|
1,14 → 1,13 |
package pt.estgp.estgweb.services.questionarios.pedagogico; |
import pt.estgp.estgweb.services.questionarios.pedagogico.queries.PerguntasGrupoQueryDao; |
import pt.estgp.estgweb.services.questionarios.utils.MediasGrupo; |
import pt.estgp.estgweb.services.questionarios.utils.PerguntaStats; |
import pt.estgp.estgweb.services.questionarios.utils.RespostasAgregadasGrupo; |
import pt.estgp.estgweb.services.questionarios.utils.UnidadeStats; |
import pt.estgp.estgweb.services.questionarios.utils.*; |
import java.io.Serializable; |
import java.util.ArrayList; |
import java.util.HashMap; |
import java.util.Collections; |
import java.util.Comparator; |
import java.util.List; |
/** |
* Created by jorgemachado on 07/11/16. |
23,10 → 22,12 |
ArrayList<String> degrees; |
//Respostas Agregadas com medias de Grupo |
public RespostasAgregadasGrupo respostasAgregadasGrupoDocente = new RespostasAgregadasGrupo(PerguntasGrupoQueryDao.GRUPO_DOCENTE_CODE_PERGUNTAS); |
public RespostasAgregadasGrupo respostasAgregadasGrupoUnidade = new RespostasAgregadasGrupo(PerguntasGrupoQueryDao.GRUPO_UNIDADE_CODE_PERGUNTAS); |
//Tem as perguntas Todas numa lista de PerguntaStats |
public RespostasAgregadasGrupoStats respostasAgregadasGrupoDocente = new RespostasAgregadasGrupoStats(PerguntasGrupoQueryDao.GRUPO_DOCENTE_CODE_PERGUNTAS); |
public RespostasAgregadasGrupoStats respostasAgregadasGrupoUnidade = new RespostasAgregadasGrupoStats(PerguntasGrupoQueryDao.GRUPO_UNIDADE_CODE_PERGUNTAS); |
//Respostas por unidade com medias de Grupo |
//Cada cadeira tem as perguntas todas numa lista de PerguntaStats |
public ArrayList<UnidadeStats> unidadesStats = new ArrayList<UnidadeStats>(); |
37,17 → 38,42 |
public int unidadesNosCursos; |
public int unidadesNasEscolas; |
public MediasGrupo findMediasGrupoDocenteRespostasAgregadas() |
public ChartWithTitleTemp extremePerguntaAbsolutaAvgMaxDocente; |
public ChartWithTitleTemp extremePerguntaAbsolutaAvgMinDocente; |
public ChartWithTitleTemp extremePerguntaAbsolutaAvgMaxUnidade; |
public ChartWithTitleTemp extremePerguntaAbsolutaAvgMinUnidade; |
public ChartWithTitleTemp extremePerguntaAgregadaAvgMaxDocente; |
public ChartWithTitleTemp extremePerguntaAgregadaAvgMinDocente; |
public ChartWithTitleTemp extremePerguntaAgregadaAvgMaxUnidade; |
public ChartWithTitleTemp extremePerguntaAgregadaAvgMinUnidade; |
public ChartWithTitleTemp extremeUnitAvgMaxDocente; |
public ChartWithTitleTemp extremeUnitAvgMinDocente; |
public ChartWithTitleTemp extremeUnitAvgMaxUnidade; |
public ChartWithTitleTemp extremeUnitAvgMinUnidade; |
public ChartWithTitleTemp extremeParticipacaoMax; |
public ChartWithTitleTemp extremeParticipacaoMin; |
public ChartWithTitleTemp extremePerguntaAbsolutaDiffAvgMaxDocente; |
public ChartWithTitleTemp extremePerguntaAbsolutaDiffAvgMinDocente; |
public ChartWithTitleTemp extremePerguntaAbsolutaDiffAvgMaxUnidade; |
public ChartWithTitleTemp extremePerguntaAbsolutaDiffAvgMinUnidade; |
public MediasGrupo mediasGrupoDocenteAgregada() |
{ |
return respostasAgregadasGrupoDocente.getMediasGrupo(); |
} |
public MediasGrupo findMediasGrupoUnidadeRespostasAgregadas() |
public MediasGrupo mediasGrupoUnidadeAgregada() |
{ |
return respostasAgregadasGrupoUnidade.getMediasGrupo(); |
} |
public MediasGrupo findMediasGrupoDocenteNaUnidade(String codigoUnidade, String codigoCurso, String semestre) |
public MediasGrupo mediaGrupoDocenteNaUnidade(String codigoUnidade, String codigoCurso, String semestre) |
{ |
for(UnidadeStats unidadeStats :unidadesStats) |
{ |
61,7 → 87,7 |
return null; |
} |
public MediasGrupo findMediasGrupoUnidadeNaUnidade(String codigoUnidade, String codigoCurso, String semestre) |
public MediasGrupo mediaGrupoUnidadeNaUnidade(String codigoUnidade, String codigoCurso, String semestre) |
{ |
for(UnidadeStats unidadeStats :unidadesStats) |
{ |
76,19 → 102,19 |
} |
public RespostasAgregadasGrupo getRespostasAgregadasGrupoDocente() { |
public RespostasAgregadasGrupoStats getRespostasAgregadasGrupoDocente() { |
return respostasAgregadasGrupoDocente; |
} |
public void setRespostasAgregadasGrupoDocente(RespostasAgregadasGrupo respostasAgregadasGrupoDocente) { |
public void setRespostasAgregadasGrupoDocente(RespostasAgregadasGrupoStats respostasAgregadasGrupoDocente) { |
this.respostasAgregadasGrupoDocente = respostasAgregadasGrupoDocente; |
} |
public RespostasAgregadasGrupo getRespostasAgregadasGrupoUnidade() { |
public RespostasAgregadasGrupoStats getRespostasAgregadasGrupoUnidade() { |
return respostasAgregadasGrupoUnidade; |
} |
public void setRespostasAgregadasGrupoUnidade(RespostasAgregadasGrupo respostasAgregadasGrupoUnidade) { |
public void setRespostasAgregadasGrupoUnidade(RespostasAgregadasGrupoStats respostasAgregadasGrupoUnidade) { |
this.respostasAgregadasGrupoUnidade = respostasAgregadasGrupoUnidade; |
} |
179,9 → 205,10 |
* CACHE DE MEDIAS PARA OUTROS GRAFICOS |
* PRIVADO |
********************************************/ |
/* |
private HashMap<String,PerguntaStats> numeroPerguntaRespostasChart = new HashMap<String, PerguntaStats>(); |
public void addNumeroPerguntaChartCache(PerguntaStats chart) |
{ |
numeroPerguntaRespostasChart.put(chart.getNumero(),chart); |
227,6 → 254,350 |
PerguntaStats r = numeroPerguntaRespostasChart.get(numero); |
return r == null ? "0" : r.getPercentMediaEntidadeEmAvaliacao(); |
} |
*/ |
/************************************************** |
* ***** EXTREME MEDIAS CALCULATIONS ***** |
* ************************************************/ |
public static PerguntaUnidadeStatAux extremePerguntaMaxDocente(DocenteReport report) |
{ |
List<PerguntaUnidadeStatAux> perguntas = getPerguntaUnidadeStatAuxesDocenteSortedMedia(report); |
if(perguntas.size() > 0) |
return perguntas.get(0); |
return null; |
} |
public static PerguntaUnidadeStatAux extremePerguntaMinDocente(DocenteReport report) |
{ |
List<PerguntaUnidadeStatAux> perguntas = getPerguntaUnidadeStatAuxesDocenteSortedMedia(report); |
if(perguntas.size() > 0) |
return perguntas.get(perguntas.size() - 1); |
return null; |
} |
public static PerguntaUnidadeStatAux extremePerguntaMaxUnidade(DocenteReport report) |
{ |
List<PerguntaUnidadeStatAux> perguntas = getPerguntaUnidadeStatAuxesUnidadeSortedMedia(report); |
if(perguntas.size() > 0) |
return perguntas.get(0); |
return null; |
} |
public static PerguntaUnidadeStatAux extremePerguntaMinUnidade(DocenteReport report) |
{ |
List<PerguntaUnidadeStatAux> perguntas = getPerguntaUnidadeStatAuxesUnidadeSortedMedia(report); |
if(perguntas.size() > 0) |
return perguntas.get(perguntas.size() - 1); |
return null; |
} |
private static List<PerguntaUnidadeStatAux> getPerguntaUnidadeStatAuxesDocenteSortedMedia(DocenteReport report) { |
List<PerguntaUnidadeStatAux> perguntas = new ArrayList<PerguntaUnidadeStatAux>(); |
for(UnidadeStats unidadeStats : report.unidadesStats) |
{ |
for(PerguntaStats ps : unidadeStats.getUnidadeStatsGrupoDocente().getPerguntasStats()) |
{ |
cloneAndAddPerguntaAuxToList(perguntas, unidadeStats, ps); |
} |
} |
sortPerguntaAuxesMedia(perguntas); |
return perguntas; |
} |
private static void sortPerguntaAuxesMedia(List<PerguntaUnidadeStatAux> perguntas) { |
Collections.sort(perguntas, new Comparator<PerguntaUnidadeStatAux>() { |
@Override |
public int compare(PerguntaUnidadeStatAux o1, PerguntaUnidadeStatAux o2) { |
double diff = o1.pergunta.getMediaEntidadeEmAvaliacao() - o2.pergunta.getMediaEntidadeEmAvaliacao(); |
if (diff < 0) return -1; |
if (diff > 0) return 1; |
return 0; |
} |
}); |
} |
private static List<PerguntaUnidadeStatAux> getPerguntaUnidadeStatAuxesUnidadeSortedMedia(DocenteReport report) { |
List<PerguntaUnidadeStatAux> perguntas = new ArrayList<PerguntaUnidadeStatAux>(); |
for(UnidadeStats unidadeStats : report.unidadesStats) |
{ |
for(PerguntaStats ps : unidadeStats.getUnidadeStatsGrupoUnidade().getPerguntasStats()) |
{ |
cloneAndAddPerguntaAuxToList(perguntas, unidadeStats, ps); |
} |
} |
sortPerguntaAuxesMedia(perguntas); |
return perguntas; |
} |
private static void cloneAndAddPerguntaAuxToList(List<PerguntaUnidadeStatAux> perguntas, UnidadeStats unidadeStats, PerguntaStats ps) { |
PerguntaUnidadeStatAux aux = new PerguntaUnidadeStatAux(); |
aux.pergunta = ps; |
aux.codigoCurso = unidadeStats.getCodigoCurso(); |
aux.nomeCurso = unidadeStats.getNomeCurso(); |
aux.codigoEscola = unidadeStats.getCodigoEscola(); |
aux.nomeEscola = unidadeStats.getNomeEscola(); |
aux.codigoUnidade = unidadeStats.getCodigoUnidade(); |
aux.nomeUnidade = unidadeStats.getNomeUnidade(); |
aux.semestre = unidadeStats.getSemestre(); |
aux.difMedia = ps.getMediaEntidadeEmAvaliacao() - ps.getMediaCursos(); |
perguntas.add(aux); |
} |
public static class PerguntaUnidadeStatAux |
{ |
String nomeUnidade; |
String codigoUnidade; |
String codigoCurso; |
String nomeCurso; |
String codigoEscola; |
String nomeEscola; |
String semestre; |
PerguntaStats pergunta; |
double difMedia; |
} |
/************************************************** |
* ***** EXTREME AGREGADAS MEDIAS CALCULATIONS ***** |
* ************************************************/ |
public static PerguntaStats extremeDocentePerguntaAgregadasMax(DocenteReport report) |
{ |
List<PerguntaStats> perguntas = getPerguntasAgregadasStatsSorted(report); |
if(perguntas.size() > 0) |
return perguntas.get(0); |
return null; |
} |
public static PerguntaStats extremeDocentePerguntaAgregadasMin(DocenteReport report) |
{ |
List<PerguntaStats> perguntas = getPerguntasAgregadasStatsSorted(report); |
if(perguntas.size() > 0) |
return perguntas.get(perguntas.size()-1); |
return null; |
} |
private static List<PerguntaStats> getPerguntasAgregadasStatsSorted(DocenteReport report) { |
List<PerguntaStats> perguntas = report.getRespostasAgregadasGrupoDocente().getPerguntasStats(); |
sortPerguntasStatsMedia(perguntas); |
return perguntas; |
} |
public static PerguntaStats extremeUnidadePerguntaAgregadaMax(DocenteReport report) |
{ |
List<PerguntaStats> perguntas = getPerguntasUnidadesAgregadasStatsSorted(report); |
if(perguntas.size() > 0) |
return perguntas.get(0); |
return null; |
} |
public static PerguntaStats extremeUnidadePerguntaAgregadaMin(DocenteReport report) |
{ |
List<PerguntaStats> perguntas = getPerguntasUnidadesAgregadasStatsSorted(report); |
if(perguntas.size() > 0) |
return perguntas.get(perguntas.size()-1); |
return null; |
} |
private static List<PerguntaStats> getPerguntasUnidadesAgregadasStatsSorted(DocenteReport report) { |
List<PerguntaStats> perguntas = report.getRespostasAgregadasGrupoUnidade().getPerguntasStats(); |
sortPerguntasStatsMedia(perguntas); |
return perguntas; |
} |
private static void sortPerguntasStatsMedia(List<PerguntaStats> perguntas) { |
Collections.sort(perguntas, new Comparator<PerguntaStats>() { |
@Override |
public int compare(PerguntaStats o1, PerguntaStats o2) { |
double diff = o1.getMediaEntidadeEmAvaliacao() - o2.getMediaEntidadeEmAvaliacao(); |
if (diff < 0) return -1; |
if (diff > 0) return 1; |
return 0; |
} |
}); |
} |
/************************************************** |
* ***** EXTREME UNIDADE MEDIAS CALCULATIONS ***** |
* ************************************************/ |
public static UnidadeStats extremeDocenteUnidadeMax(DocenteReport report) |
{ |
List<UnidadeStats> unidadeStatses = getUnidadeStatsesDocenteSortedMedia(report); |
if(unidadeStatses.size() > 0) |
return unidadeStatses.get(0); |
return null; |
} |
public static UnidadeStats extremeDocenteUnidadeMin(DocenteReport report) |
{ |
List<UnidadeStats> unidadeStatses = getUnidadeStatsesDocenteSortedMedia(report); |
if(unidadeStatses.size() > 0) |
return unidadeStatses.get(unidadeStatses.size()-1); |
return null; |
} |
public static UnidadeStats extremeUnidadeUnidadeMax(DocenteReport report) |
{ |
List<UnidadeStats> unidadeStatses = getUnidadeStatsesUnidadeSortedMedia(report); |
if(unidadeStatses.size() > 0) |
return unidadeStatses.get(0); |
return null; |
} |
public static UnidadeStats extremeUnidadeUnidadeMin(DocenteReport report) |
{ |
List<UnidadeStats> unidadeStatses = getUnidadeStatsesUnidadeSortedMedia(report); |
if(unidadeStatses.size() > 0) |
return unidadeStatses.get(unidadeStatses.size()-1); |
return null; |
} |
private static List<UnidadeStats> getUnidadeStatsesUnidadeSortedMedia(DocenteReport report) { |
List<UnidadeStats> unidadeStatses = report.getUnidadesStats(); |
Collections.sort(unidadeStatses, new Comparator<UnidadeStats>() { |
@Override |
public int compare(UnidadeStats o1, UnidadeStats o2) { |
double diff = o1.getUnidadeStatsGrupoUnidade().getMediasGrupo().getAvaliacaoMedia() - o2.getUnidadeStatsGrupoUnidade().getMediasGrupo().getAvaliacaoMedia(); |
if (diff < 0) |
return -1; |
if (diff > 0) |
return 1; |
return 0; |
} |
}); |
return unidadeStatses; |
} |
private static List<UnidadeStats> getUnidadeStatsesDocenteSortedMedia(DocenteReport report) { |
List<UnidadeStats> unidadeStatses = report.getUnidadesStats(); |
Collections.sort(unidadeStatses, new Comparator<UnidadeStats>() { |
@Override |
public int compare(UnidadeStats o1, UnidadeStats o2) { |
double diff = o1.getUnidadeStatsGrupoDocente().getMediasGrupo().getAvaliacaoMedia() - o2.getUnidadeStatsGrupoDocente().getMediasGrupo().getAvaliacaoMedia(); |
if (diff < 0) |
return -1; |
if (diff > 0) |
return 1; |
return 0; |
} |
}); |
return unidadeStatses; |
} |
/************************************************** |
* ***** EXTREME Participacao Unidades ***** |
* ************************************************/ |
public static ParticipacaoUnidade extremeParticipacaoUnidadeMax(DocenteReport report) |
{ |
List<ParticipacaoUnidade> participacoes = getParticipacaoUnidadesSortedPercentagem(report); |
if(participacoes.size() > 0) |
return participacoes.get(0); |
return null; |
} |
public static ParticipacaoUnidade extremeParticipacaoUnidadeMin(DocenteReport report) |
{ |
List<ParticipacaoUnidade> participacoes = getParticipacaoUnidadesSortedPercentagem(report); |
if(participacoes.size() > 0) |
return participacoes.get(0); |
return null; |
} |
private static List<ParticipacaoUnidade> getParticipacaoUnidadesSortedPercentagem(DocenteReport report) { |
List<ParticipacaoUnidade> participacoes = report.getParticipacoesUnidades(); |
Collections.sort(participacoes, new Comparator<ParticipacaoUnidade>() { |
@Override |
public int compare(ParticipacaoUnidade o1, ParticipacaoUnidade o2) { |
return o1.getParticiparamPercentagem() - o2.getParticiparamPercentagem(); |
} |
}); |
return participacoes; |
} |
/********************************** |
* EXTREME DIFF MEDIA |
**********************************/ |
public static PerguntaUnidadeStatAux extremeDiffMediaPerguntaMaxDocente(DocenteReport report) |
{ |
List<PerguntaUnidadeStatAux> perguntas = new ArrayList<PerguntaUnidadeStatAux>(); |
for(UnidadeStats unidadeStats : report.unidadesStats) |
{ |
for(PerguntaStats ps : unidadeStats.getUnidadeStatsGrupoDocente().getPerguntasStats()) |
{ |
cloneAndAddPerguntaAuxToList(perguntas, unidadeStats, ps); |
} |
} |
sortPerguntaAuxDiffMediaCursos(perguntas); |
if(perguntas.size() > 0) |
return perguntas.get(0); |
return null; |
} |
public static PerguntaUnidadeStatAux extremeDiffMediaPerguntaMinDocente(DocenteReport report) |
{ |
List<PerguntaUnidadeStatAux> perguntas = new ArrayList<PerguntaUnidadeStatAux>(); |
for(UnidadeStats unidadeStats : report.unidadesStats) |
{ |
for(PerguntaStats ps : unidadeStats.getUnidadeStatsGrupoDocente().getPerguntasStats()) |
{ |
cloneAndAddPerguntaAuxToList(perguntas, unidadeStats, ps); |
} |
} |
sortPerguntaAuxDiffMediaCursos(perguntas); |
if(perguntas.size() > 0) |
return perguntas.get(perguntas.size()-1); |
return null; |
} |
public static PerguntaUnidadeStatAux extremeDiffMediaPerguntaMaxUnidade(DocenteReport report) |
{ |
List<PerguntaUnidadeStatAux> perguntas = new ArrayList<PerguntaUnidadeStatAux>(); |
for(UnidadeStats unidadeStats : report.unidadesStats) |
{ |
for(PerguntaStats ps : unidadeStats.getUnidadeStatsGrupoUnidade().getPerguntasStats()) |
{ |
cloneAndAddPerguntaAuxToList(perguntas, unidadeStats, ps); |
} |
} |
sortPerguntaAuxDiffMediaCursos(perguntas); |
if(perguntas.size() > 0) |
return perguntas.get(0); |
return null; |
} |
public static PerguntaUnidadeStatAux extremeDiffMediaPerguntaMinUnidade(DocenteReport report) |
{ |
List<PerguntaUnidadeStatAux> perguntas = new ArrayList<PerguntaUnidadeStatAux>(); |
for(UnidadeStats unidadeStats : report.unidadesStats) |
{ |
for(PerguntaStats ps : unidadeStats.getUnidadeStatsGrupoUnidade().getPerguntasStats()) |
{ |
cloneAndAddPerguntaAuxToList(perguntas, unidadeStats, ps); |
} |
} |
sortPerguntaAuxDiffMediaCursos(perguntas); |
if(perguntas.size() > 0) |
return perguntas.get(perguntas.size()-1); |
return null; |
} |
private static void sortPerguntaAuxDiffMediaCursos(List<PerguntaUnidadeStatAux> perguntas) { |
Collections.sort(perguntas, new Comparator<PerguntaUnidadeStatAux>() { |
@Override |
public int compare(PerguntaUnidadeStatAux o1, PerguntaUnidadeStatAux o2) { |
double diff = o1.difMedia - o2.difMedia; |
if (diff < 0) return -1; |
if (diff > 0) return 1; |
return 0; |
} |
}); |
} |
} |
/branches/v3/impl/src/updates/version/updateDimensoesPaeQuestionarios |
---|
19,4 → 19,8 |
p9SubGroup = "6", |
p10SubGroup = "6", |
p11SubGroup = "7", |
p12SubGroup = "7"; |
p12SubGroup = "7"; |
update questionario_peda_curso_afeto set nomeInstituicao = substring(nomeInstituicao,1,position('(' in nomeInstituicao)-1); |
update paeipp.questionario_peda_curso_afeto set nomeInstituicao = "Escola Superior de Educação e Ciências Sociais" where nomeInstituicao = "Escola Superior de Educação"; |
/branches/v3/impl/src/hbm/pt/estgp/estgweb/domain/OlapQuestionarios.hbm.xml |
---|
44,6 → 44,7 |
<property name="codigoInstituicao" type="string" index="codigoInstituicaoIndex"/> |
<property name="nomeInstituicao" type="string" index="nomeInstituicaoIndex"/> |
<property name="codigoNacionalInstituicao" type="string" index="codigoNacionalInstituicaoIndex"/> |
<property name="degree" type="string" index="degreeIndex"> |
<column name="degree" index="degreeIndex" /> |