stioner.lib.2024.9.2.source-code.Warm.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lib Show documentation
Show all versions of lib Show documentation
Question authoring library for CS 124.
package edu.illinois.cs.cs125.questioner.lib
@Suppress("unused")
suspend fun warm(question: Question? = null, timeoutExpansion: Double = 10.0) {
ResourceMonitoring.hashCode()
if (question == null) {
return
}
check(question.validated) { "Question not validated" }
question.solutionByLanguage.forEach { (language, flatFile) ->
question.test(flatFile.contents, language, question.testingSettings!!.copy(timeoutMultiplier = timeoutExpansion))
.also { testResults ->
check(testResults.succeeded) { "Warming ${question.usefulPath} with $language solution did not succeed" }
}
}
}