Has anyone Kotlin or Swift running?

Re: Has anyone Kotlin or Swift running?

de Thomas Karp -
Número de respuestas: 0
Hi,

first, you have to install the Kotlin-compiler at the Jobe-Server. I use docker and expanded the existing version with this Dockerfile:

FROM trampgeek/jobeinabox

USER root

# Tools and JDK
RUN apt-get update && \
    apt-get install -y --no-install-recommends wget unzip default-jdk && \
    rm -rf /var/lib/apt/lists/*

# Kotlin-Version
ARG KOTLIN_VERSION=2.3.10

# Kotlin Compiler
RUN wget https://github.com/JetBrains/kotlin/releases/download/v${KOTLIN_VERSION}/kotlin-compiler-${KOTLIN_VERSION}.zip && \
    unzip kotlin-compiler-${KOTLIN_VERSION}.zip -d /opt && \
    rm kotlin-compiler-${KOTLIN_VERSION}.zip

RUN ln -s /opt/kotlinc/bin/kotlinc /usr/bin/kotlinc && \
    ln -s /opt/kotlinc/bin/kotlin /usr/bin/kotlin

ENV PATH="${PATH}:/opt/kotlinc/bin"

Than I built the docker image:

sudo docker build -t jobe-kotlin .
and started it:

sudo docker run --rm -d -p 8000:80 --name jobe-kotlin-container jobe-kotlin
I had to increase the maximum execution time in the coderunner plugin. I did set 15 seconds. I don't know if 15s is necessary, but that worked for me.

I created 3 prototypes based on Python3. One prototype expects the students answer to be a whole kotlin program, the other one expects  Kotlin code that is included in the main function and one expects top-level-definitions like classes or functions. Every prototype uses testcases and TEST.extra, which is barely documented in the prototypes. If you look at the template you see how TEST.extra, TEST.testcode and STUDENT_ANSWER are combined. You find them attached.

You also find a simple demo question attached.

I had some AI-help and was not looking if every option is perfect, so I am sure there is potential to improve things, but I was very happy that it already worked. I didn't test it with my students yet, but at home my tests were fine.

If you have any questions, feel free to ask.
Kind regards, Tom