Closed nkratzke closed 6 years ago
If it happens, it is a bug, not a feature.
Notice that if you are using a custom script you need to include common_script.sh at the start of your script to decode binary files from the base64 format.
Next release will remove this requirement using an internal base64 decoder.
Are you using a custom script without common_script.sh?
Yes, that is correct - I use a custom script without common_script.sh. I will adjust this.
However, another question is coming up: Do I need to base64 encode the jar as well? Or is this handled by VPL/Moodle behind the scenes?
Is there an example somewhere? I found nothing that specific on Google.
No, you don't need to encode the jar or other binary file to base64.
Best regards, Juan Carlos.
Hmm, I double checked it. It works with the common_script.sh AND a base64 encoding of the respective jars. But it does not work without the base64 encoding of the jars.
This would be in line with the VPL documentation (http://vpl.dis.ulpgc.es/index.php/support) stating that:
binary files Currently VPL don't support the handling of binary files, but it is possible to overcome this limitation using files in base-64 format. Files with extension b64 are decoded and extension removed. Example: photo.jpg.b64 file in base64 becomes photo.jpg in binary.
However, the common_script.sh tip works and that solved perfectly my problem!
Apologize for the outdated documentation. VPL supports binary files out of the box from VPL 3.2. http://vpl.dis.ulpgc.es/index.php/home/news/79-release-of-vpl32
The only requirement is to use common_script.sh when usign custom scripts. For compatibility with previous versions, common_script.sh decode base64 files (.b64). Notice that, for security reasons, you need to select your jar file at "Files to keep when running", if not, the execution system will delete it before execute the students code.
If you are usign VPL 3.2 or higher and binary files are lost, then this is a bug.
Best regards, Juan Carlos.
Is there a method to determine the VPL version? The Moodle installation is not under my control. However, in my case, it just works with Base64 encoded binary files.
For security reasons the versions number has been hidden for regular users. You must ask to your system manager.
An indirect way to know your VPL version is examining for the features of your version. To check if you are using a version equals or higher to VPL 3.2 you may check if your the editor support one of this:
See more at
http://vpl.dis.ulpgc.es/index.php/home/news/79-release-of-vpl32
Hi Juan,
according to our system manager we run VPL 3.3.3. But I need to provide jars in a Base64 encoded way. It does not work without Base64 encoding.
Can you reproduce this behavior or do you need additional data?
BR Nane
Please, can you reproduce the problem on vpldemo? http://demovpl.dis.ulpgc.es/moodle
Sure: Please find the situation that triggered this effect here: http://demovpl.dis.ulpgc.es/moodle/mod/vpl/view.php?id=536
As you will see, the jar files (checkstyle.jar and jedunit.jar) are marked as files to keep but do not make it to the jails environment. If the files are encoded as Base64 everything works fine. All non-binary files work as well. But it does not work for the binary jars :-(
The problem is in your custom vpl_run.sh. You are not running common_script.sh. The aim of vpl_run.sh is compile, preprocess the code (e.g run javac, checkstyle, etc.) and finaly generate vpl_execution. The same problem are in vpl_evaluate.sh.
I think that this would be the correct vpl_run.sh
#!/bin/bash
. common_script.sh
javac -cp ".:*" Main.java
cat > vpl_execution <<EEOOFF
#! /bin/bash
java -cp ".:*" Main
EEOOFF
chmod +x vpl_execution
I have modifyed your activity http://demovpl.dis.ulpgc.es/moodle/mod/vpl/view.php?id=536
BG Juan carlos.
Aahhh, ok thank you very much. It was not clear to me that the vpl_run.sh and vpl_evaluate.sh scripts assume this compile, preprocess, vpl_execution script generation process. Somehow I figured out (from the somewhat cluttered documentation) that all of this has to be executed within vpl_execution.
Now, the "to be kept files for execution" makes much more sense ;-)
I adapted my custom scripts accordingly. The workflow is now much better. Thank you very much for this clarification. Everything works fine now.
I really appreciate all of your efforts you put into VPL.
Best regards, Nane
It seems to me, that binary files like Java libraries (jars) seem to be deleted even if marked as not to be deleted for execution.
The effect is not observable for text files.
Is that a bug or a feature?