Java /packages / supporting files area

Java /packages / supporting files area

por Christian Gasde -
Número de respuestas: 1

Hi Richard,

at the moment our students mainly program our Java exercises in Eclipse and add these files to "supporting-files-area":

Java code example

In Eclipse we use package-declarations like:

package uebungsblatt_1;

public class InvalidBirthdayException extends Exception {
    String message;

    public InvalidBirthdayException() {


Here ( ) I found:

{{ STUDENT_ANSWER|replace({'package': '// package'}) }}

This works fine with all code in the coderunner editor.

Is there any way to apply the above command to the supporting files ( "" in our case)?   I know this is a heavy one. :-)

Best Regard from Coburg

En respuesta a Christian Gasde

Re: Java /packages / supporting files area

por Richard Lobb -
I don't teach Java myself and I thought someone who did might pipe up instead. But in their absence ...

I think you would need to construct a Java question type that is scripted in Python. It could build the appropriate package file structure, copy relevant files into place, then compile and run the code. This old thread includes a demo question type that could probably be adapted to your needs. See in particular the posting by Peter Sander on Tuesday, 26 July 2016, 8:20 AM.