Virtual Programming Lab icon

Virtual Programming Lab

Maintained by Juan Carlos Rodríguez
VPL (Virtual Programming Lab) enables the creation, submission, execution, and automatic assessment of programming assignments directly within the Moodle learning environment.
Price option: Free

Supports Moodle 2.3-5.2 See all versions
Latest release: 2 months ago
Installations: 2624
Downloads (last 90 days): 1379

Frankenstyle name: mod_vpl
Activities

Comments

Comments are no longer open for new posts. Existing comments remain available to read.

Hi Juan,
I would like to suggest a small enhancement to VPL: exposing the VPL activity name as an environment variable available in custom jail scripts, such as vpl_run/debug/evaluate.sh.
The use case is that custom run or evaluation scripts sometimes need to know which activity they are being executed for. For example, this could be useful to customize behavior per activity, generate activity-specific reports, or include the activity name in evaluation output and logs.
Currently, vpl_environment.sh exposes identifiers such as MOODLE_COURSE_ID and MOODLE_ACTIVITY_ID, as well as descriptive fields such as MOODLE_USER_NAME and MOODLE_GROUP_NAME. However, as far as I can tell, there is no variable containing the VPL activity name itself.
A possible implementation could be to add this line in get_environment_variables() in vpl_submission_CE.class.php, after the MOODLE_ACTIVITY_ID assignment:
$variables['VPL_ACTIVITY_NAME'] = $vpl->get_instance()->name;
This would make the activity name available as $VPL_ACTIVITY_NAME in all jail scripts through vpl_environment.sh, with a minimal code change and without affecting existing functionality.
Would this be something you would consider adding to VPL?
If there is already another recommended way to access the activity name from jail scripts, I would also appreciate any guidance.
Thank you for your work on VPL and for considering this request.
Best regards,
Lina
Hi Juan,
Legend! Thank you so much I'd not tried readline-sync and yes it works very well. I had already pre-installed the module using npm on the server.
As I mentioned earlier the VPL moodle addon is brilliant and all credit to you for creating this. Many thanks for your support.
Dear Steve,
Using pre_vpl_run.sh to install the required Node.js packages during each execution or evaluation is possible, but it tends to be time-consuming and not always reliable. A more effective approach is to install the necessary packages globally on the execution server. This ensures they are readily available without repeated installations.
Regarding the issue with asynchronous input/output, you're right—Node.js and some of its packages can take full control of the terminal, which can interfere with VPL’s evaluator and cause unexpected behavior.
After testing several packages that support synchronous input/output, I found that readline-sync works well and integrates properly with the VPL evaluator. I’ve tested it successfully with both VPL version 4.2 and the upcoming version 4.3.
I hope this resolves the issue you're facing.
Note: Please avoid using the plugin notification feature to ask technical questions, as it does not support threaded communication.
Best regards,
Juan Carlos Rodríguez
Hi Juan, Sorry for the follow up on this one, but have you had chance to review my last post Friday May 23? regarding JavaScript inputs. I'm currently unable to get any evaluation working with JavaScript inputs. I need a simple solution for students to learn JavaScript with. But test cases are not going to work unless I can get input working. Any suggestions, even if I have to use vpl_evaluate.sh file to get this working, but would welcome suggestions on doing this?
Much appreciated, the VPL tool is a fantastic piece of tech, and would love this to work with JavaScript.
THanks,
Steve
We are looking to use VPL to run a few weeks bootcamp on javascript programming. I know javascript does not come with a native means for input so was looking at 'prompt-sync' as a workaround. This works well when testing the console, but when you click the check box for the test cases it seems to be in an endless timeout for evaluating... Are you aware of this, do you know of any fixes?
Thanks,
Steve
Hi Sandipa,
First, I would like to point out that this is not the best way to ask questions, as there is no proper thread for each question and answer. Please, next time use the VPL forum (discussion area) for this kind of communication.
Regarding your problem: the VPL system checks for the use of tkinter in your code to automatically switch to GUI mode. However, in some cases, it may not detect it correctly. To solve this, simply add a comment mentioning tkinter in your code.
Also, remember not to name your file turtle.py, as this can cause conflicts with the standard Python Turtle module.
Here is an example you can follow:
import turtle
# Tkinter
screen = turtle.Screen()
screen.bgcolor("white")
screen.title("Turtle Example")
# Create a turtle
my_turtle = turtle.Turtle()
my_turtle.shape("turtle") # Make the turtle look like a turtle
my_turtle.color("blue")
my_turtle.speed(3)
# Move the turtle
my_turtle.forward(100) # Move forward 100 units
my_turtle.left(90) # Turn left 90 degrees
my_turtle.forward(100)
my_turtle.left(90)
my_turtle.forward(100)
my_turtle.left(90)
my_turtle.forward(100)
# Finish
turtle.done()
Please try this and let me know if you still encounter any issues.
Best regards,
Juan Carlos Rodríguez
Hi, I tried to run python, but its not working but if I run PHP code, its working fine.
the error for python is
Traceback (most recent call last):
File "/home/p10303/hello.py", line 3, in forward(100)
File "", line 6, in forward
File "/usr/lib/python3.12/turtle.py", line 3875, in __init__
Turtle._screen = Screen()
^^^^^^^^
File "/usr/lib/python3.12/turtle.py", line 3730, in Screen
Turtle._screen = _Screen()
^^^^^^^^^
File "/usr/lib/python3.12/turtle.py", line 3741, in __init__
_Screen._root = self._root = _Root()
^^^^^^^
File "/usr/lib/python3.12/turtle.py", line 430, in __init__
TK.Tk.__init__(self)
File "/usr/lib/python3.12/tkinter/__init__.py", line 2345, in __init__
self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_tkinter.TclError: no display name and no $DISPLAY environment variable
Please help
Hi, I’m trying to create test cases in a way that only certain test cases are marked as sample test cases and that they receive a score of 0 even if the output is correct, similar to how it works on HackerRank. Could you guide me on how to configure test cases to function this way? I want them to appear as sample cases but not contribute to the overall score. Thanks!
Dear WAT Guyane,
Thank you for your inquiry.
We are currently conducting compatibility tests for the newly released Moodle 4.5. In our initial manual review, we haven’t identified any major issues so far. However, we are working to address some challenges with the Behat tests, which are not running due to interface changes in Moodle 4.5.
compatibility for Moodle 4.5 ?
nex- activity previous-activity not appearing.. kindly help to fix this UI
hi juan carlos, i interested to use it on our inhouse Learning Management System. can i contact you for detail discussion ?
Dear Steve Wentworth,
Thank you for bringing this to our attention.
Given the extensive use of JavaScript in the VPL plugin, it is possible that the editor may experience disruptions after an upgrade. I recommend the following steps:
1. The Moodle administrator should “purge all caches”. This can be accomplished by navigating to “Site administration -> Development -> Purge caches”.
2. Some users may also benefit from clearing their browser's cache. This can be done by pressing “Ctrl + F5”.
Additionally, I'd like to inform you that the current VPL version you are using, 4.1, is not the latest. Version 4.2 is available and is compatible with Moodle 4.1. Please note that VPL versions are not necessarily tied to the corresponding Moodle versions.
I hope this resolves your issue. If you continue to encounter difficulties, please do not hesitate to reach out.
Best regards,
No issue, found it!
I'm trying to edit some old test cases for VPL activities we have on our moodle. And I'm unable to edit the test case, in description it just shows the test case sort of read only in a navy background frame but no editor. What am I missing we are running VPL version 4.1 (2023042712) and Moodle 4.1.
The same think happens when a create a new VPL activity, in description I only see the icons and no editor. Any help would be much appreciated.