63 lines
1.4 KiB
Plaintext
63 lines
1.4 KiB
Plaintext
enum OptionKey {
|
|
A,
|
|
B,
|
|
C,
|
|
D
|
|
}
|
|
|
|
enum AttemptStatus {
|
|
IN_PROGRESS,
|
|
SUBMITTED
|
|
}
|
|
|
|
entity Subject {
|
|
name String required minlength(2) maxlength(100),
|
|
description String maxlength(1000),
|
|
active Boolean required
|
|
}
|
|
|
|
entity Question {
|
|
prompt String required minlength(5) maxlength(2000),
|
|
explanation String maxlength(2000),
|
|
active Boolean required
|
|
}
|
|
|
|
entity Choice {
|
|
optionKey OptionKey required,
|
|
content String required maxlength(500),
|
|
displayOrder Integer required min(1) max(4),
|
|
correct Boolean required
|
|
}
|
|
|
|
entity ExamAttempt {
|
|
startedAt Instant required,
|
|
submittedAt Instant,
|
|
status AttemptStatus required,
|
|
score Integer min(0)
|
|
}
|
|
|
|
entity ExamAnswer {
|
|
questionTextSnapshot String required maxlength(2000),
|
|
explanationSnapshot String maxlength(2000),
|
|
selectedOption OptionKey,
|
|
selectedContentSnapshot String maxlength(500),
|
|
correct Boolean,
|
|
awardedPoints Integer min(0)
|
|
}
|
|
|
|
relationship OneToMany {
|
|
Question{choice} to Choice{question required}
|
|
ExamAttempt{answer} to ExamAnswer{attempt required}
|
|
}
|
|
|
|
relationship ManyToOne {
|
|
Question{subject(name) required} to Subject
|
|
ExamAttempt{subject(name) required} to Subject
|
|
ExamAttempt{user(login) required} to User with builtInEntity
|
|
ExamAnswer{question required} to Question
|
|
}
|
|
|
|
dto Subject, Question, Choice, ExamAttempt, ExamAnswer with mapstruct
|
|
service Subject, Question, Choice, ExamAttempt, ExamAnswer with serviceClass
|
|
paginate Subject, Question, ExamAttempt with pagination
|