Created
February 4, 2021 14:05
-
-
Save tsimbalar/cf9568be90c161ac302404b223b554cb to your computer and use it in GitHub Desktop.
exercise status
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// from the outside we see : | |
abstract class Step{ | |
bool get isLocked; // computed based on the state of previous steps | |
// = !(previousExercise === null || previousExercise.isMarkedAsCompleted) | |
bool get isFinished; // computed based on the fact that all the exercises in this step are completed | |
// == step.exercises.all.status === finished | |
// probably need a different term between completed vs finished ? | |
// THIS ONE IS THE ONLY INFO WE NEED TO PERSIST | |
bool get isMarkedAsCompleted; // user has deliberately clicked the "go to next button" | |
} | |
enum ExerciseCompletionStatus{ | |
notStarted, | |
started, | |
finished | |
} | |
abstract class Exercise { | |
bool get isLocked; // computed based on the state of previous exercises and steps | |
// == ! ( (previousStep== null && previousExercise == null) || (previousExercise == null && previousStep.isMarkedAsCompleted) || (previousExercise.finished) ) | |
// THIS ONE NEEDS TO BE PERSISTED | |
// initially notStarted | |
// changes to started when we start adding a schedule activity or logging activity | |
// moves to finished when user clicks finish at end of slides for Practice exercises .... or after a week ellapses for Scheduling activity | |
ExerciseCompletionStatus get completionStatus ; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment