Aphasiatherapy SimpTell is the adaptive home-training companion inside the wider
aphasiatherapy_umbrella. It enables people with aphasia to practice
elliptical constructions. This README documents the functional structure, object model, and collaborative work streams that underpin the SimpTell application.
This export is purely for informational purposes, and is not meant to be runnable stand-alone. This code is meant to be executed within the proprietary AphasiaTherapy environment, and depends on functionality excluded from this export.
- Umbrella topology: SimpTell is an umbrella child application that plugs
into the shared authentication (
Aphasiatherapy.Guardian), storage (Aphasiatherapy.GcpStorageHelper), and domain contexts defined in the parent apps. This allows us to reuse account management, client onboarding, and logging pipelines without duplicating work. - Phoenix LiveView delivery: The client-facing experience lives in
AphasiatherapySimptell.CyclusLiveand companion LiveView components. This stream handles the sequencing of exercises, the adaptive feedback loop, and renders the different interaction stages (introduction, word ordering, word form selection). - Audio processing services: Speech capture and verification are encapsulated
in
AphasiatherapySimptell.SpeechToText. The module abstracts the Google Cloud Speech-to-Text workflow, including token brokerage via Goth, encoding, remote API invocation, and transcript matching heuristics. - Domain orchestration: Generator and Validator modules manage the therapy
cycle logic. They cooperate with shared
Aphasiatherapy.Simptellcontexts so SimpTell keeps stateful awareness of each client’s level, answered sentences, and progression rules.
- Client (
Aphasiatherapy.Accounts.Client): Represents the individual learner. Relevant attributes include the active SimpTell level, references to assigned sentences, and permissions for media access. - Cyclus (
Aphasiatherapy.Simptell.ClientCyclus): A cyclus is a therapy session consisting of an ordered set of sentences at a specific difficulty level. The generator ensures that a learner always resumes an unfinished cyclus before a new one is created. - Sentence (
Aphasiatherapy.Simptell.Sentence): A sentence is the main unit of training content. It aggregates grammatical metadata, word entities, and an optionalphoto_idthat links to supportive imagery hosted in cloud storage. - Word (
Aphasiatherapy.Simptell.Word): Words store grammatical constituents (subject, verb, etc.). They are used both for validating word order and for rendering visual cues during exercises. - Answer (
Aphasiatherapy.Simptell.ClientCyclusAnswer): Answers capture the learner’s progress, chosen word order, selected word forms, and scoring. This persisted state powers adaptive level changes and ensures repeat sessions pick up exactly where the client left off.
-
Session bootstrapping
CyclusLive.mount/3authenticates the learner, fetches an active cyclus, and prepares the first sentence. The generator either instantiates a new cyclus or restores the latest unfinished session. -
Guided introduction
Each sentence begins with an intro step. Support audio for this stage is served from Google Cloud Storage through signed URLs generated byGcpStorageHelper. -
Word-order exercise
Learners arrange draggable word cards. The chosen ordering is validated by theValidatormodule, which enforces grammatical rules (notAfterV,notBeforeS, etc.) on top of the word metadata. -
Word-form exercise
Once order is correct, the interface switches to selecting correct word forms. Answers are stored (viaClientCycluses.insert_client_cyclus/1andClientCyclusAnswershelpers), enabling detailed progress tracking. -
Adaptive feedback
After each sentence the LiveView computes per-step scores, applies adaptivity rules, and surfaces level adjustments (move up, stay, move down). These adjustments respect the global SimpTell level boundaries and keep the learner in a productive challenge zone. -
Completion & reporting
When a cyclus is exhausted, the interface updates the learner with summary feedback and provisions the next appropriate level. Persisted records are available to therapists for longitudinal insights.
- UI component library (
lib/aphasiatherapy_simptell_web/components) provides a shared set of cards, dialog boxes, audio controls, and layout elements that keep the interface consistent with the wider Aphasiatherapy product line. - Audio assistive tooling
AudioPlayerLiveComponents and helper dialogs coordinate playback of guidance audio, reinforcing the multi-modal learning approach. - Cloud integration
SpeechToTexthandles offloading recognition to Google Cloud. It normalizes textual results and feeds them back into the LiveView workflow for instant feedback. Logging hooks are already in place to capture network or API failures for audit purposes. - Testing foundation
Thetest/directory includes targeted unit tests for the generator, validator, and LiveView flows. These form the basis for regression protection as we extend content, add languages, or refine adaptivity heuristics.