Beyond posting a final grade, you can track student progress, award extra credit, and attach feedback. This cookbook walks through common scoring scenarios.

Posting a final grade

Set both progress fields to their "done" values so the platform records the grade:

{:ok, score} = Ltix.GradeService.Score.new(
  user_id: user_id,
  score_given: 92,
  score_maximum: 100,
  activity_progress: :completed,
  grading_progress: :fully_graded
)

Use :fully_graded for final scores

Platforms may ignore scores with any other grading_progress value. If you want the grade to appear in the gradebook, always use :fully_graded.

Tracking progress without a grade

Report that a student has started an activity before you have a score to post:

{:ok, score} = Ltix.GradeService.Score.new(
  user_id: user_id,
  activity_progress: :started,
  grading_progress: :not_ready
)

Update the progress as the student works through the activity:

{:ok, score} = Ltix.GradeService.Score.new(
  user_id: user_id,
  activity_progress: :in_progress,
  grading_progress: :pending
)

Awarding extra credit

score_given may exceed score_maximum:

{:ok, score} = Ltix.GradeService.Score.new(
  user_id: user_id,
  score_given: 110,
  score_maximum: 100,
  activity_progress: :completed,
  grading_progress: :fully_graded
)

Including feedback

Add a plain-text comment visible to both student and instructor:

{:ok, score} = Ltix.GradeService.Score.new(
  user_id: user_id,
  score_given: 75,
  score_maximum: 100,
  activity_progress: :completed,
  grading_progress: :fully_graded,
  comment: "Good work on part 2, but review section 3."
)

Choosing progress values

Activity progress

ValueWhen to use
:initializedStudent hasn't started yet, or you're resetting
:startedStudent opened the activity
:in_progressStudent is working on it
:submittedStudent submitted but may resubmit
:completedStudent is done

Grading progress

ValueWhen to use
:fully_gradedFinal grade, ready for the gradebook
:pendingAuto-grading in progress
:pending_manualWaiting for instructor review
:failedGrading could not complete
:not_readyNo grading happening yet

Timestamps

Score.new/1 auto-generates a timestamp if you don't provide one. You can pass an explicit :timestamp for testing or replays.