From 6dc88285d0c59acd18d4fd875fd6596431379832 Mon Sep 17 00:00:00 2001 From: jay-tux Date: Tue, 10 Jun 2025 15:30:23 +0200 Subject: [PATCH] Show grades in student overview --- .../kotlin/com/jaytux/grader/viewmodel/DbState.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composeApp/src/desktopMain/kotlin/com/jaytux/grader/viewmodel/DbState.kt b/composeApp/src/desktopMain/kotlin/com/jaytux/grader/viewmodel/DbState.kt index a79a268..037a119 100644 --- a/composeApp/src/desktopMain/kotlin/com/jaytux/grader/viewmodel/DbState.kt +++ b/composeApp/src/desktopMain/kotlin/com/jaytux/grader/viewmodel/DbState.kt @@ -373,12 +373,12 @@ class StudentState(val student: Student, edition: Edition) { val asGroup = (GroupAssignments innerJoin GroupAssignmentCriteria innerJoin GroupFeedbacks innerJoin Groups).selectAll().where { (GroupFeedbacks.groupId inList groupsForEdition.keys.toList()) and - (GroupAssignmentCriteria.name eq "") + (GroupAssignmentCriteria.id eq GroupAssignments.globalCriterion) }.map { it[GroupAssignments.id] to it } val asIndividual = (GroupAssignments innerJoin GroupAssignmentCriteria innerJoin IndividualFeedbacks innerJoin Groups).selectAll().where { (IndividualFeedbacks.studentId eq student.id) and - (GroupAssignmentCriteria.name eq "") + (GroupAssignmentCriteria.id eq GroupAssignments.globalCriterion) }.map { it[GroupAssignments.id] to it } val res = mutableMapOf, LocalGroupGrade>() @@ -396,7 +396,7 @@ class StudentState(val student: Student, edition: Edition) { val og = res[gAId] ?: LocalGroupGrade(iRow[Groups.name], iRow[GroupAssignments.name], null, null) res[gAId] = og.copy(indivGrade = iRow[IndividualFeedbacks.grade]) } - + res.values.toList() } @@ -644,7 +644,7 @@ class SoloAssignmentState(val assignment: SoloAssignment) { }.flatten().distinct().sorted() } - private fun Transaction.loadFeedback(): List> { + private fun Transaction.loadFeedback(): List> {3 val allCrit = SoloAssignmentCriterion.find { SoloAssignmentCriteria.assignmentId eq assignment.id }.filter { it.id != assignment.globalCriterion.id }