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.
Comments
Comments are no longer open for new posts. Existing comments remain available to read.
- add files to specific activities as "execution files" and remember to mark the files as "Files to keep when running": Ok - Done, but
- Install the third party package on the jail server and restart the service: Not done. In my server, i added third party to default package of Python, and test success on server when call function of third party.
Install the third party package on the jail server and restart the service.
You also can add files to specific activities as "execution files" and remember to mark the files as "Files to keep when running".
your comment is a bug that has been fixed in the 3.3. We use now a regular expression to detect numbers.
see
https://github.com/jcrodriguez-dis/moodle-mod_vpl/commit/b8fc63174337a883f8f973dc3497ef9698512e91#diff-730b93876f4d34ec69e467370ecaefe9
All done for my VPL, but when in my code python, using third party (example: stdio.py), (import stdio), i do not know where can i put the file stdio.py on Server of JAIL.
Thanks!!!
I'm not sure it's worth mentioning, I've modified locally the vpl_evaluate.cpp to cope with dot '.' in program output compared to expected output in vpl_evaluate.cases Else, punctuation ("Hi.") is confused with numbers (".5").
Here some explanation with a short example.
Suppose we want to test a program "+1" with the test.case :
Case = Test zero
input = 0
output = 1
Here a program solution (in C) :
int main() {
int n;
scanf("%d",&n);
printf("%d",n+1);
return 0;}
You can even give better solution :
int main() {
int n;
printf("Give a number ");
scanf("%d",&n);
printf("+1 : %d",n+1);
return 0;}
It works! VPL find the 0 and the 1 of the test.case. Great! It was not sure because of extra texts ("Give ..." and "+1 :"), but VPL skip these texts
But it does not work for :
int main() {
int n;
printf("Give a number.");
scanf("%d",&n);
printf("+1 : %d",n+1);
return 0;}
What's the difference? The difference is in the dot "." in the text "Give a number."! VPL think there is a number here...
The problem is in vpl_evaluate.cpp isNumStart
bool NumbersOutput::isNumStart(char c){
if(isdigit(c)) return true;
return c=='+' || c=='-' || c=='.';}
Yes, some numbers .5, .0, ... begin with a dot ".", but "." alone?
So I've changed it to :
bool NumbersOutput::isNumStart(char c){
if(isdigit(c)) return true;
return c=='-' ;}
And now, last program works. (but ".5" are to be written "0.5")
Best for you,
Denis B.
ps: There must be other solutions with better lexical analysis to recognize true numbers.
Is there a support in VPL for Visual Basic?
Thank you,
Meir
Best regards,
Juan Carlos.
I am able to run the following c program.
but I need to evaluate this program. please let us know if anyone can help me.
#include #include #include int main()
{
int pid, id;
if(fork() == 0)
{
/* open for writing */
printf("From child %d\n",getpid());
raise(2);
}
pid=wait(&id);
printf("From parent \n");
printf("Signal no= %d \n",id &355);
//waitpid(-1, NULL, 0);
return 0;
}
you can use java classes and packages in VPL. To resolve the problem you need to give full detail of your code and how you use it in VPL.
Best regards.
If you want to avoid that the user interact when the students RUN their code you must modify the default script of the language you are using and redirect the standar input to /dev/null.
e.g. if you are using java you must get the java default script and copy it to your vpl_run.sh , then replace the line
echo "java -enableassertions $MAINCLASS" >> vpl_execution
by
echo "{" >> vpl_execution
echo "java -enableassertions $MAINCLASS" >> vpl_execution
echo "} < /dev/null" >> vpl_execution
I recomend to use the "based on" feature.
Best regards.
some one already use vpl to java code with package and two classes in the same package?
because, i test this example and i have error.
Thank for your help
I am using the vpl module of moodle and i need to customize some of its functionalities.
I need to run sample testcases directly on RUN button and dont want command prompt to open and enter the input by user or student.
so any suggestions and idea u can give on this?
sorry for the inconvenience. You have two options:
1) Edit run_c.sh run_cpp.sh at mod/vpl/jail/default_scripts/ and remove that args. Also you can replace the C and C++ related scripts with the ones in the VPL 3.1.5
2) Upgrade your C++ compiler.
I will try to solve the problem in future releases.
Best regards,
Juan Carlos.
thank for your contribution. The next mayor release of VPL 3.3 will include a default script for Erlang.
Best regards.
"g++: error: unrecognized command line option ‘-fno-diagnostics-color’"
how can I fix it?
Best for you,
James TT