Skip to content

Commit 6ec0e5a

Browse files
Expose the "tagsStr" field to the teacher API
1 parent 00c537c commit 6ec0e5a

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

src/main/kotlin/org/dropProject/controllers/TeacherAPIController.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ class TeacherAPIController(
7979
)
8080
fun getCurrentAssignments(principal: Principal): ResponseEntity<List<Assignment>> {
8181
val assignments = assignmentService.getMyAssignments(principal, archived = false)
82+
83+
assignments.forEach {
84+
it.tagsStr = assignmentService.getTagsStr(it)
85+
}
86+
8287
return ResponseEntity.ok(assignments)
8388
}
8489

src/main/kotlin/org/dropProject/dao/Assignment.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ data class Assignment(
173173
@Transient
174174
var authorizedStudentIds: List<String>? = null,
175175

176+
@JsonView(JSONViews.TeacherAPI::class)
176177
@Transient
177178
var tagsStr: List<String>? = null,
178179

src/test/kotlin/org/dropProject/controllers/TeacherAPIControllerTests.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,12 @@ class TeacherAPIControllerTests: APIControllerTests {
229229
"dueDate":null,
230230
"submissionMethod":"UPLOAD",
231231
"language":"JAVA",
232-
"ownerUserId": "teacher1",
233232
"gitRepositoryUrl":"git://dummy",
234-
"active":true }
233+
"ownerUserId":"teacher1",
234+
"active":true,
235+
"numSubmissions":4,
236+
"tagsStr":[],
237+
"instructions":null }
235238
]
236239
""".trimIndent()))
237240
}

0 commit comments

Comments
 (0)