VPL Question icon

VPL Question

Maintained by Astor Bizard
VPL Questions are questions that can fit within a Moodle quiz. They are intended to create small to medium coding exercises, based on the Virtual Programming Lab plugin. They are designed to offer a simple interface for students, while keeping the power and versatility of Virtual Programming Labs.
Price option: Free

Supports Moodle 3.5-5.2 See all versions
Latest release: 1 month ago
Installations: 528
Downloads (last 90 days): 713

Frankenstyle name: qtype_vplquestion
Question types

Comments

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

Hi @Astor Bizard,
The VPL activities work fine, and I use them for a long time, even tough the vpl server configuration is not straightforward, I had to make some changes to the Dockerfile to make it work.
It's quite complicated to use VPL Activities in assesment (hiding the questions before the availability date, setting up group overrides, showing the teacher version, giving deferred access to students without messing with the grades, etc) but not infeasible.
When I discovered the vpl question plugin, I was relieved because a quizz made of vpl questions is a much better solution for assesments. It's not a great problem if it does not work yet, I'm not in a hurry. By the time you make it work, I have a other solution (truly an ugly one !)...
I don't think the issue is related to the vpl service, because VPL activities work fine. I don't think your plugin fails to communicate with the VPL service from the client side because the precheck works too.
Nevertheless a strange thing happens : when I precheck, I see an ajax call to the vpl service. But when I check, the process does not seem to be the same : I do not see the ajax calls. Is the vpl service called from the server ? Could it be related to the issue ?
Tell me what information I could give to help you solving it.
Regards,
AM.
Hi Visvanath,
I'm glad that your problem is solved. smile
The 3.4.1 version of mod_vpl is quite recent (and a major release), so maybe did something go wrong on that side.
Best regards,
Astor
Hi Astor, thanks for your quick response!
This is the mod_vpl I have (from its version.php):
$plugin->version = 2021030820;
$plugin->requires = 2018051713; // Moodle 3.5!
$plugin->maturity = MATURITY_STABLE;
$plugin->release = '3.4.1';
$plugin->component = 'mod_vpl';
This is the from VPL question:
$plugin->component = 'qtype_vplquestion';
$plugin->version = 2021012700;
$plugin->requires = 2018051700; // Moodle 3.5.
$plugin->maturity = MATURITY_STABLE;
$plugin->release = '1.3.5';
$plugin->dependencies = array('mod_vpl' => 2017112412); // VPL 3.3.
On suspition, I uninstalled mod_vpl in the GUI, removed moodle/mod/vpl, downloaded mod_vpl_moodle39_2020080218.zip (earlier mod_vpl_moodle310_2021030820.zip), unzipped, went through the installation in the web GUI.
Here is the new version.php (sorry, can't see a difference):
$plugin->version = 2021030820;
$plugin->requires = 2018051713; // Moodle 3.5!
$plugin->maturity = MATURITY_STABLE;
$plugin->release = '3.4.1';
$plugin->component = 'mod_vpl';
Did the same with the VPL Question, reinstalling it (the same thing). Now I see in the plug-in overview:
VPL Question qtype_vplquestion 1.3.5 2021012700 and the VPL Question appears when I add a new question!
In short, the older version works! As I said, Moodle 3.9.5+, PHP 7.4.3. This is a staging Moodle instance, so can dig deeper, if you are interested.
Hi @Visvanath Ratnaweera,
This may seem obvious, but do you have the plugin mod_vpl installed with sufficient version (2017112412) on your Moodle?
If this is not the issue, I have currently no clue of what you are missing. Did everything go smoothly during the installation process (no error message)?
Best regards,
Astor
Subj. No VPL Question type found tryung to add a new question in a quiz
qtype_vplquestion_moodle39_2021012700.zip, Moodle 3.9.5+ on Debian GNU/Linux working perfectly otherwise, including creating and running VPL activities.
When I try to add a new question in a quiz, no VPL Question type is shown. No wonder, in the plug-in list (as admin) I see under Plugin name '[pluginname,qtype_vplquestion] qtype_vplquestion'. (Note the odd name, which also in square brackets.) And the Availability is 'Disabled' with not possibility of changing.
Something has gone wrong during the installation. This is a fairly new Moodle, since 3.8, I just downloaded the zip, unzipped in moodle/question/type, got a new directory 'vplquestion' and ran through the installation process on the web interface.
What could be missing?
Hi Alexandre,
Do you have any details about this problem that may help solve it?
Especially, do you end up with a grade when evaluating from the VPL side (instead of through a VPL Question / A quiz)?
Sorry for the inconvenience - this problem has been around for so long I really wish we can sort it out,
Best regards,
Astor
Hi everybody,
I'm also facing the cryptic message "An error occured during question grading (no grade obtained)."...
I have tried everything and have no clue...
I tried to debug it, but it took me too much time and I have too much work. I have to give up sad
Good luck !
AM.
Dear Astor,
thanks for the update! Unfortunately, I cannot find any message with "retrieve" in the logs - so this could not be the reason for the problems.
I also noticed the POLLHUP-Message, but this is also the case in the system where everything works as expected...
Best regards,
Michael
Hi Michael,
Just to clarify the logic behind the messages of the socket :
- Request for execution.
- Listen to messages from the execution server. There normally is one message each second describing the state of execution (compilation, actual execution...).
- Stop once we receive a message "retrieve:", meaning the execution has terminated and we should fetch the result.
So, if the execution server sends the "retrieve:" message before execution is over, that means there is a problem on that server side, I believe.
If it doesn't send any message containing "retrieve:", I do not understand what happens as the VPL Question awaits for that specific message to try and fetch anything.
If I look back to the logs you sent, there is a message "Program end or I/O error: Invalid argument 16 (POLLHUP )."
May this have anything to do with the problem ?
Best regards,
Astor
Hi Astor,
thank you for your reply and the idea with the message with "retrieve". But unfortunately I cannot find any message containing "retrieve" after the compilation. So this won't help us.
Any idea on how to proceed?
Thanks and kind regards,
Michael
Hi Michael,
Thank you for your investigations! I just came up with an idea: does the execution server send a message with "retrieve:" after the compilation (and before the execution)?
Maybe it does so when there are some compilation messages (like warnings, that do not prevent the execution from happening).
I'm looking forward to get this solved!
Astor
Dear Astor and Fabrizio,
thank you for those updates. AStor, I already noticed that you had this commit in your code repository, where line 97 was commented out. I have already tried this as a solution for my problem ("An error occured during question grading (no grade obtained)."). But unfortunately this did not solve this issue.
I started debugging the calls from moodle system to the jail server with my system and finally came up with the following behaviour, which in my opition could be the reason for the problem:
the order of calls to the execution server seems to be wrong: after compilation, first the result is fetched, which leads to a empty result. Afterwards the application is evaluated / executed, which then provides the result. But this result is not fetched anymore.
Any ideas about this?
Below I paste an extract of my loggings.
Best regards,
Michael
----------------------
Execute request 'request'
Request for process
Response Content-Length: 542
Sending 672 to fd 8
parse files 15
Send 672
Write file Main.java data size 117
Write file common_script.sh data size 5137
[...]
Compilation
run: maxtime: 240 seg, maxfilesize: 65536 Kb, maxmemory 524288 Kb, maxprocesses: 100
child pid 10535
chrooted "/jail"
setLimits: maxtime: 240 seg, maxfilesize: 65536 Kb, maxmemory 524288 Kb, maxprocesses: 100
change user to 10089
Jail::transferExecution to /home/p10089+vpl_evaluate.sh
Running "/home/p10089/vpl_evaluate.sh"
[...]
Execute request 'getresult'
[...}
Complete program output:
Delete file pre_vpl_run.sh
Delete "/jail/home/p10089/pre_vpl_run.sh"
[...]
Non interactive execution
Installing .vpl_launcher.sh in vpl_batch_launcher.sh
run: maxtime: 240 seg, maxfilesize: 65536 Kb, maxmemory 524288 Kb, maxprocesses: 100
child pid 10628
chrooted "/jail"
setLimits: maxtime: 240 seg, maxfilesize: 65536 Kb, maxmemory 524288 Kb, maxprocesses: 100
change user to 10089
Jail::transferExecution to /home/p10089+.vpl_launcher.sh
Running "/home/p10089/.vpl_launcher.sh"
New redirector state 0 => 2
Program end or I/O error: Invalid argument 16 (POLLHUP ).
New redirector state 2 => 5
Complete program output: Testing 1/1 : #015#012#015#012<|--#015#012-Summary of tests#015#012>+------------------------------+#015#012>| 1 test run/ 1 test passed |#015#012>+------------------------------+#015#012#015#012--|>#015#012#015#012Grade :=>>100
Write execution result
Hi @Astor Bizard,
we await the release of this new version!
Thanks for all!
Best regards,
Fabrizio.
Hi @Fabrizio TORRE,
This is a problem I figured out before the holidays and hotfixed on my side. I MAY (I totally did) have forgotten to publish the update.
However, I did not notice that it solved the problem of "An error occured during question grading (no grade obtained)."
This is wonderful!
I will come with an update soon!
Thank you for your help,
Best regards,
Astor
Hi,
commenting line 97 of the question.php file, in the directory /var/www/html/moodle/question/type/vplquestion/, the problem no longer arises (or so it seems).
Moreover, with this change we no longer have the following error: "An error occured during question grading (no grade obtained)."
I report the modified code, I hope it will be useful.
public function grade_response(array $response) {
        // require_sesskey();
        $deletesubmissions = get_config(QVPL, 'deletevplsubmissions') == '1';
        $result = evaluate($this->get_answer($response), $this, $deletesubmissions);
        $grade = extract_fraction($result, $this->templatevpl);
        if ($grade !== null) {
            if ($this->gradingmethod == 0) {
                // All or nothing.
                $grade = floor($grade);
            }
        } else {
            $result->evaluationerror = get_string('nogradeerror', QVPL);
            $grade = 0;
        }
        
        $this->evaldetails = json_encode($result);
        
        return array($grade, question_state::graded_state_for_fraction($grade));
    }

Best regards,
Fabrizio.