Package org.motechproject.mots.domain
Class UnitProgress
- java.lang.Object
-
- org.motechproject.mots.domain.BaseEntity
-
- org.motechproject.mots.domain.BaseTimestampedEntity
-
- org.motechproject.mots.domain.UnitProgress
-
@Entity public class UnitProgress extends BaseTimestampedEntity
-
-
Constructor Summary
Constructors Constructor Description UnitProgress(Unit unit, ModuleProgress moduleProgress)Create new Unit Progress.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddOrUpdateMessageLog(java.time.LocalDateTime startDate, java.time.LocalDateTime endDate, CallFlowElement callFlowElement)Add Message Log.voidaddOrUpdateMultipleChoiceQuestionLog(java.time.LocalDateTime startDate, java.time.LocalDateTime endDate, CallFlowElement callFlowElement, Choice choice, java.lang.Integer numberOfAttempts)Add Multiple Choice Question Log.voidendUnit()java.util.ListIterator<CallFlowElement>getCallFlowElementsIterator()Get call flow elements list iterator starting from current element.booleanisCompleted()voidresetProgressForUnitRepeat()Reset unit progress and increment number of replays.voidstartUnit()
-
-
-
Constructor Detail
-
UnitProgress
public UnitProgress(Unit unit, ModuleProgress moduleProgress)
Create new Unit Progress.- Parameters:
unit- Unit which progress will be storedmoduleProgress- 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 dateendDate- question end datecallFlowElement- question that was responded tochoice- chosen response, null if no answer was chosennumberOfAttempts- 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 dateendDate- question end datecallFlowElement- message that was listened
-
resetProgressForUnitRepeat
public void resetProgressForUnitRepeat()
Reset unit progress and increment number of replays.
-
-