docs/architecture/sessions.mdDescribe the role of sessions in the learning engine and their lifecycle.
This document specifies:
Session is,Internal exercise details are described in exercises.md.
A Session is a runtime orchestrator.
It is responsible for:
It is not responsible for:
%%{init: {"class": {"hideEmptyMembersBox": true}} }%%
classDiagram
namespace Answer {
class ExerciseAnswer
class SubmittedExerciseAnswer
class PreviewExerciseAnswer
}
class SessionType
class Session
class Exercise
class SessionResult
class SRSConfig
class ExerciseScheduler
Session --> ExerciseScheduler : Orchestrate
Session <-- SessionType : Initialisation
ExerciseScheduler "1" --> "0..*" Exercise : Schedule
Session "1" --> "1" SRSConfig : config
Session "1" --> "1" SessionResult : result
ExerciseAnswer <|-- SubmittedExerciseAnswer
ExerciseAnswer <|-- PreviewExerciseAnswer
Session ..> ExerciseAnswer : submit / preview
A session follows a strict lifecycle:
Creation
A session is created with:
Exercise objects,SessionType,SRSConfig.No exercise is yet active.
Start
begin).Execution
The session:
ExerciseShceduler for the next exercise,ExerciseAnswer) by the application layer,End
Session.isSessionFinished() tell you when there are no exercise left.SessionResult is produced when the session is terminated.The ExerciseScheduler:
determines the presentation order based on:
ExerciseStatus, SRSState),The Scheduler:
When a user response is submitted:
ExerciseAnswer.The exercise:
SessionResult, then selects the next exercise.The session does not know:
Grade, durations),The session distinguishes two types of user interactions:
SubmittedExerciseAnswer)
SessionResult,PreviewExerciseAnswer)
This distinction guarantees that:
A SessionType represents the pedagogical intent of the session.
It is used:
It is not a long-lived state of the session and does not influence its internal behaviour after initialisation.
A SessionResult is a summary object.
It is created during initialisation and updated after each response.
It aggregates:
It contains:
The session ignores: