Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

Don't serialize AssessmentResults that implement JsonFileArchivableResult #243

Merged
merged 3 commits into from
Dec 1, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ class AssessmentArchiver(
private var answersSchema: SimpleJsonSchema

init {
if (assessmentResult !is AssessmentResult && assessmentResult !is JsonFileArchivableResult) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a comment to help future devs with why this is here?

throw IllegalArgumentException("Result must implement either AssessmentResult or JsonFileArchivableResult")
}
val appVersion = "version ${bridgeConfig.appVersionName}, build ${bridgeConfig.appVersion}"
val item = assessmentResult.identifier
archiveBuilder = Archive.Builder.forActivity(item)
Expand All @@ -54,7 +57,7 @@ class AssessmentArchiver(
// Iterate through all the results within this collection and add if they are `JsonFileArchivableResult`.
recursiveAdd(assessmentResult)
// Add assessment result file to archive
if (assessmentResult is AssessmentResult && assessmentResult !is JsonFileArchivableResult) {
if (assessmentResult is AssessmentResult) {
val assessmentResultFilename = "assessmentResult.json"
Logger.d("Writing result for assessment ${assessmentResult.identifier}")
archiveBuilder.addDataFile(
Expand Down
Loading