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

stumpers.BadWords.kt Maven / Gradle / Ivy

There is a newer version: 2024.9.0
Show newest version
package edu.illinois.cs.cs125.questioner.lib.stumpers

import edu.illinois.cs.cs125.jeed.core.getBadWords
import edu.illinois.cs.cs125.questioner.lib.Language
import edu.illinois.cs.cs125.questioner.lib.Question
import edu.illinois.cs.cs125.questioner.lib.templateSubmission

private val badWords = mutableMapOf>()

fun Question.badWords() = badWords.getOrPut(this) {
    getCorrect(Language.java)!!.let {
        if (getTemplate(Language.java) != null) {
            "// TEMPLATE_START\n$it\n// TEMPLATE_END \n"
        } else {
            it
        }
    }.let { contents ->
        templateSubmission(contents, Language.java)
    }.getBadWords()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy