All Downloads are FREE. Search and download functionalities are using the official Maven repository.

server.Submission.kt Maven / Gradle / Ivy

There is a newer version: 2024.9.0
Show newest version
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)




© 2015 - 2024 Weber Informatics LLC | Privacy Policy