Moodle Plugins directory: Virtual Programming Lab | Moodle.org
Virtual Programming Lab
The Virtual Programming Lab (VPL) plugin is specifically designed for programming and computer science courses where students are required to write, run, and test source code. VPL enables teachers to define programming tasks, provide reference files, and automatically evaluate student submissions using predefined test cases.
Key features
- Creation of programming activities fully integrated with Moodle courses
- Automatic compilation, execution, and evaluation of student code
- Support for multiple programming languages, including Python, C, C++, Java, JavaScript, PHP, Octave, Haskell, Scheme, and others
- Immediate and detailed feedback for students after submission
- Configurable test cases for objective and repeatable assessment
- Support for multiple submissions and iterative improvement
- Integration with Moodle’s grading and activity management system
- Plagiarism detection support
- Scalability for large courses and multiple concurrent users
- Support for Safe Exam Browser
Educational benefits
By automating the execution and assessment of programming assignments, VPL provides several pedagogical advantages:
- Reduces the manual grading workload for teachers
- Provides fast, objective evaluation of student work
- Encourages experimentation and learning through immediate feedback
- Improves consistency and fairness in grading
- Supports active, practice-based learning
Technical requirements
VPL requires the installation and configuration of a VPL Jail Server, which is responsible for securely compiling and executing student code in an isolated environment.
The separation between Moodle and the execution server improves both security and scalability.
Security and scalability
Student and teacher code is executed in a controlled and isolated environment using the VPL Jail Server, never on the Moodle server itself. This approach minimizes security risks and allows institutions to scale execution capacity by deploying multiple jail servers as needed.
Maturity and adoption
VPL is a stable and widely used plugin in academic environments, particularly in universities and technical institutions. It has been used for many years in real teaching scenarios and is actively maintained.
We need ID Number to use in formular in Gradebook.
How to fix this?
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.
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,
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.
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
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
Thanks,
Steve
Much appreciated, the VPL tool is a fantastic piece of tech, and would love this to work with JavaScript.
THanks,
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
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.