java.lang.Object
ch.tocco.nice2.optional.qualification.impl.util.entities.AbstractInstance
ch.tocco.nice2.optional.qualification.impl.util.entities.Input
All Implemented Interfaces:
Instance

public class Input extends AbstractInstance
  • Constructor Details

  • Method Details

    • getInputStatus

      public String getInputStatus()
    • isFinishable

      public boolean isFinishable()
    • getNode

      public InputNode getNode()
      Specified by:
      getNode in class AbstractInstance
    • getNode

      public InputNode getNode(EvaluationNode parent)
      Specified by:
      getNode in class AbstractInstance
    • getUniqueKey

      public String getUniqueKey()
      Description copied from interface: Instance
      get a string that uniquely identifies this instance. currently, format is Model-Key.
      Returns:
      the unique key
    • getGrades

      public ArrayList<BigDecimal> getGrades(Entity participant)
      Specified by:
      getGrades in class AbstractInstance
    • isMandatory

      public boolean isMandatory()
      Specified by:
      isMandatory in class AbstractInstance
    • getInputData

      public Collection<InputData> getInputData()
    • getOrCreateData

      @Nullable public @Nullable InputData getOrCreateData(Entity participant)
      Specified by:
      getOrCreateData in class AbstractInstance
    • getData

      @Nullable public @Nullable InputData getData(Entity participant)
      Specified by:
      getData in class AbstractInstance
    • getPublishedFrom

      @Nullable public @Nullable org.joda.time.DateTime getPublishedFrom()
      Specified by:
      getPublishedFrom in class AbstractInstance
    • getPublishedTo

      @Nullable public @Nullable org.joda.time.DateTime getPublishedTo()
      Specified by:
      getPublishedTo in class AbstractInstance
    • isVisible

      public boolean isVisible()
      Specified by:
      isVisible in class AbstractInstance
    • createMissingExams

      public Collection<Exam> createMissingExams()
      Creates all Exams not already existing for this Input, setting the nr of the Exam to the next higher value not already set for an Exam of this Input. Note: There are no Exams created for Input_types which do not offer entering more then one Rating. Namely free_text and choice_rating.
    • getActiveExams

      public List<Exam> getActiveExams()
      Returns all Exams related to this Input, not exceeding the defined numRatings of this Input.
      Returns:
      The List of Exams
      See Also:
    • getAllExams

      public List<Exam> getAllExams()
      Returns all Exams related to this Input even if they are defined as inactive by their Exam.FIELD_NR exceeding the Input's numRatings value.
      Returns:
      The List of Exams
    • getExams

      public List<Exam> getExams(int limit)
      Returns all Exams related to this Input not exceeding the given limit, even if they are defined as inactive by their Exam.FIELD_NR exceeding the Input's numRatings value.
      Parameters:
      limit - the limit of Exams to get or -1 for no limit
      Returns:
      The List of Exams
      See Also:
    • getExamRecords

      public static List<AbstractInputType.ExamRecord> getExamRecords(List<Exam> exams)
      Transforms a collection of Exams into a collection of AbstractInputType.ExamRecords.
      Parameters:
      exams - the collection of Exams to be transformed.
      Returns:
      the list of AbstractInputType.ExamRecords
    • getInputData

      public Collection<InputData> getInputData(boolean updateParticipants)
      Get all Input_data entities for this Input. The method looks up all Registrations for the linked events and loads or generates Input_data entities for the Users.
      Parameters:
      updateParticipants - generate/remove Input_datas for new/invalid participants
      Returns:
      the complete Collection of InputData objects
    • getInputDataEntityList

      public EntityList getInputDataEntityList()
    • getDispensedInputDataEntityList

      public EntityList getDispensedInputDataEntityList()
    • getNumRatings

      public int getNumRatings()
    • setNumRatings

      public void setNumRatings(int numRatings)
    • getNumDropGrades

      @Nullable public @Nullable Integer getNumDropGrades()
    • getResponsibleUsers

      public EntityList getResponsibleUsers()
    • aggregateInputData

      public void aggregateInputData()
    • getThresholdValues

      public List<ThresholdValue> getThresholdValues()
    • getEvaluationNode

      @Nullable public @Nullable EvaluationNode getEvaluationNode()
    • getRootEvaluationNode

      @Nullable public @Nullable EvaluationNode getRootEvaluationNode()
    • setGradeAvg

      public void setGradeAvg(@Nullable @Nullable BigDecimal avg)
    • setGradeMin

      public void setGradeMin(@Nullable @Nullable BigDecimal min)
    • setGradeMax

      public void setGradeMax(@Nullable @Nullable BigDecimal max)
    • setPointsAvg

      public void setPointsAvg(@Nullable @Nullable BigDecimal avg)
    • setPointsMin

      public void setPointsMin(@Nullable @Nullable BigDecimal min)
    • setPointsMax

      public void setPointsMax(@Nullable @Nullable BigDecimal max)
    • getParentEvaluation

      @Nullable public @Nullable Evaluation getParentEvaluation()
      Specified by:
      getParentEvaluation in class AbstractInstance
    • getPointsAvg

      public BigDecimal getPointsAvg()
    • getPointsMin

      public BigDecimal getPointsMin()
    • getPointsMax

      public BigDecimal getPointsMax()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • evaluate

      public void evaluate(Collection<Exam> exams, EvaluationFactory evaluationFactory)
    • getVisibilityStatus

      public Entity getVisibilityStatus()
    • allInputDatasEmpty

      public boolean allInputDatasEmpty()
    • getRatingData

      public Optional<Object> getRatingData(Entity user)
      Parameters:
      user - a User entity
      Returns:
      an optional rating object (type depending on the type of the underlying node)
    • setGradeCount

      public void setGradeCount(int count)
    • getGradeCount

      public Integer getGradeCount()
    • setPointsCount

      public void setPointsCount(int count)
    • getPointsCount

      public Integer getPointsCount()
    • getPointConverterTypeEntity

      @Nullable public @Nullable Entity getPointConverterTypeEntity()