Class ECTSSumAnalysis
- java.lang.Object
-
- org.ametys.plugins.odfpilotage.report.consistency.AbstractConsistencyAnalysis
-
- org.ametys.plugins.odfpilotage.report.consistency.impl.ECTSSumAnalysis
-
- All Implemented Interfaces:
ConsistencyAnalysis
,PluginAware
,Configurable
,Serviceable
public class ECTSSumAnalysis extends AbstractConsistencyAnalysis
Analysis on ECTS sums at each level of theProgram
.
-
-
Field Summary
Fields Modifier and Type Field Description private static Pattern
__ECTS_PATTERN
-
Fields inherited from class org.ametys.plugins.odfpilotage.report.consistency.AbstractConsistencyAnalysis
_description, _id, _label, _odfHelper, _pluginName, _priority, _shortId
-
-
Constructor Summary
Constructors Constructor Description ECTSSumAnalysis()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List<Map<String,Object>>
_controlECTS(ProgramItem programItem, int level)
Control the ECTS consistency between the current content and its children.protected Double
_getChildrenECTSSum(ProgramItem programItem)
Get the sum of the children of the current item.protected Double
_getECTS(Content content)
Get the ECTS of the currentContent
.protected Map<String,Object>
_getErrorMessage(ProgramItem programItem, Double parentECTS, Double childrenECTS, int level)
Get theI18nizableText
representing the error message to display (with parameters).ConsistencyAnalysisResult
analyze(Program program)
Analyze the program to find inconsistencies.-
Methods inherited from class org.ametys.plugins.odfpilotage.report.consistency.AbstractConsistencyAnalysis
configure, getDescription, getId, getLabel, getPriority, getShortId, service, setPluginInfo
-
-
-
-
Field Detail
-
__ECTS_PATTERN
private static final Pattern __ECTS_PATTERN
-
-
Constructor Detail
-
ECTSSumAnalysis
public ECTSSumAnalysis()
-
-
Method Detail
-
analyze
public ConsistencyAnalysisResult analyze(Program program)
Description copied from interface:ConsistencyAnalysis
Analyze the program to find inconsistencies.- Parameters:
program
- The program to analyze- Returns:
- A
List
of lines asI18nizableText
-
_getErrorMessage
protected Map<String,Object> _getErrorMessage(ProgramItem programItem, Double parentECTS, Double childrenECTS, int level)
Get theI18nizableText
representing the error message to display (with parameters).- Parameters:
programItem
- The program element which is inconsistencyparentECTS
- Number of ECTS on the parentchildrenECTS
- Number of ECTS on the childrenlevel
- the level of the line to retrieve (hierarchical level begins at 0 for the program)- Returns:
- The error message
-
_controlECTS
protected List<Map<String,Object>> _controlECTS(ProgramItem programItem, int level)
Control the ECTS consistency between the current content and its children.- Parameters:
programItem
- TheProgramItem
to check ECTS consistencylevel
- the level of the program item to control (hierarchical level begins at 0 for the program)- Returns:
- The
List
of error messages
-
_getChildrenECTSSum
protected Double _getChildrenECTSSum(ProgramItem programItem)
Get the sum of the children of the current item. It calculates the coef if it's aCourseList
.- Parameters:
programItem
- The parentProgramItem
.- Returns:
- The sum of children ECTS
-
-