How can I interact with the console in VPL?

How can I interact with the console in VPL?

by Kemal Uluz -
Number of replies: 6

For Example I used my test.java File two add two numbers.

I copied vpl_run.sh and vpl_evaluate.sh  from https://github.com/jimburton/vpl-unit-test

So now I used my own Junit Test and it works that´s not the problem but if I click on run as a Student I got only the status Junit Test is ok.

But imagine the student wants to check with the console for example he or she wants to type two numbers in but the console doesn´t ask for the two numbers it automatically tests the method´s and give an error or not.

How can I use the console and check for the test or better the student has only the right for testing with the console and the only thing is to evaluate.

Can someone find a solution or has the same problem ?


Average of ratings: -
In reply to Kemal Uluz

Re: How can I interact with the console in VPL?

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Kemal Uluz.

I think that you must remove your vpl_run.sh file (remove the contents) and let VPL runs the default script to run Java.

Best regards,

Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: How can I interact with the console in VPL?

by Kemal Uluz -
Dear Mr.Rodriguez-del-Pino,

what do you mean by (remove the contens).
If I delete everything the error is that there is no executable file.

And if I delete only the lines where Junit is in ..then I got a compilation error because the program can´t find the test cases from the execution files.

So I tried as a Student role and that´s what I´m getting from the compilation window.

I hope I was able to explain my problem as well as possible.

greeting
In reply to Juan Carlos Rodríguez-del-Pino

Re: How can I interact with the console in VPL?

by Kemal Uluz -
Dear Mr.Rodriguez-del-Pino,

I had delete everything out of vpl_run.sh until these lines:
#!/bin/bash
. common_script.sh
javac -J-Xmx16m -Xlint:deprecation *.java
cat common_script.sh > vpl_execution
chmod +x vpl_execution

And what I got from my Console if I run the programm is Connection closed nothing else..
In reply to Kemal Uluz

Re: How can I interact with the console in VPL?

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Dear Mr Kemal Uluz,
Better does not remove the vpl_run.sh file set the file with the full content. Now change the line that starts with 'echo "java '. You must there replace the class name ("Main" in the file you show) with the name of the class you want to run. For example for a student's file Number.java that contains the main static method, the class name must be Number.

Best regards,
Juan Carlos.
In reply to Juan Carlos Rodríguez-del-Pino

Re: How can I interact with the console in VPL?

by Kemal Uluz -
Dear Mr.Rodríguez-del-Pino,

you mean this line :

echo "java -enableassertions -cp $CLASSPATH:/usr/share/java/junit4.jar org.junit.runner.JUnitCore MyTest" >> vpl_execution

but I don´t know the CLASSPATH of the file ..
How can I point the source which the student creates or didn´t I understand something not.

Best regards
In reply to Juan Carlos Rodríguez-del-Pino

Re: How can I interact with the console in VPL?

by Kemal Uluz -
Dear Mr Rodriguez-del-Pino,

I hope you can help me again in this matter.
as a student i create the file Numbers.java

and as an admin I have MyTest.java where the @Test methods are in it

echo "java -enableassertions -cp $CLASSPATH:/usr/share/java/MyTest Numbers" >> vpl_execution

It works that way but if I click on evaluate it doesn´t create the points which I have in my Main.java as Admin.
It would be great if you can help me on that.

Best regards