feat: general lab comment and strict square UI

Add a non-required general comment for a student's lab grade (progress V9, API, admin modal, student card). Empty string is the default. Switch the UI to square corners and bump static asset versions.
This commit is contained in:
2026-10-20 21:56:38 +03:00
parent b1f00fd776
commit f7dc8d7d8b
22 changed files with 97 additions and 38 deletions

View File

@@ -134,6 +134,8 @@ data class GradeSetRequest(
val labId: String,
val score: BigDecimal,
val comments: List<CommentInput> = emptyList(),
/** Итоговый комментарий по работе в целом; может быть пустым. */
val generalComment: String = "",
)
data class CommentInput(
@@ -158,6 +160,7 @@ data class GradeResponse(
val labId: String,
val score: BigDecimal,
val comments: List<CommentOut> = emptyList(),
val generalComment: String = "",
)
data class SubmissionDto(

View File

@@ -29,6 +29,8 @@ class GradeService(
val key = LabGradeKey(sid, lid)
val grade = grades.findById(key).orElseGet { LabGrade(studentId = key.studentId, labId = key.labId) }
grade.score = request.score
grade.generalComment = request.generalComment.trim()
grade.updatedAt = java.time.Instant.now()
grades.save(grade)
replaceComments(sid, lid, request.comments)
return GradeResponse(
@@ -36,6 +38,7 @@ class GradeService(
request.labId,
request.score,
commentsOf(sid, lid).map { CommentOut(it.text, it.tone) },
grade.generalComment,
)
}
@@ -122,6 +125,7 @@ class GradeService(
labId = it.labId.toString(),
score = it.score,
comments = (byGrade[it.studentId to it.labId] ?: emptyList()).map { c -> CommentOut(c.text, c.tone) },
generalComment = it.generalComment,
)
}
}

View File

@@ -17,6 +17,7 @@ class LabGrade(
@Id @Column(nullable = false) var studentId: UUID = UUID(0, 0),
@Id @Column(nullable = false) var labId: UUID = UUID(0, 0),
@Column(nullable = false) var score: BigDecimal = BigDecimal.ZERO,
@Column(name = "general_comment", nullable = false) var generalComment: String = "",
@Column(nullable = false) var updatedAt: Instant = Instant.now(),
)

View File

@@ -0,0 +1,2 @@
-- Общий (итоговый) комментарий преподавателя по лабораторной для конкретного студента.
ALTER TABLE lab_grades ADD COLUMN general_comment text NOT NULL DEFAULT '';