Skip to content

Commit

Permalink
include submissions in participant api
Browse files Browse the repository at this point in the history
  • Loading branch information
sealexan committed Feb 26, 2024
1 parent 003442c commit 6f44e5b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ch.uzh.ifi.access.model.dto

import ch.uzh.ifi.access.projections.EvaluationSummary
import ch.uzh.ifi.access.projections.SubmissionSummary
import com.fasterxml.jackson.annotation.JsonInclude

@JsonInclude(JsonInclude.Include.NON_EMPTY)
Expand All @@ -13,6 +14,6 @@ class TaskProgressDTO(
val remainingAttempts: Int? = null,
val maxAttempts: Int? = null,
val information: MutableMap<String, TaskInformationDTO> = mutableMapOf(),
val submissions: List<EvaluationSummary> = listOf()
val submissions: List<SubmissionSummary> = listOf()
)

2 changes: 1 addition & 1 deletion src/main/kotlin/ch/uzh/ifi/access/service/CourseService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ exit ${'$'}exit_code;
evaluation.remainingAttempts,
task.maxAttempts,
task.information.map { (language, info) -> language to TaskInformationDTO(info.language, info.title, info.instructionsFile) }.toMap().toMutableMap(),
listOf()
evaluation.submissions
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ class PublicAPITests(
@Test
@Order(5)
fun `Can get results for individual participant`() {
// TODO change this test to work with any number of submissions
// curl -X GET 'http://localhost:8081/api/courses/access-mock-course/participants/[email protected]' -H 'Content-Type: application/json' -H 'X-API-Key: 1234'
mvc.perform(
get("/courses/access-mock-course/participants/[email protected]")
Expand Down

0 comments on commit 6f44e5b

Please sign in to comment.