Documentation
¶
Overview ¶
Package learning runs attempts of tasks: 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, "Done", the hint ladder with the tutor's words and their fallback texts, grown-up mode, lesson runs with their segments, and the tasks from the learner's paper, found on the photo of a page. It answers the methods of LearningService, AttemptService and PaperService, and keeps the stored works of WorkService too, whose kind is the attempt's task's.
Every request is a learning request on a profile, whose right the checks hold before it, 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".
Index ¶
- Constants
- func WorkMalformed(work *v1.StoredWork) string
- type AttemptService
- func (a *AttemptService) AskGrownUp(ctx context.Context, req *v1.AskGrownUpRequest) (*v1.AskGrownUpResponse, error)
- func (a *AttemptService) AskTutor(ctx context.Context, req *v1.AskTutorRequest) (*v1.AskTutorResponse, 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) GetCheckProgress(ctx context.Context, req *v1.GetCheckProgressRequest) (*v1.GetCheckProgressResponse, 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) GetOpeningWords(ctx context.Context, req *v1.GetOpeningWordsRequest) (*v1.GetOpeningWordsResponse, error)
- func (a *AttemptService) GetRungWords(ctx context.Context, req *v1.GetRungWordsRequest) (*v1.GetRungWordsResponse, error)
- func (a *AttemptService) ReadStatement(ctx context.Context, req *v1.ReadStatementRequest) (*v1.ReadStatementResponse, error)
- func (a *AttemptService) ReportProblem(ctx context.Context, req *v1.ReportProblemRequest) (*v1.ReportProblemResponse, error)
- func (a *AttemptService) SubmitEssay(ctx context.Context, req *v1.SubmitEssayRequest) (*v1.SubmitEssayResponse, error)
- func (a *AttemptService) SubmitWork(ctx context.Context, req *v1.SubmitWorkRequest) (*v1.SubmitWorkResponse, error)
- type Goals
- 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) ListLessons(ctx context.Context, req *v1.ListLessonsRequest) (*v1.ListLessonsResponse, error)
- func (l *LearningService) OpenLesson(ctx context.Context, req *v1.OpenLessonRequest) (*v1.OpenLessonResponse, error)
- func (l *LearningService) PreviewGoal(ctx context.Context, req *v1.PreviewGoalRequest) (*v1.PreviewGoalResponse, error)
- type Option
- func OffDeployment() Option
- func WithClock(now func() time.Time) Option
- func WithDebug(d *debug.Store) Option
- func WithGrownUpRequestTimeout(d time.Duration) Option
- func WithPaperRequestTimeout(d time.Duration) Option
- func WithRequestTimeout(d time.Duration) Option
- func WithTexts(texts *legal.Texts) Option
- func WithTutor(t interface{ ... }) Option
- type PaperService
- type ProgressService
- func (p *ProgressService) GetCognitiveMap(ctx context.Context, req *v1.GetCognitiveMapRequest) (*v1.GetCognitiveMapResponse, error)
- func (p *ProgressService) GetIndicators(ctx context.Context, req *v1.GetIndicatorsRequest) (*v1.GetIndicatorsResponse, error)
- func (p *ProgressService) GetMapHistory(ctx context.Context, req *v1.GetMapHistoryRequest) (*v1.GetMapHistoryResponse, error)
- func (p *ProgressService) GetProgress(ctx context.Context, req *v1.GetProgressRequest) (*v1.GetProgressResponse, error)
- func (p *ProgressService) GetSkillMap(ctx context.Context, req *v1.GetSkillMapRequest) (*v1.GetSkillMapResponse, error)
- func (p *ProgressService) SetModuleLevel(ctx context.Context, req *v1.SetModuleLevelRequest) (*v1.SetModuleLevelResponse, error)
- type Service
- func (s *Service) Attempts(db rpc.DB) *AttemptService
- func (s *Service) Goals(db rpc.DB) *Goals
- func (s *Service) Learning(db rpc.DB) *LearningService
- func (s *Service) Paper(db rpc.DB) *PaperService
- func (s *Service) Progress(db rpc.DB, rights canner) *ProgressService
- func (s *Service) Works(db rpc.DB, rights canner) *WorkService
- type WorkService
- func (w *WorkService) DeleteWork(ctx context.Context, req *v1.DeleteWorkRequest) (*v1.DeleteWorkResponse, error)
- func (w *WorkService) GetWork(ctx context.Context, req *v1.GetWorkRequest) (*v1.GetWorkResponse, error)
- func (w *WorkService) ListWorks(ctx context.Context, req *v1.ListWorksRequest) (*v1.ListWorksResponse, error)
- func (w *WorkService) PutWork(ctx context.Context, req *v1.PutWorkRequest) (*v1.PutWorkResponse, error)
Constants ¶
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.
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: 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, "Done", the hint ladder and grown-up mode. BeginStep and ShowSolution, which no screen asks any more, answer unimplemented: the checks before the handler know neither.
func (*AttemptService) AskGrownUp ¶ added in v0.1.81
func (a *AttemptService) AskGrownUp(ctx context.Context, req *v1.AskGrownUpRequest) (*v1.AskGrownUpResponse, error)
AskGrownUp answers a grown-up's request in grown-up mode on a task from paper or of a module: one call of the drawing, CallDrawing, which reads the work's crop, the task's picture — the crop of a task from paper, or the picture app drew of a module's text —, the strokes the work shows, the conversation and the request, and gives the tutor's words with its act on the sheet. It needs no Check, and none is asked. The right is an adult's, can_manage, which the table of methods checks. No admission, the quota, the limit and a call that gives no act answer the outcome alone. Nothing of the request or the answer is kept: the record of the key holds nothing, so a repeat gets repeated alone, and the key's fingerprint is argon2id's, as of a learner's question. An attempt of a module that the act reached keeps that it did, and owes no evidence then: its work may be the grown-up's, so its verdicts are shown and move no progress.
func (*AttemptService) AskTutor ¶ added in v0.1.81
func (a *AttemptService) AskTutor(ctx context.Context, req *v1.AskTutorRequest) (*v1.AskTutorResponse, error)
AskTutor answers a question of the learner's own about a task from paper or of a module but an essay: one call of the words of a task from paper, tutor.PaperQuestion — about the first task not correct, with the tasks of the Check the attempt keeps, or about the task of a module, with its statement, solution and key (moduleAsked) —, the rung given, the hints given and the conversation app holds. While the attempt of a task from paper keeps no Check, the work as it stands is checked first and the Check kept, as GetOpeningWords keeps it, but with no rung given; both calls reserve the quota together. No admission, the quota, the limit and a call that gives no words answer the opening question's fallback text with the outcome, and words that fail the checks the same text with none. The question, the conversation and the words are kept nowhere: the record of the key holds the outcome alone, so a repeat gets no words, and the key's fingerprint is argon2id's, as of a request that carries a PIN.
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 by the learner's "Done": 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 — and what comes next: in a lesson the segment after its own, which "done" ends, and outside a lesson the engine's choice. 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.
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: 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) GetCheckProgress ¶ added in v0.1.83
func (a *AttemptService) GetCheckProgress(ctx context.Context, req *v1.GetCheckProgressRequest) (*v1.GetCheckProgressResponse, error)
GetCheckProgress says how far the Check of a task from paper still going on the profile's attempt has got, by the record going of its SubmitWork under the caller's account: the place of the model that now reads, from 0, and the length of the call's list, once the Check has gone on to a later model, and both 0 before. A Check not going, or done, or one older than the longest a submission may run, is going false. It reads one row and writes nothing, so that app may ask it every few seconds.
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: 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
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: 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 —; after it, the words of the current rung that the attempt keeps, or its fallback text, with no question. A task from paper has its own (paperHint). It repeats by the attempt's state.
func (*AttemptService) GetOpeningWords ¶ added in v0.1.72
func (a *AttemptService) GetOpeningWords(ctx context.Context, req *v1.GetOpeningWordsRequest) (*v1.GetOpeningWordsResponse, error)
GetOpeningWords is "Hint" on a task from paper before its first Check: the work as it stands goes to the Check, one call of AI on the attempt, which keeps the Check and its ladder as after a submission, but shows no verdict and counts no wrong answer; the answer is the ladder's first rung, which the attempt keeps as given, or the tutor's words when that rung is a fallback text. A Check that gives no answer leaves the opening question's fallback text, with the outcome, and keeps nothing: a request with a new key calls again. Once the attempt keeps a ladder, a request is "not current", and a repeat under the key gets the first rung kept. When the deployment admits the Check, the call runs between two transactions, as SubmitWork does (rpc.Across).
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: the tutor's question, once it passed the leak check and the form check, with the box of the first mistake as a mark (markOf), 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). A task from paper gives the rung of its ladder, with no AI (paperRungWords).
func (*AttemptService) ReadStatement ¶ added in v0.1.74
func (a *AttemptService) ReadStatement(ctx context.Context, req *v1.ReadStatementRequest) (*v1.ReadStatementResponse, error)
ReadStatement is "Recognise" on a task from paper: the reading of the statement of the attempt's crop, by one call of AI between two transactions (rpc.Across), whose reading the attempt keeps until it closes. The Check takes none of it, but how many tasks it read, when no Check came before, and the leak check of "explain differently" its statements. An attempt that keeps a reading answers its statements, repeated, with no AI. The answer is the statements alone, never a formula. On platform AI the call goes only with the reserve of the quota, and a reserve refused is a refusal that keeps the family day the request wrote. A call that gives no reading is an outcome, and nothing is kept: the next press asks again. The crop goes no further than the call, and the record of the key holds the outcome alone.
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. 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. The replies "opening" and "answer" are of a task from paper alone: on an attempt of a module they are invalid_argument.
func (*AttemptService) SubmitEssay ¶ added in v0.1.49
func (a *AttemptService) SubmitEssay(ctx context.Context, req *v1.SubmitEssayRequest) (*v1.SubmitEssayResponse, error)
SubmitEssay sends the sheet of a task with a rubric for its feedback, under its idempotency key: one request, two calls of tutor. One reader reads the crop, 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. The submission ends "feedback", "unreadable" — 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 no criterion was assessed. The reserve covers the reading with the assessment, and the calls run between two transactions (rpc.Across). The server records how the submission ended and, beside feedback, the marks and the source of the words, never the text, the evidence or the words. 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.
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 readers — the pair, or one reader — read of the crop of a handwriting sheet. A submission with an answer slot "not_yet" is a wrong answer; "unreadable" and "unchecked" are none. One whose every item is correct closes the attempt "correct", and its answer holds the task solved, its keys and its solution. 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, and the crop lives in the request's memory alone.
An option of the attempt's answer options tapped on the one answer slot of a task not bound choice is judged by the key as the value of that slot, with no work and no AI, and recorded as any submission, with no observation.
A task tapped alone, or an option tapped, 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; outside a lesson, the engine's choice, 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.
type Goals ¶ added in v0.1.92
type Goals struct {
// contains filtered or unexported fields
}
Goals sets the goal for the tutor of a profile, for AccountService, whose answer gives the profile.
func (*Goals) SetGoal ¶ added in v0.1.92
func (g *Goals) SetGoal(ctx context.Context, profileID string, goal *v1.Goal) (store.Profile, error)
SetGoal makes goal the whole goal for the tutor of the profile, an adult's action with the right can_manage, which the checks hold, and gives the profile with its goal. A goal of more than three items, with an item twice or with an item of neither an area nor a skill is invalid_argument. The profile's consent is confirmed and its age needs no restating, as for a learning request: the goal is processing of the learner's data. Only an item the profile's goal does not hold yet is checked (goalFits); one it holds is taken as it is, though it leads to no skill now. The same items in the same order append nothing and answer the profile as it is, so the method repeats by the state of the profile, with no idempotency key; any other goal, none too, replaces the profile's and goes to the journal of evidence, in one transaction, at the request's time in whole seconds.
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. It closes the profile's open attempt in the same transaction: "left", or as the check of a request would have closed it. 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. A task begins only on a handwriting sheet, which every task of a module is solved on, never on a workbook. A task of handwriting begins when tutor reads its form — one answer slot bound anywhere — and the gate of admission chooses models for its kind of call, by platform AI or the own key named; a task with a rubric, when tutor reads it as an essay and the gate chooses models for its reading and its assessment both. 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, 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". 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 the learner's ask for what comes next, under its idempotency key: the open attempt is closed "left" — or as the check of a request would close it — and the engine chooses, on the route to AI the request names by own_key_provider, as BeginAttempt by the same route would begin a task. With a module, Solve, it chooses among the module's tasks alone, on the module's task skill when it has one; with a skill, on that skill among all the modules; with neither, as it leads. A module not connected, or a skill that no module of the engine has, is "not found", a module with no current version for the learner is refused so, and nothing is closed; a module solved on the sheet, a module and a skill both named, and a provider named for a learner who is not an adult are 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
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; one that ended otherwise, "run ended". The choice goes by the route the request names. It is no check of the lesson: only of its package and its term. 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, and with the choice of an end on the route it names. 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 on request, with the leading question given on request. It reads, and so it is no action on the attempt: its last action stays.
func (*LearningService) ListLessons ¶ added in v0.1.84
func (l *LearningService) ListLessons(ctx context.Context, req *v1.ListLessonsRequest) (*v1.ListLessonsResponse, error)
ListLessons gives the lessons of a connected module for its tile and its page of lessons: those of its current version for the learner that suit the learner whole, in the author's order, which the engine gives, each with its state by the profile's runs; then the lesson of each open run that the current version does not list, in a group of its own, on the run's package. It writes nothing: no run is touched or ended, and no choice is made. A module not connected is "not found", one with no current version for the learner is refused so, and one solved on the sheet is malformed.
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, or the one the learner chose by its full ID: 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 lesson the learner chose opens a new run with a choice of its own (openChosen). A request names one of the two, or it is malformed. 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, one on a workbook, or one in a zone or on the whole sheet — is not checked here: its attempt is "not admitted", and the run stays open. The segment of a task with a rubric ends once its attempt is closed "done". The choice an end of its run gives goes by the route own_key_provider names.
func (*LearningService) PreviewGoal ¶ added in v0.1.92
func (l *LearningService) PreviewGoal(ctx context.Context, req *v1.PreviewGoalRequest) (*v1.PreviewGoalResponse, error)
PreviewGoal gives the first skills toward the goal for the tutor — the profile's, or the draft of the goal sheet the request names — as the engine's rule of the goal takes them at the time of the request, each with its module and the number of the goal's item it leads to. The checks take the right by the action — the learner's can_learn, an adult's can_view —, and either is refused for the consent and the age, as a learning request is. A draft of a form SetGoal refuses is invalid_argument; an item of it that leads to no skill gives none, as an item of a saved goal. No goal, or a draft with no items, gives no skill and asks the engine nothing.
The engine gets what a choice across the modules gives it, the count of the choices aside, which it does not read: the modules of the engine, with their skill areas, their pools and lessons by the learner's category on platform AI with the AI open — no route to AI and no quota is judged, as the skill map counts a skill's tasks —, and the profile's records. It writes nothing: it reads in one read-only snapshot, folds the evidence the closed attempts owe into the state in memory alone, makes no choice and leaves the open attempt open. An input the model or the engine refuses is unavailable, as it is to ChooseNext. The draft goes nowhere but to the engine.
type Option ¶
type Option func(*Service)
Option sets what a Service runs on: for the tests, and the dev mode's stub.
func OffDeployment ¶ added in v0.1.50
func OffDeployment() Option
OffDeployment says api runs off a deployment, as serve does on the dev projects: a tariff of the dev projects alone has its caps there alone (quota.CapsOf).
func WithDebug ¶ added in v0.1.72
WithDebug is the debug mode, whose choice of models serves the calls of a task from paper of an account with its right and whose store keeps what every call of a model of the account returned and cost, wherever it was made.
func WithGrownUpRequestTimeout ¶ added in v0.1.81
WithGrownUpRequestTimeout is the longest AskGrownUp may run, as the server bounds it.
func WithPaperRequestTimeout ¶ added in v0.1.72
WithPaperRequestTimeout is the longest FindTasks, ReadStatement and SubmitWork may run, as the server bounds them.
func WithRequestTimeout ¶ added in v0.1.17
WithRequestTimeout is the longest a request may run, as the server bounds it.
func WithTexts ¶ added in v0.1.46
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
essayReader
rubricAssessor
taskFinder
paperChecker
paperTeller
sheetDrawer
}) Option
WithTutor is what reads the sheets and the essays, assesses the essays by their rubrics, words the tutor's words, those after a correct answer too, finds the tasks on the photo of a page, checks a task from paper, words its tutor's words and draws its act of grown-up mode, and says which kinds of reading are admitted, in place of the gate's tutor: the dev mode's stub, which calls no provider and admits an essay and its assessment itself.
type PaperService ¶ added in v0.1.72
type PaperService struct {
apiv1connect.UnimplementedPaperServiceHandler
// contains filtered or unexported fields
}
PaperService is the requests of a task from the learner's paper: the finding of the tasks on the photo of a page, and the beginning of the attempts of the tasks picked, which AttemptService then checks.
func (*PaperService) BeginPaperAttempts ¶ added in v0.1.72
func (p *PaperService) BeginPaperAttempts(ctx context.Context, req *v1.BeginPaperAttemptsRequest) (*v1.BeginPaperAttemptsResponse, error)
BeginPaperAttempts begins the attempts of the tasks picked on a page, under its idempotency key, one for each, their IDs in the order of the tasks. It closes the profile's open attempts of another page "left", those of the page named staying for a Start again after "Add", and leaves its open attempt of a module as it is. The attempts begin when the gate admits, on the route of ownKey, the Check, without which no verdict comes, and on platform AI only with room for a typical task of handwriting left of the family day, while the limit of its provider leaves platform AI open, as BeginAttempt begins a task of a module. With a module solved on the sheet, the page's tasks are those of the package of its current version, which the answer gives open.
func (*PaperService) FindTasks ¶ added in v0.1.72
func (p *PaperService) FindTasks(ctx context.Context, req *v1.FindTasksRequest) (*v1.FindTasksResponse, error)
FindTasks finds the tasks on the photo of a page, under its idempotency key, by one call of AI between two transactions (rpc.Across): their frames, in the order of the page, each with the frame of the instruction printed above it where tutor found one, on the photo turned by the turn tutor gave, which goes with them. It makes no call without the admission of the finding on the request's route, nor on platform AI without the reserve of the quota: either is a refusal, and the family day the request wrote stays. A call that gives no frames is an outcome, and the learner frames the tasks by hand. The photo goes no further than the call, and the record of the key holds the outcome alone: a repeat gets an answer "repeated" without frames or turn. With the learner's request the call gets it and the frames on the page, which go no further either.
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: the skill map, the cognitive map and the adult's progress, and the adult's correction of a module's level. Each but the cognitive map writes first the evidence the profile's closed attempts owe, so that it reads the journal whole; the cognitive map reads it in memory and writes nothing.
func (*ProgressService) GetCognitiveMap ¶ added in v0.1.92
func (p *ProgressService) GetCognitiveMap(ctx context.Context, req *v1.GetCognitiveMapRequest) (*v1.GetCognitiveMapResponse, error)
GetCognitiveMap is the skill map of every module connected to the profile at once, at the time of the request: the modules of the engine — connected, with a current version for the learner that the deployment's list names, and not solved on the sheet —, by their IDs, each with the digest of its current version and the state of its skills as GetSkillMap gives it; and, once the profile is older than the window of the indicators, the skills of those modules mastered at its start, midnight of its first day by the time zone of the request. A profile with no such module gets none.
The checks take the right by the action — the learner's can_learn, an adult's can_view —; the learner's action is refused for the consent and the age, as a learning request is, and an adult's views the profile whatever its consent, as the skill map does. The time zone is checked first in the handler, and goes nowhere but to the count of the window.
It writes nothing: it reads in one read-only snapshot, the model by Model.Look, and the state at the start of the window by replaying the profile's log up to it, with no cache, through the modules' current versions and with the learner's grade now; the look and the log are then of one reading of the journal, Model.LookAndLog.
func (*ProgressService) GetIndicators ¶ added in v0.1.92
func (p *ProgressService) GetIndicators(ctx context.Context, req *v1.GetIndicatorsRequest) (*v1.GetIndicatorsResponse, error)
GetIndicators is the indicators of the portrait over the window of the 28 days that end with the day of the request, by the time zone of the request — fewer, from the day the profile was created on, while it is younger —; over the 28 days before it, once the profile was created before the window; and over each week of the history of the cognitive map, the same weeks.
The skills mastered and due for review are those of the map at the end of the period, of the window and of the current week the request, by the replays of the history: each week's as the history reads it, and the start of the window, the end of the 28 days before it, replayed from the log as the map's window start is. The attempts are those of tasks of modules begun in the period, of any module, connected or not since: their days and their minutes, from the beginning to the last action, 30 at most each, the sum rounded down; and, of those that give evidence the learner model reads but for one closed "unchecked", those that had help — a wrong answer, which gives a rung of the hint ladder, or a technique or the leading question on request — and, of the others, those closed correct with no wrong answer. An attempt on a package withdrawn for a wrong key gives the model nothing, nor does one whose evidence is owed on a package the image no longer holds, and neither is among them.
The checks, the consent, the age and the time zone go as for the map. It reads in one read-only snapshot and keeps nothing of its own: the one thing it may write is the cache of the history's replays, as the history writes it, in a transaction of its own after it. The zone goes nowhere but to the count of the moments.
func (*ProgressService) GetMapHistory ¶ added in v0.1.92
func (p *ProgressService) GetMapHistory(ctx context.Context, req *v1.GetMapHistoryRequest) (*v1.GetMapHistoryResponse, error)
GetMapHistory is the history of the cognitive map: the state of the skills of the modules of the map at the end of each of the last twelve weeks, Monday to Sunday by the time zone of the request, the current week last and as the map gives it at the request, but no week before the one the profile was created in; and each item of the goal for the tutor with the moment from which it has stood in the goal.
A past week is the learner model replayed over the log up to midnight on the Monday after it, read at that moment through the modules' current versions with the learner's grade now, and its tasks passed are counted of the attempts closed before then on the pool of the current version; the modules, their order and their digests are the map's, in every week. The checks, the consent, the age and the time zone go as for the map.
It reads in one read-only snapshot, as the map does, and writes nothing but the cache of the replays, in a transaction of its own after it, when it replayed them: Model.History and Model.KeepHistory. The ends of the weeks are moments, and the zone goes nowhere but to their count.
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: its attempts, newest first, a page at a time, and, on the first page, the traps that repeat in its closed attempts and the adult's last correction of the level of each module that has one. Each attempt has when the engine chose its task, or its run's lesson, and why — but one begun again —, and an attempt with a rubric each of its submissions, how it ended and, once the attempt is closed, the marks of its feedback.
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, as one the deployment's list leaves out does. Each anchor skill has the modules of the index that teach it, suit the learner, are on the list and are not connected.
func (*ProgressService) SetModuleLevel ¶ added in v0.1.59
func (p *ProgressService) SetModuleLevel(ctx context.Context, req *v1.SetModuleLevelRequest) (*v1.SetModuleLevelResponse, error)
SetModuleLevel is an adult's correction of the level of a connected module, "Easier" or "Harder" in the section for adults, with the right can_manage, which the checks hold, at every profile of the account. The profile's consent is confirmed and its age needs no restating, as for a learning request: the fact is processing of the learner's data. After the evidence the profile owes is settled, the band named is the level's own — nothing is appended, and the answer is the level as it is —, the band next to it in the order of the bands of the current version's manifest, or, while the level stands below the lowest band, the lowest; any other is CAUSE_BAND_NOT_NEXT. The correction goes to the journal of evidence, and learner-model sets the level in that band in one step. It repeats by the state of the profile, with no idempotency key.
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) *AttemptService
Attempts is the AttemptService of s, on db.
func (*Service) Learning ¶
func (s *Service) Learning(db rpc.DB) *LearningService
Learning is the LearningService of s, on db.
func (*Service) Paper ¶ added in v0.1.72
func (s *Service) Paper(db rpc.DB) *PaperService
Paper is the PaperService of s, on db.
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: 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. Each request repeats by the state of the profile's works, with no idempotency key.
func (*WorkService) DeleteWork ¶ added in v0.1.39
func (w *WorkService) DeleteWork(ctx context.Context, req *v1.DeleteWorkRequest) (*v1.DeleteWorkResponse, error)
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
func (w *WorkService) ListWorks(ctx context.Context, req *v1.ListWorksRequest) (*v1.ListWorksResponse, error)
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.