File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
src/main/kotlin/goodspace/bllsoneshot/entity/assignment Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,10 @@ class Comment(
6363 val isRead: Boolean
6464 get() = readByMentee
6565
66+ @get:Transient
67+ val hasAnswer: Boolean
68+ get() = answer?.content != null
69+
6670 fun markAsRead () {
6771 readByMentee = true
6872 }
Original file line number Diff line number Diff line change @@ -69,8 +69,11 @@ class Task(
6969 fun hasProofShot (): Boolean =
7070 proofShots.isNotEmpty()
7171
72- fun hasFeedback (): Boolean =
73- proofShots.any { it.hasFeedback() }
72+ fun hasFeedback (): Boolean {
73+ return proofShots.any { it.hasFeedback() }
74+ || generalComment?.content != null
75+ || hasAnswer()
76+ }
7477
7578 fun hasReadAllFeedbacks (): Boolean {
7679 if (! hasFeedback()) return false
@@ -99,6 +102,9 @@ class Task(
99102 proofShots.forEach { it.clearTemporaryAnswers() }
100103 }
101104
105+ private fun hasAnswer (): Boolean =
106+ questions.any { it.hasAnswer }
107+
102108 companion object {
103109 private const val MINIMUM_ACTUAL_MINUTES = 0
104110 }
You can’t perform that action at this time.
0 commit comments