Answer submission and history
Submitting answers
An answer can be any value that can be converted to JSON (up to 64KB). The server grades it within the request using the educator's grading settings and returns the result immediately.
Do not put learners' personal information (name · phone number · email · address · date of birth · student id · resident registration number · bank account · face photos · location, or any other information that can identify a person) in answers. Submitted answers are kept on the server and seen by educators and operators, and with rubric grading they are also sent to an external AI model. To tell learners apart, use sdk.account.anonymousId.
const { isCorrect, score, answerCorrectness } = await sdk.submit({ q1: 'B', q2: 42 });
// 자동 채점: { isCorrect: true, score: 100, answerCorrectness: [] }
// 채점 안 함: { isCorrect: null, score: null }
// partial_pattern: 답은 문항 순서대로 문자열 배열
await sdk.submit(['Paris', '4', '광합성']);
// { isCorrect: false, score: 30, answerCorrectness: [false, false, true] }
answerCorrectnessis the per-question correctness ofpartial_patterngrading (inanswer_keyorder; missing answers arefalse). Forpattern·rubric· no grading it is[].- It can be called only on learning screens (
learn·instructor). On the settings screen it fails withscreen_not_supported. - When a tutor calls it, it is rejected with
read_only_mode. Hide or disable the submit button for tutors. - When a course manager (educator) submits on the learning page, the answer is graded but not saved.
- In edit page previews (
isDraft), nothing is sent to the server and grading is simulated.
Results by learning completion setting
| Learning completion setting · grading | submit() result |
|---|---|
on_access (Complete on view) | score · isCorrect are null. 100 points is already recorded when the material is first opened, and submissions are only recorded |
on_submit (Complete on submit) | 100 points immediately |
on_graded + pattern | 0 or 100 points immediately |
on_graded + partial_pattern | The sum of the points of the correct questions (up to 100), immediately. isCorrect: true and completion only at 100 points. Rejected if the answer is not an array of strings (request_failed, with the server code in cause) |
on_graded + rubric (AI grading) | AI grades within the request and returns the score (up to 30 seconds). If the AI call fails, the submission is not saved and external_service_error is thrown. Just submit again |
Free-form learning materials do not use direct grading by educators or "no grading". For grading settings, see Material information and saving settings.
LXP shows the perfect-score celebration (rabbit · sound) when the server score changes. The content only calls submit() and does not build its own celebration screen.
Submission limits
- Submitting too often in a short time (30 per minute) results in
rate_limited. - An answer larger than 64KB results in
invalid_input.
Submission history
Reads my submission history, newest first. A tutor reads the history of the student they are viewing.
const submissions = await sdk.history({ offset: 0, limit: 20 });
// [{ id, materialVersionId, accountId, createdAt, answer, isCorrect, score, answerCorrectness }, …]
| Field | Description |
|---|---|
id | Submission id |
materialVersionId | Material version id at the time of submission |
accountId | Id of the submitting account |
createdAt | Submission time |
answer | Submitted answer |
isCorrect, score | Grading result. null if not graded |
answerCorrectness | Per-question correctness for partial_pattern. [] for other grading. Older servers may not send it |
offsetdefaults to 0, andlimitdefaults to 20 with a maximum of 100.
My result
sdk.result is the per-material result received during init() ({ score, submitCount, completedAt }). See Screens and viewers.