server.Submission.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.server
import com.squareup.moshi.JsonClass
import edu.illinois.cs.cs125.questioner.lib.Language
import edu.illinois.cs.cs125.questioner.lib.Question
@JsonClass(generateAdapter = true)
data class Submission(
val type: SubmissionType,
val contentHash: String,
val language: Language,
val contents: String,
val originalID: String? = null,
val testTestingSettings: Question.TestTestingSettings? = null,
) {
enum class SubmissionType { SOLVE, TESTTESTING }
}
fun Question.toSubmission(type: Submission.SubmissionType, language: Language, contents: String) =
Submission(type, published.contentHash, language, contents)