Virtual programming lab error ?

Virtual programming lab error ?

by Just2yoo Döme -
Number of replies: 1

I installed my VPL on my moodle, i set up my test cases, when i run the program in any language it run and evaluates but i got an error message: 

vpl_evaluate.cpp: In member function ‘void Evaluation::runTests()’: vpl_evaluate.cpp:1648:115: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘size_t {aka unsigned int}’ [-Wformat=] printf("Testing %lu/%lu : %s\n", i+1, (unsigned long)testCases.size(), testCases[i].getCaseDescription().c_str()); ~~~ ^

It says that all test passed but in Compilation section i see this error. how can i fix this ? i am using they original server because i don't have my own right now (Working on it). And how can i run PHP code inside VPL ? If i try to run php file i get this error message:

The compilation or preparation of execution has failed

It seems you are trying to test a program with a graphic user interface


Thanks for help

Average of ratings: -
In reply to Just2yoo Döme

Re: Virtual programming lab error ?

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hello,
It is a warning generated for the g++ that compile the program that test the students programs. The message is annoying but it is not a problem about the program behaviour.
You can remove the problem replacing the current file /mod/vpl/jail/default_scripts/vpl_evaluate.cpp
by
https://raw.githubusercontent.com/jcrodriguez-dis/moodle-mod_vpl/v3.3.6/jail/default_scripts/vpl_evaluate.cpp

There are other bug in the default php script. As a workaround, please set the following code in the vpl_run.sh file of the "Advanced settings" > "Execution files" of the activity setting.

#!/bin/bash
. common_script.sh
check_program php php5
PHP=$PROGRAM
get_first_source_file php
cat common_script.sh > vpl_execution
echo "$PHP "\"$FIRST_SOURCE_FILE\"" \$@" >>vpl_execution
chmod +x vpl_execution

Juan Carlos.