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 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 that it has; the others answer unimplemented, until the tasks of epic E3 that build them — the engine's choice.
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 ¶
- type AttemptService
- func (a *AttemptService) BeginStep(ctx context.Context, req *v1.BeginStepRequest) (*v1.BeginStepResponse, error)
- func (a *AttemptService) Done(ctx context.Context, req *v1.DoneRequest) (*v1.DoneResponse, error)
- func (a *AttemptService) ExplainDifferently(ctx context.Context, req *v1.ExplainDifferentlyRequest) (*v1.ExplainDifferentlyResponse, error)
- func (a *AttemptService) GetCorrectAnswerWords(ctx context.Context, req *v1.GetCorrectAnswerWordsRequest) (*v1.GetCorrectAnswerWordsResponse, error)
- func (a *AttemptService) GetHint(ctx context.Context, req *v1.GetHintRequest) (*v1.GetHintResponse, error)
- func (a *AttemptService) GetRungWords(ctx context.Context, req *v1.GetRungWordsRequest) (*v1.GetRungWordsResponse, error)
- func (a *AttemptService) ReportProblem(ctx context.Context, req *v1.ReportProblemRequest) (*v1.ReportProblemResponse, error)
- func (a *AttemptService) ShowSolution(ctx context.Context, req *v1.ShowSolutionRequest) (*v1.ShowSolutionResponse, error)
- func (a *AttemptService) SubmitWork(ctx context.Context, req *v1.SubmitWorkRequest) (*v1.SubmitWorkResponse, error)
- type LearningService
- func (l *LearningService) BeginAttempt(ctx context.Context, req *v1.BeginAttemptRequest) (*v1.BeginAttemptResponse, error)
- func (l *LearningService) ChooseNext(ctx context.Context, req *v1.ChooseNextRequest) (*v1.ChooseNextResponse, error)
- func (l *LearningService) CompleteLesson(ctx context.Context, req *v1.CompleteLessonRequest) (*v1.CompleteLessonResponse, error)
- func (l *LearningService) GetLessonRun(ctx context.Context, req *v1.GetLessonRunRequest) (*v1.GetLessonRunResponse, error)
- func (l *LearningService) GetOpenAttempt(ctx context.Context, req *v1.GetOpenAttemptRequest) (*v1.GetOpenAttemptResponse, error)
- func (l *LearningService) OpenLesson(ctx context.Context, req *v1.OpenLessonRequest) (*v1.OpenLessonResponse, error)
- type Option
- type ProgressService
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
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 ¶
func (a *AttemptService) BeginStep(ctx context.Context, req *v1.BeginStepRequest) (*v1.BeginStepResponse, error)
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 ¶
func (a *AttemptService) Done(ctx context.Context, req *v1.DoneRequest) (*v1.DoneResponse, error)
Done ends an attempt of a task with a rubric (R14). A task with a verdict takes no "Done", and an attempt of a task with a rubric has no submission before the rubric's code sends one: it is "no submission".
func (*AttemptService) ExplainDifferently ¶ added in v0.1.17
func (a *AttemptService) ExplainDifferently(ctx context.Context, req *v1.ExplainDifferentlyRequest) (*v1.ExplainDifferentlyResponse, error)
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
func (a *AttemptService) GetCorrectAnswerWords(ctx context.Context, req *v1.GetCorrectAnswerWordsRequest) (*v1.GetCorrectAnswerWordsResponse, error)
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, and one the profile left for another, get "no more words". tutor has no call for these words yet (В47 RUN.md), so the answer holds none, with the outcome "not admitted": no call went, and nothing is spent. The work is checked for its form and goes nowhere. A repeat under the key gets the same, without words: the server keeps none.
func (*AttemptService) GetHint ¶ added in v0.1.17
func (a *AttemptService) GetHint(ctx context.Context, req *v1.GetHintRequest) (*v1.GetHintResponse, error)
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
func (a *AttemptService) GetRungWords(ctx context.Context, req *v1.GetRungWordsRequest) (*v1.GetRungWordsResponse, error)
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
func (a *AttemptService) ReportProblem(ctx context.Context, req *v1.ReportProblemRequest) (*v1.ReportProblemResponse, error)
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
func (a *AttemptService) ShowSolution(ctx context.Context, req *v1.ShowSolutionRequest) (*v1.ShowSolutionResponse, error)
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).
func (*AttemptService) SubmitWork ¶
func (a *AttemptService) SubmitWork(ctx context.Context, req *v1.SubmitWorkRequest) (*v1.SubmitWorkResponse, error)
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). 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).
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 ¶
func (l *LearningService) BeginAttempt(ctx context.Context, req *v1.BeginAttemptRequest) (*v1.BeginAttemptResponse, error)
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 with a rubric is not admitted: its path is not in this code (R14). A task of handwriting begins when tutor reads its form — a handwriting sheet with one answer slot bound anywhere — and the gate of admission chooses models to read it, by platform AI or the own key named (R45, R46). 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, 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
func (l *LearningService) ChooseNext(ctx context.Context, req *v1.ChooseNextRequest) (*v1.ChooseNextResponse, error)
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. A skill that no module of the engine has is "not found", and nothing is closed. 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
func (l *LearningService) CompleteLesson(ctx context.Context, req *v1.CompleteLessonRequest) (*v1.CompleteLessonResponse, error)
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". 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
func (l *LearningService) GetLessonRun(ctx context.Context, req *v1.GetLessonRunRequest) (*v1.GetLessonRunResponse, error)
GetLessonRun is an open lesson run again, by its ID, after a restart or on another device, checked as OpenLesson checks it. It repeats by the state of the run.
func (*LearningService) GetOpenAttempt ¶
func (l *LearningService) GetOpenAttempt(ctx context.Context, req *v1.GetOpenAttemptRequest) (*v1.GetOpenAttemptResponse, error)
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
func (l *LearningService) OpenLesson(ctx context.Context, req *v1.OpenLessonRequest) (*v1.OpenLessonResponse, error)
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 — a task with a rubric, a workbook, or handwriting AI may not read for the learner — is not checked here: its attempt is "not admitted", and the run stays open (Д26 RUN.md).
type Option ¶
type Option func(*Service)
Option sets what a Service runs on, for the tests.
func WithRequestTimeout ¶ added in v0.1.17
WithRequestTimeout is the longest a request may run, as the server bounds it (R33).
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
func (p *ProgressService) GetProgress(ctx context.Context, req *v1.GetProgressRequest) (*v1.GetProgressResponse, error)
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); an essay's submissions come with the path of a task with a rubric (R14).
func (*ProgressService) GetSkillMap ¶ added in v0.1.18
func (p *ProgressService) GetSkillMap(ctx context.Context, req *v1.GetSkillMapRequest) (*v1.GetSkillMapResponse, error)
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. Each anchor skill has the modules of the index that teach it, suit the learner 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 ¶
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.