Skip to main content

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.

No personal information

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] }
  • answerCorrectness is the per-question correctness of partial_pattern grading (in answer_key order; missing answers are false). For pattern · rubric · no grading it is [].
  • It can be called only on learning screens (learn · instructor). On the settings screen it fails with screen_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 · gradingsubmit() 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 + pattern0 or 100 points immediately
on_graded + partial_patternThe 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

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 }, …]
FieldDescription
idSubmission id
materialVersionIdMaterial version id at the time of submission
accountIdId of the submitting account
createdAtSubmission time
answerSubmitted answer
isCorrect, scoreGrading result. null if not graded
answerCorrectnessPer-question correctness for partial_pattern. [] for other grading. Older servers may not send it
  • offset defaults to 0, and limit defaults 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.