- graders registry collected at boot from every HasGraders plugin, manual first; a duplicate or reserved code fails boot - grading job on queue quizzes_grading with three attempts; a stale or reviewed answer is never touched; the last failure marks it failed - learning answers enqueue at once, tests at close; a grade recalculates a finished attempt and fires AnswerGradedEvent after commit
20 lines
666 B
Go
20 lines
666 B
Go
package jobs
|
|
|
|
// Queue is the River queue of the grading jobs, so an app can cap how many
|
|
// answers are graded at once (config/queue.yaml).
|
|
const Queue = "quizzes_grading"
|
|
|
|
// Kind is the River kind of GradeAnswerArgs.
|
|
const Kind = "golem15.quizzes.grade_answer"
|
|
|
|
// GradeAnswerArgs asks the quiz's grader to score one open answer. Seq is
|
|
// the answer's grading_seq when the job was enqueued: a job whose Seq no
|
|
// longer matches, or whose answer is no longer pending, does nothing.
|
|
type GradeAnswerArgs struct {
|
|
AnswerID uint `json:"answer_id"`
|
|
Seq int `json:"seq"`
|
|
}
|
|
|
|
// Kind implements pact.JobArgs.
|
|
func (GradeAnswerArgs) Kind() string { return Kind }
|