learning

package
v0.1.49 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 45 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package learning runs attempts of tasks (R44, R46, R47): their beginning, the open attempt, the submission of the work and its verdict by module-kit, on the options tapped and on what tutor read, the submission of an essay and its feedback by the rubric (R82), the techniques a solving step gives, "Done", the hint ladder with the tutor's words and their fallback texts, the showing of the solution, and lesson runs with their segments (R48). It answers the methods of LearningService and AttemptService, and keeps the stored works of WorkService too (R70), whose kind is the attempt's task's.

Every request is a learning request on a profile, whose right the checks hold before it (R33), and a profile whose consent is not confirmed is refused. An attempt is read by the pair of its profile and its ID, its row held for the request: one of another profile, or none, is "not found" (R04).

Index

Constants

View Source
const MaxWork = 4 << 20

MaxWork is the largest stored work, as StoredWork counts it: the bytes of its history, of the contexts of its submissions and of its picture (R113 spec).

Variables

This section is empty.

Functions

func WorkMalformed added in v0.1.39

func WorkMalformed(work *v1.StoredWork) string

WorkMalformed is the field of the work whose form the contract refuses, or none (contract, section 15): its history a JSON array and each context a JSON object, in UTF-8, so that the export writes them as the JSON they are; each count of the history's events not below zero, as the export's schema asks; and its picture a PNG by its signature. Nothing more is read of them.

Types

type AttemptService

type AttemptService struct {
	apiv1connect.UnimplementedAttemptServiceHandler
	// contains filtered or unexported fields
}

AttemptService is the requests on an attempt: the submission of the work, the beginning of a step and "Done", the hint ladder and the showing of the solution.

func (*AttemptService) BeginStep

BeginStep begins a solving step whose gives gives techniques, by its place: the answer is the IDs of the task's techniques, and the attempt records that they were given at a step, the first time (R82 spec). A repeat gets the same.

func (*AttemptService) Done

Done ends an attempt of a task with a rubric by the learner's "Done" (R14): once it has a submission, however that ended, the attempt is closed "done" in one transaction, with no evidence, and the answer is the task solved — the criteria of its rubric and its solution, if it has one (R87 spec) — and what comes next: in a lesson the segment after its own, which "done" ends (R13), and outside a lesson the engine's choice (R50). A task with a verdict takes no "Done", and an attempt with no submission yet is "no submission". It carries no key: a repeat on an attempt closed "done" gets the same answer, by the state of the attempt, with the choice the close gave; one closed otherwise is "closed". A provider named for a learner who is not an adult is refused, as at every request whose answer may give an engine's choice (R65).

func (*AttemptService) ExplainDifferently added in v0.1.17

ExplainDifferently words the current rung anew, without the work (R10, R47): one call of AI on a rung, for the wrong answer the request names, with the tutor's questions asked so far. Its words, once they passed the leak check and the form check, or the rung's fallback text, are what the learner reads on the rung from then on; when they are the words the learner reads already, the outcome says so, and the right is spent all the same, as it is once the call went. On platform AI a deployment that admits no model for the words makes no call and refuses "not admitted", and the right stays; on an own key that is an outcome. From the fourth wrong answer on it words the third rung, if it was not asked for there already, for the count of any wrong answer from the third on. A repeat under the key gets the words the attempt keeps, with the outcome it got, and no AI.

func (*AttemptService) GetCorrectAnswerWords added in v0.1.17

GetCorrectAnswerWords gives the tutor's words after a correct answer, once, on the attempt that the answer has just closed, while the profile has begun no other (R09): an attempt closed otherwise, or open, one the profile left for another, and one whose words were given already get "no more words". The words are the model's praise and its question on the technique that helped, once they passed the leak check and the form check of tutor's words.Correct; words that fail a check, or a call that gives none, leave the answer without words, with the outcome of a call that gave none, and the right stays: a later request may ask again. The work goes when AI read the task, as the crop of a sheet, and only to the call. When the deployment admits the words and the privacy policy in force on the day covers them, the call runs between two transactions (rpc.Across); otherwise the answer holds no words, with the outcome "not admitted", and nothing is spent. A repeat under the key gets the answer without words: the server keeps none.

func (*AttemptService) GetHint added in v0.1.17

GetHint is a hint the learner asks for, with no AI and no work (R10): before the first wrong answer, and on a task with a rubric, the IDs of the task's techniques and its leading question, of the instance the attempt got, when it has one — which the attempt records as given, each only when the task has it, and which is an action on the attempt, as a step is; after it, the words of the current rung that the attempt keeps, or its fallback text, with no question (R47; R108 spec). It repeats by the attempt's state.

func (*AttemptService) GetRungWords added in v0.1.17

GetRungWords gives the words of the rung a wrong answer gave, which the request names by the count of wrong answers of its submission's answer and sends the work of again (R10, R47): the tutor's question, once it passed the leak check and the form check, with the box of the first mistake as a mark, or the rung's fallback text. The attempt keeps them until it closes. Words that do not come are no refusal: the fallback text comes with the outcome. From the fourth wrong answer on no rung is new, and the words of the same wrong answer asked again, or a repeat under the key, are the words the attempt keeps, with no AI and no marks. When the deployment admits the words, the call runs between two transactions, as the reading does (rpc.Across).

func (*AttemptService) ReportProblem added in v0.1.21

ReportProblem records an adult's report of a problem with a reply of the tutor, on an attempt of the profile, open or closed, which the operator reads by a command of api and reviews in 3 days (R123 spec). It keeps the words and the text as they were written, nothing of the work beyond them, and outlives the deletion of the profile and the account to its term, without their IDs. Neither a consent that waits nor an age to give again refuses it. A repeat under its key is the same report.

func (*AttemptService) ShowSolution added in v0.1.17

ShowSolution shows the solution and closes the attempt "solution shown" (R09), under its idempotency key, by a learning action or by an action of an adult, whose right can_manage the handler checks: the checks before it hold can_learn alone. A task with a rubric has nothing to show this way; a child is shown it from the fourth wrong answer on, by either kind of action, and, while the child's setting "ask before showing" is on, by an adult's alone; a learner of the category adult from the beginning. The close deletes the words of the rungs (R05). The answer, the task solved, is what the key's record holds, with what comes next: in a lesson, the next segment (R48); outside a lesson, the engine's choice (R50), on the route own_key_provider names (R65).

func (*AttemptService) SubmitEssay added in v0.1.49

SubmitEssay sends the sheet of a task with a rubric for its feedback, under its idempotency key: one request, two calls of tutor (R14, R82). The crop of the sheet is read by one reader, and the text read is assessed by the criteria of the rubric, with the statement as its topic, the style of the learner's category and the module's language of explanations; the feedback goes once it passes the leak check and the rule of feedback, words.Feedback, and without it the answer has none, and app shows "no feedback this time". The submission ends "feedback", "unreadable" — the reading said the sheet as a whole cannot be read, and the assessment is not called — or "unchecked", with the outcome of a call that gave nothing, or none when the assessment assessed no criterion. The request goes in three parts (rpc.Across): the checks of the attempt and the crop, and the reserve of the reading together with the assessment (R12), beside the key's record going; the two calls; and the attempt held again, with the submission recorded — how it ended, and beside feedback the marks and the source of the words, never the text, the evidence or the words (R15). An attempt closed meanwhile by another device is no refusal: the answer comes from the request's memory, names the close, and nothing is recorded. A repeat under the key gets the answer without the text and the words, repeated.

func (*AttemptService) SubmitWork

SubmitWork checks a submission of a task with a verdict, under its idempotency key: the verdict of every item and answer slot, by module-kit, on the options tapped and on what tutor's two readers read of the crop of a handwriting sheet (R46) or of the crops of a workbook page's filled boxes (R81). A submission with an answer slot "not_yet" is a wrong answer; "unreadable" and "unchecked" are none (R09). One whose every item is correct closes the attempt "correct", and its answer holds the task solved, its keys and its solution (R05 spec). A call of AI that gives no reading is no refusal: the slots AI reads get "unchecked", and the answer names the outcome. The submission is recorded with its answer and, when AI read, the observation of what it read; the key's record names it (architecture 3.2), and the crop lives in the request's memory alone (R15).

A task tapped alone is checked in one transaction (rpc.Once). One that AI reads runs in three parts (rpc.Across): the checks of the attempt and the work, and the key's record going, in one transaction; the reading, in none; and the attempt held again with the verdict and the record done, in a second. An attempt closed meanwhile — by another device that began another — is "closed", and nothing is written. An answer that closes the attempt says what comes next in a lesson: the next segment, or that none is left (R48); outside a lesson, the engine's choice (R50), on the route of the own key's provider, or of own_key_provider when the submission sends neither work nor own key — beside either it is malformed —, or else platform AI (R65).

type LearningService

type LearningService struct {
	apiv1connect.UnimplementedLearningServiceHandler
	// contains filtered or unexported fields
}

LearningService is the way from a module to a task: here, the beginning of an attempt and the open attempt.

func (*LearningService) BeginAttempt

BeginAttempt begins an attempt, under its idempotency key: by an engine's choice of a task, or the same task again outside a lesson, each on the current version of its module (R07). It closes the profile's open attempt in the same transaction: "left", or as the check of a request would have closed it (R10). The module must be connected and have a current version for the learner that holds the task, and the task must suit the age category of the profile (R51 spec). A task of handwriting begins when tutor reads its form — a handwriting sheet with one answer slot bound anywhere, or a workbook — and the gate of admission chooses models for its kind of call, by platform AI or the own key named (R45, R46, R81); a task with a rubric, when tutor reads it as an essay and the gate chooses models for its reading and its assessment both (R82). A task segment of a lesson run begins on the run's package, once the run is checked whole and every task segment before it has ended, and it has not; its open attempt is given as it is (R13, R48), and waits, if the quota ran out on it. On platform AI a task that AI checks begins only with room for a typical task left of the family day — of handwriting, or with a rubric —, and while the limit of its provider leaves platform AI open: else "quota", with when the next day begins, or "platform limit" (R11, R59). A refusal of the admission, the quota or the limit leaves the run open. The answer, the attempt with the open view of its task, is what the key's record holds: it names nothing the learner sent.

func (*LearningService) ChooseNext added in v0.1.19

ChooseNext is "something else", under its idempotency key (R50): the open attempt is closed "left" — or as the check of a request would close it — and the engine chooses what comes next, with the skill the learner chose on the skill map, or, with none, as it leads, on the route to AI the request names by own_key_provider, as BeginAttempt by the same route would begin a task (R65). A skill that no module of the engine has is "not found", and nothing is closed; a provider named for a learner who is not an adult is refused. The answer, the choice, is what the key's record holds: a repeat gets the same choice.

func (*LearningService) CompleteLesson added in v0.1.17

CompleteLesson is "lesson done": it ends the run "passed" once every task segment of the lesson has ended, and earlier refuses "segments not ended" with the places of those that have. A run that ended "passed" gets the same answer again, the engine's choice that the end gave with it (R50); one that ended otherwise, "run ended". The choice goes by the route the request names (R65). It is no check of the lesson: only of its package and its term (R13). It repeats by the state of the run.

func (*LearningService) GetLessonRun added in v0.1.17

GetLessonRun is an open lesson run again, by its ID, after a restart or on another device, checked as OpenLesson checks it, and with the choice of an end on the route it names. It repeats by the state of the run.

func (*LearningService) GetOpenAttempt

GetOpenAttempt is the open attempt, by which the learner goes on with it on another device too: its beginning, the verdicts of its last submission, how many wrong answers it has, the current rung with the words the attempt keeps for it or its fallback text, and whether "explain differently" was asked for on it, and the techniques given at a step and on request, with the leading question given on request (R47). It reads, and so it is no action on the attempt: its last action stays.

func (*LearningService) OpenLesson added in v0.1.17

OpenLesson opens the lesson of an engine's choice (R13): the open run of the lesson, when the profile has one, or else a new run on the package of the module's current version, which the module connected, its current version for the learner with the lesson, and the lesson and each of its tasks suited to the learner allow. A choice opens one run: once it has ended, the choice gets "run ended". Two openings at once give the one run: the second reads the first's again. It carries no key and repeats by the state of the run. A segment that this code cannot begin for the learner — a task whose kinds of call the gate does not admit on the route, an essay's or a sheet's or a workbook page's (R50), or one in a zone or on the whole sheet — is not checked here: its attempt is "not admitted", and the run stays open (R48; Д26). The segment of a task with a rubric ends once its attempt is closed "done" (R13). The choice an end of its run gives goes by the route own_key_provider names (R65).

type Option

type Option func(*Service)

Option sets what a Service runs on: for the tests, and the dev mode's stub.

func WithClock

func WithClock(now func() time.Time) Option

WithClock is the clock a Service tells the time of its actions by.

func WithRequestTimeout added in v0.1.17

func WithRequestTimeout(d time.Duration) Option

WithRequestTimeout is the longest a request may run, as the server bounds it (R33).

func WithTexts added in v0.1.46

func WithTexts(texts *legal.Texts) Option

WithTexts is the legal texts api serves, those of the tag by default (legal.Spec): a self-hosted copy's folder.

func WithTutor added in v0.1.35

func WithTutor(t interface {
	sheetReader
	wordsTeller
	correctTeller
	admitter
	workbookReader
	essayReader
	rubricAssessor
}) Option

WithTutor is what reads the sheets, the workbook pages and the essays, assesses the essays by their rubrics and words the tutor's words, those after a correct answer too, and says which kinds of reading are admitted, in place of the gate's tutor: the dev mode's stub (R66), which calls no provider and admits a workbook page, an essay and its assessment itself (the 2026-11-15 amendments to R66).

type ProgressService added in v0.1.18

type ProgressService struct {
	apiv1connect.UnimplementedProgressServiceHandler
	// contains filtered or unexported fields
}

ProgressService is what the learner model and the history of a profile show (R49): the skill map and the adult's progress. Both write first the evidence the profile's closed attempts owe, so that they read the journal whole.

func (*ProgressService) GetProgress added in v0.1.18

GetProgress is the progress of a profile, which an adult views with the right can_view, which the checks hold (R49): its attempts, newest first, a page at a time, and, on the first page, the traps that repeat in its closed attempts. Each attempt has when the engine chose its task, or its run's lesson, and why — but one begun again (R50) —, and an attempt with a rubric each of its submissions, how it ended and, once the attempt is closed, the marks of its feedback (R15, R82).

func (*ProgressService) GetSkillMap added in v0.1.18

GetSkillMap is the state of the skills of a connected module's current version, as learner-model reads it at the time of the request: by a learning action, whose profile's consent is confirmed, or by an adult's view, with the right can_view, which the handler checks — the checks before it hold can_learn alone. A module not connected is "not found", and one with no current version for the learner says so, as one the deployment's list leaves out does (R150 spec). Each anchor skill has the modules of the index that teach it, suit the learner, are on the list and are not connected (R63 spec).

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service runs the attempts of the profiles on the packages the image holds.

func New

func New(set *packages.Set, gate *admission.Gate, opts ...Option) (*Service, error)

New is the Service of the packages of set, which asks gate before a task that AI checks; its handlers run on the database they are given. A binary that recorded no version of module-kit is refused, before anything is opened: every attempt keeps it. So is no gate, and a binary that recorded no version of learner-model, which the mark of the learner model's cache names, or of engine, which every choice keeps.

func (*Service) Attempts

func (s *Service) Attempts(db rpc.DB, rights canner) *AttemptService

Attempts is the AttemptService of s, on db, which asks rights of an adult's action.

func (*Service) Learning

func (s *Service) Learning(db rpc.DB) *LearningService

Learning is the LearningService of s, on db.

func (*Service) Progress added in v0.1.18

func (s *Service) Progress(db rpc.DB, rights canner) *ProgressService

Progress is the ProgressService of s, on db, which asks rights of an adult's view of the skill map.

func (*Service) Works added in v0.1.39

func (s *Service) Works(db rpc.DB, rights canner) *WorkService

Works is the WorkService of s, on db, which asks rights of an adult's action.

type WorkService added in v0.1.39

type WorkService struct {
	apiv1connect.UnimplementedWorkServiceHandler
	// contains filtered or unexported fields
}

WorkService is the stored works of the profiles (R70): each work of a profile as the device holds it, which api keeps while the storage of the profile's works is on, reads no more of than its form, and gives to no AI provider (R113 spec; contract, section 15). Each request repeats by the state of the profile's works, with no idempotency key.

func (*WorkService) DeleteWork added in v0.1.39

DeleteWork erases one stored work of the profile, by whoever decides the storage of its works, as SetWorkStorage: an adult's action by can_manage, and at a profile whose learner gave their own consent, the learner's learning request, which is checked as every learning request is. Who decides is read without a lock. The answer is "erased", of an attempt of the profile with no work kept too; the work on the device stays.

func (*WorkService) GetWork added in v0.1.39

func (w *WorkService) GetWork(ctx context.Context, req *v1.GetWorkRequest) (*v1.GetWorkResponse, error)

GetWork is one stored work of the profile, whole, as it was put, with its kind and when it was kept: as ListWorks. An attempt with no work kept, or not the profile's, is "not found".

func (*WorkService) ListWorks added in v0.1.39

ListWorks is the profile's stored works, newest first, without their bytes: a learning request, or an adult's action by can_manage. While the storage is off there are none: switching it off erased them.

func (*WorkService) PutWork added in v0.1.39

func (w *WorkService) PutWork(ctx context.Context, req *v1.PutWorkRequest) (*v1.PutWorkResponse, error)

PutWork keeps the work of an attempt of the profile, in the place of the one kept of it before, while the storage of the profile's works is on: a learning request. The work is checked before anything is read of the attempt — its size, then its form, which every stored work must have to go into the export —, and kept as a StoredWork of the fields the contract names alone: a field it does not name, which binary protobuf carries, is neither kept nor counted. Its kind comes of the attempt's task, and when it was kept of the clock.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL