Class UnitProgress


  • @Entity
    public class UnitProgress
    extends BaseTimestampedEntity
    This class represents state in which Unit can be. Unit progress is required to determine Module progress.
    • Constructor Detail

      • UnitProgress

        public UnitProgress​(Unit unit,
                            ModuleProgress moduleProgress)
        Create new Unit Progress.
        Parameters:
        unit - Unit which progress will be stored
        moduleProgress - parent module progress
    • Method Detail

      • startUnit

        public void startUnit()
      • endUnit

        public void endUnit()
      • isCompleted

        public boolean isCompleted()
      • getCallFlowElementsIterator

        public java.util.ListIterator<CallFlowElement> getCallFlowElementsIterator()
        Get call flow elements list iterator starting from current element.
        Returns:
        call flow elements list iterator
      • addOrUpdateMultipleChoiceQuestionLog

        public void addOrUpdateMultipleChoiceQuestionLog​(java.time.LocalDateTime startDate,
                                                         java.time.LocalDateTime endDate,
                                                         CallFlowElement callFlowElement,
                                                         Choice choice,
                                                         java.lang.Integer numberOfAttempts)
        Add Multiple Choice Question Log.
        Parameters:
        startDate - question start date
        endDate - question end date
        callFlowElement - question that was responded to
        choice - chosen response, null if no answer was chosen
        numberOfAttempts - number of times this question was listened
      • addOrUpdateMessageLog

        public void addOrUpdateMessageLog​(java.time.LocalDateTime startDate,
                                          java.time.LocalDateTime endDate,
                                          CallFlowElement callFlowElement)
        Add Message Log.
        Parameters:
        startDate - question start date
        endDate - question end date
        callFlowElement - message that was listened
      • resetProgressForUnitRepeat

        public void resetProgressForUnitRepeat()
        Reset unit progress and increment number of replays.