Archived posts, use them to search

Archived posts, use them to search

by Juan Carlos Rodríguez-del-Pino -
Number of replies: 1220
Picture of Particularly helpful Moodlers Picture of Plugin developers

A team of teachers at the ULPGC (University of Las Palmas de Gran Canaria, Spain) in collaboration with CICEI (Innovation Center for Information Society) has developed VPL (Virtual Programming Lab). VPL is an activity module to manage programming assignments providing the usual characteristics such as upload, download and view assignments, data backup and restore, grading, groups, access control based on roles, access logs, etc. adding also a large number of features tailored to the programming assignments:

  • Enable to edit the programs source code in the browser using an applet
  • Students can run interactively programs in the browser
  • You can run tests to review the programs.
  • Allows searching for similarity between files.
  • Allows setting editing restrictions and avoiding external text pasting.
Average of ratings: -
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Marc Grober -
Have you created a new module page at moodle.org for your new module?
In reply to Marc Grober

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hi Marc,

yes, I have created a module page at moodle.org, but I think that is waiting the moderator approval.
Nevertheless, the module has its own page at http://vpl.dis.ulpgc.es and a demo at http://demovpl.dis.ulpgc.es/moodle
All comments are welcome.

Thanks for your interest.
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Doug Loomer -
We are extremely interested in VPL, and would love to see the Demo, but can't get a connection to it. Is the page down?
In reply to Doug Loomer

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Thank you for your interest in VPL.
The server is up and running and shows no symptoms of having network problems. I wonder if you're still having problems accessing the server and if someone else has them (The latter is a request to the forum).

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Doug Loomer -
Hi Juan Carlos. I was able to reach the server today and play with the demos a bit. It looks like it could be just the thing for our AP and IB Computer classes. I am swamped at the moment, but want to install it on our test server soon. Thanks for making this available! Oh, a couple of observations. I was able to get the java applet editor to run in Firefox on my Mac, but not in Chrome. Perhaps the fault is with Chrome or my Mac, but I just thought I'd let you know. Also, I think "Editing" or "Editor" or "Edit" would be a better tab title than "Edition" in your English language version of the module. Keep up the excellent work!
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Ashish Kumar -

hello ,

we developed a new applet as per vpl, and we need to integrate it in VPL so please tell me how can we do this

 

 

In reply to Ashish Kumar

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Ashish Kumar,
I suppose that you have developed a new version of the editor/console applet of VPL. If it is the case, then you can learn how integrate it by reading de source code of the current applet. You must implement the same public methods than the org.acodeeditor.gui.Main class. The easyest way to set the new applet is replacing the corresponding jar file.
If you have developed another kind of applet, please, give us more details to understand the problem and help to resolve it.
Best regards.

 

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Ashish Kumar -

Dear Juan Carlos Rodríguez-del-Pino

Greetings......!

 

Thanks For your response , we make a Applet for J2ee and make the Jail Server  and need to integrate this applet with VPL Please share me the process for Integration of the applet in VPL

In reply to Ashish Kumar

Re: New Virtual Programming Lab (VPL) module

by deepa ganu -

Hi Ashish ,

Have you created an applet which would run the j2ee code on jail server. We are trying to do the same thing can you please guide us how to go about it

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Mónica Guerrero -
Hello, Juan Carlos.I have a question. I have two virtual machines one for moodle and one for jail-server. Virtual machines are in bridge mode. Moodle has a private ip 172.18..XX and public ip 190.96.X.X For the jail-server i have private ip 172.18.X.X. I have no problem for connection with jail-server and moodle in the internal network. However when I access Moodle from public ip 190.96.XX I have no connection with the jail-server, I am using port 80. What should I do to have connection with the jail-server. I understand that requests come to moodle and east to jail-server therefore should work.
In reply to Mónica Guerrero

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Mónica,

From VPL version 3, it is required that the browser can connect to the execution/jail server to monitor and interact with the running process.

Generally all the execution/jail servers must be accesible from internet. But only the ports used (http/ws and https/wss) of the servers need to be reachable.

In your case, if you don't want to use another public ip, you can set the "jail server" to use differents ports (80 and 443) than your moodle server. Configure your virtual machine hypervisor to port forwarding from your public ip (in this case shared with your Moodle server) to your jail server private ip. After that, you must access to your "jail server" using the public IP/name with the new port.

Best regards,
Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Antonio Lepore -

Hi Juan.

I've installed VPL, the jail-server in a virtualbox Ubuntu. In server cofiguration file /etc/vpl/vpl-jail-system.conf, I've setted just URLPATH=http://jailserver.it and #Port=8080. Then, i wrote http://jailserver.it:8080 in Execution servers config of the plugin. When I try to run my code, it appears this message: "PHP XMLRPC requiered".  What does it mean and how i can solve this problem? Please help me! 

Antonio.

In reply to Antonio Lepore

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hi Antonio,
I suppose that you are installing a 2.0.1 jail server. You're using incorrectly the URLPATH, this variable is part of the URL not the full URL. FOr example, if you set URLPATH=/HELLO your URL for your serviice must be http://jailserver.it:8080/HELLO.
The message you found say that your PHP don´t has the xmlrpc extension. VPL requires this PHP extension to communicate with the jail server.
Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Antonio Lepore -

Hi Juan,

i setted my file in this way. I have some problem with xmlrpc, but, if you don't mind, can you take a look to my file conf, thanks!

#


#vpl-jail-system config file


#


#Format VAR=VALUE #no space before and after "="




#JAILPATH set the jail path


JAILPATH=/jail




#MIN_PRISONER_UGID set start first user id for prisoners


MIN_PRISONER_UGID=10000




#MIN_PRISONER_UGID set the last user id for prisoners


MAX_PRISONER_UGID=20000




#MAXTIME set the maximum time for a request in seconds


MAXTIME=600




#Maximum file size in bytes


#MAXFILESIZE=64000000




#Maximum memory size in bytes


#MAXMEMORY=2000000




#Maximum number of process


#MAXPROCESSES=500




#Path to control directory. the system save here information of request in progress


#CONTROLPATH="/var/vpl-jail-system"




#Limit the servers from we accept request


#IP or net (type A, B and C) separate with espaces


#Format IP: full dot notation. Example: 128.122.11.22


#Format net: dot notation ending with dot. Example: 10.1.


#TASK_ONLY_FROM=10.10.3.




#To serve only to one interface of your system


#INTERFACE=128.1.1.1




#Socket port number to listen for connections (http: and wssmile


#default 80


#PORT=8080




#Socket port number to listen for secure connections (https: and wsssmile


#default 443


#SECURE_PORT=443




#URL path for task request


#act as a password, if no matches with the path of the request then it's rejected


URLPATH=/unimol.


The field in moodle is "http://jail:8080/unimol". 

Is this correct?

Antonio. 

In reply to Antonio Lepore

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

You must remove "#" from "#PORT=8080" and may be that you need to set the SECURE_PORT, for example you may set it to 8081.

Best regards

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Antonio Lepore -
Hi Juan, thanks for your ansie.  I ' ve many questions. 
1)What do I write into The file vpl_debug.sh And vpl_evaluate.sh? 
2) In Tab "Similarity", i Can upload one file. What does It Mean,  that I  can use this file like comparison method with students' test? 
Thanks for your time And help!
In reply to Antonio Lepore

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Aivar,
Promises must be fulfilled. VPL v3.1 (still beta) is ready to be downloaded  from GitHub and arrives with the web service that  I promised to you. To develop the client go to "tests/webservice_client.php" a test client that has the documentation inside.
Best regards

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Antonio Lepore -

Hi Juan,

I've a question for you. I've this file "vpl_evaluate.cases".

   1 Case = TC1
    2 Input = 5
    3 2
    4 
    5 Output = La somma tra 5 e 2 e' 7
    6 
    7 
    8 Case = TC2
    9 Input = -3
   10 -7
   11 
   12 Output = La somma tra -3 e -7 e' -10
   13 
   14 
   15 Case = TC3
   16 Input = 5
   17 2
   18 
   19 Output = La somma tra 2 e 5 e' 7
How I can evaluate every single case? For example
TC1 = 20%,TC2 = 30%,TC3 = 50%? Thanks for your help.
Antonio Lepore
In reply to Antonio Lepore

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Antonio,

Quoting from documentation

"When an error (the output of a test case does not match with any expected value) is found, the value "grade_range/number_of_cases" is deducted from the mark. This value can be set by the teacher with the following statement:

"grade reduction = [ value | percent% ]". The discount can be a percentage or specific value, in other cases is used the general criterion."


In your case the  file "vpl_evaluate.cases" must be:

Case = TC1
Grade reduction = 20%
 
Input = 5 2 Output = "La somma tra 5 e 2 e' 7" Case = TC2 Grade reduction = 30%
Input = -3 -7 Output = "La somma tra -3 e -7 e' -10" Case = TC3 Grade reduction = 50%
Input = 5 2 Output = "La somma tra 2 e 5 e' 7"
Best regards
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module - Problem with connecting Moodle and VPL Jail Server on a VirtualBox

by Gregorio dela Cruz Jr -

Dear Mr. Juan Carlos,

Please allow me to post my concerns for the second time.

My objective is to try the functionalities of the VPL first before pushing it to our organization.

Using a Windows 10 host OS, I have setup Moodle 3.1 on virtual machine with Ubuntu 16.04 OS and VPL Jail Server on another virtual machine with Ubuntu 16.04 OS also.

For the networking part, I have configured Adapter 1 as Bridged Network and Adapter 2 as Internal Network. The host and 2 Ubuntu machines can talk to each other.  I've tested that through the ping command.  I am able to access also the Moodle from any of the 3 machines (host and 2 guests).

For the VPL Jail Server, I believe it is running because when I access the site http://192.168.1.40:8080/OK, the output is also OK.

From the Moodle, I also setup the execution server which is http://192.168.1.40:8080/jailserver, where /jailserver is the one I typed in the jail server URL path.

The problem: When I run for example a C or Java program, I always get the message "No execution server found"  (something like that).

Is the design that I am currently implementing is really doable or possible? If yes, what could be the solution?

If no, what alternative you would suggest?


Thank you very much.








In reply to Gregorio dela Cruz Jr

Re: New Virtual Programming Lab (VPL) module - Problem with connecting Moodle and VPL Jail Server on a VirtualBox

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hello Gregorio dela Cruz Jr,

I think that your problem is related to your virtualbox network configuration. I suggest you to use in Moodle machine and Execution server machine a NAT network and port forwarding.
80 => 80 for Moodle machine
8080 => 8080 for execution server

Set as URLs your host machine name or IP. e.g.
http://hostsname:8080/jailserver

Ofcourse, the 80 and 8080 ports of your hosts (windows 10)  must be opened.

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module - Problem with connecting Moodle and VPL Jail Server on a VirtualBox

by Gregorio dela Cruz Jr -

Thank you Mr. Juan Carlos. Fortunately, I was able to make it up and running already using a bridged network.  However, I am very glad to try your recommendations also to increase the options.

I am also happy to successfully run C++, Java, Python, Assembly and SQL codes with test cases.  However, when a ran html pages, not output is shown on screen.  I believe that this is resource-related or do I need to install something on the jail server?

My regards and warmest thanks to you...






In reply to Gregorio dela Cruz Jr

Re: New Virtual Programming Lab (VPL) module - Problem with connecting Moodle and VPL Jail Server on a VirtualBox

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Gregorio de la Cruz Jr,

VPL 3.2 has just been released, I think an upgrade is what you need.

Best regards,

Juan carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module - Problem with connecting Moodle and VPL Jail Server on a VirtualBox

by Gregorio dela Cruz Jr -

Dear Sir,

I will try. Thank you.

I have seen another issue on file submission.  The file (e.g. C++ program) being submitted by the students do not appear on the teacher's page.  But on the student's page, it clearly shows that it has already been submitted because the student can no longer go back to the file.

What workaround should I consider?


Thanks and regards,


Gregorio dela Cruz Jr.




Attachment Untitled.png
In reply to Gregorio dela Cruz Jr

Re: New Virtual Programming Lab (VPL) module - Problem with connecting Moodle and VPL Jail Server on a VirtualBox

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Sir.
I can't reproduce the problem, please, give me more details to try to replay it.

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module - Problem with connecting Moodle and VPL Jail Server on a VirtualBox

by Gregorio dela Cruz Jr -

Dear Sir,

I have upgraded to VPL 3.2 but I noticed that the teacher can no longer see the "codes" being submitted by the student, unless he will "download" it.  Before, the teacher can see/read the student's "codes" on his screen.  This is very useful during manually grading the student's submission. It is a fact that not all files submitted by the students are 100% error-free. For codes with errors, we normally give grades proportionate to what have been done by the students.

  a. Is there any option to enable this?

  b. If none, how do i revert back to the old version of vpl (e.g. 3.1). I've tried uninstalling vpl 3.2 and put          the older version back, but it was rejected by moodle, repeatedly suggested to use the new version.

Please refer to the screenshots taken from vpl 3.2, teacher's screen (Submission List and Grade pages).

Thank you very much.



 

Attachment vpl_clarification1.png
In reply to Gregorio dela Cruz Jr

Re: New Virtual Programming Lab (VPL) module - Problem with connecting Moodle and VPL Jail Server on a VirtualBox

by Gregorio dela Cruz Jr -

Dear Sir, 


Here is the screenshot of what I had in vpl 3.1.5 but I can't see from vpl 3.2.



Attachment vplconcern.png
In reply to Gregorio dela Cruz Jr

Re: New Virtual Programming Lab (VPL) module - Problem with connecting Moodle and VPL Jail Server on a VirtualBox

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Dear Gregorio,

this is a very important issue, but I can help you if I can not reproduce your problem. To show what is working may help but it will be better to see what fail.

I think that it may be a issue related to the theme are you using. Please tell me what Moodle version and theme (I hope not customized) are you ussing.

I will be listen to try to resolver your problem as soon as possible.

Best regards,
Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module - Problem with connecting Moodle and VPL Jail Server on a VirtualBox

by Gregorio dela Cruz Jr -

Dear Sir,

The Moodle version that I am testing now is 3.1.  It is still on my local machine because I do lots of experiments and testing before deploying to the "live" machine.  

As I have mentioned in my previous queries, in VPL 3.1.5, I can see (as a teacher) the programs/codes submitted by the students.

But when I upgraded to VPL 3.2, I can no longer see the programs/codes submitted by the students.  Please refer to the given screenshots.  


Thanks and regards.

Attachment vplconcern2.png
In reply to Gregorio dela Cruz Jr

Re: New Virtual Programming Lab (VPL) module - Problem with connecting Moodle and VPL Jail Server on a VirtualBox

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

I have been trying to reproduce (Moodle 3.1 + VPL 3.2 + clear and more themes) the problem that you reported without success. I think that I need more details as a saved html page that shows the problem. As a workaroud, till the problem be found and resolved, you can use the "copy" button in the grade page. This action will copy the current submission into the teacher workspace to test or review it.
If you will, sendme a saved HMTL page with the problem.

Best regards,
Juan Carlos.

In reply to Gregorio dela Cruz Jr

Re: New Virtual Programming Lab (VPL) module - Problem in running and evaluation of C program in Moodle and VPL plugin on a VirtualBox

by Gowri Ganesh N.S. -

Dear Mr. Juan,

I'm using moodle - latest version 3.2 with the vpl plugin supported for the moodle and the vpl jail server 2.0.1.

As a teacher role I had created a VPL activity as


Hello world test in C

Due date: Friday, 28 April 2017, 5:30 AM
Requested files: hello.c (Download)
Type of work: Individual work
Grade settings: Maximum grade: 100
Run: Yes Evaluate: Yes
Automatic grade: Yes

Requested files

hello.c

    1 #include<stdio.h>
    2 int main()
    3 {
    4     printf("Hello World!");
    5     return(0);
    6 }

Execution files

vpl_run.sh

    1 #!/bin/sh
    2 gcc -Wall -o vpl_execution *.c

vpl_debug.sh

vpl_evaluate.sh

vpl_evaluate.cases

    1 Case = Test1
    2 output="Hello World!
    3 "
Having the above setup for my VPL activity for the simple hello world program. The student is not getting the run and evaluation icons enabled and not able to run and evaluate[see the screenshot that icons for run, evaluate are disabled].

I had tried with both setting with the above script using compiler command setting[gcc -Wall -o vpl_execution *.c] and also without entering this command in the vpl_run.sh.

(Note for my python course I'm able to both run and evaluate[see the screenshot that python course has enabled icon for run and evaluation ])

Kindly help what should I do to run and evaluate the program as a student and also to do the test activity as a teacher?
Attachment cprogram with run and eval icons disabled.png
Attachment python program with run and evaluation icon enabled.png
In reply to Gowri Ganesh N.S.

Re: New Virtual Programming Lab (VPL) module - Problem in running and evaluation of C program in Moodle and VPL plugin on a VirtualBox

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Mr. Gowri,
thanks for the screenshots. I think, based on the screenshots, that you forget to save the code. Notice that the contents in "requested files" are transferred in the first access to the student workspace, but you requiere to save it to run or evaluate it.
See the differeces between the two screenshots, in the C screenshot the "save" button is active. If there is any change not saved in the editor the "save" button is active and the "run", "debug" and "evaluate" buttons are deactivated.

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module - Problem in running and evaluation of C program in Moodle and VPL plugin on a VirtualBox

by Khadija EL KHARKI -

Dear Mr. Juan Carlos 

when i running my program, i have this error 

and also this error

/tmp/ccIiLrVP.o: In function `main': vpl_evaluate.cppsad.text+0x702a): multiple definition of `main' /tmp/ccvnkOS3.o:Pratique.cppsad.text+0x0): first defined here collect2: error: ld returned 1 exit status


In attach you find the scripts that I use for the configuration of my avtivity.


I need help solving my problem

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module - Problem in running and evaluation of C program in Moodle and VPL plugin on a VirtualBox

by Gowri Ganesh N.S. -

Dear Mr. Juan,

Sorry for the late reply.

Thanks I got it resolved.

with Best Regards,

N.S. Gowri Ganesh

In reply to Juan Carlos Rodríguez-del-Pino

New Virtual Programming Lab (VPL) module - Problem with executing HTML pages

by Prakash Raju -

Hi Juan,

I have VPL 3.2 installed. Buy still could't figure out a way to run HTML pages and auto evaluating them. Right now i don't have evaluate option enabled at all. (See screenshot below). For HTML pages, how are we supposed to give the test case. 

Also i would like to know, if we can bring in oracle and JSP inside VPL. If yes, Kindly give me your suggestions of doing the same.


Thanks,

Praveen Kumar

Attachment html.PNG
In reply to Prakash Raju

Re: New Virtual Programming Lab (VPL) module - Problem with executing HTML pages

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hi Praveen,
Sorry, but currently (by default) VPL can't test GUI programs. I don't know how to test HTML, but I give you an script to test the HTML and CSS files sending it to w3c.

Best regards,
Juan Carlos.

#!/bin/bash
# script for validate HTML and css in VPL sending files to w3c.org validators
# Copyright (C) 2014 Juan Carlos Rodrí­guez-del-Pino
# License http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
# Author Juan Carlos Rodrí­guez-del-Pino <jcrodriguez@dis.ulpgc.es>

#load common script and check programs
. common_script.sh
check_program x-www-browser
get_source_files htm html HTM HTML
RESULT_FILE=vpl_validation_index.html
cat > $RESULT_FILE <<END_OF_HTML
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Resultados de la validación</title>
</head>
<html>
<h1>Resultados de la validación (HTML y CSS)</h1>
<ul>
END_OF_HTML
for FILENAME in $SOURCE_FILES
do
    curl -m 2 -s -F "uploaded_file=@$FILENAME;type=text/html" -F "charset=utf-8" -F "doctype=Inline" -F "group=0" http://validator.w3.org/check > $FILENAME.html
    grep -E "Passed, .*>1 warning" $FILENAME.html > /dev/null
    if [ "$?" != "0" ] ; then
        ERRORSLINE=$(grep -E "Errors?,.*warning" $FILENAME.html)
        echo "<li><a href=\"$FILENAME.html\">$FILENAME</a> (<a href=\"$FILENAME\">original</a>)$ERRORSLINE</li>" >> $RESULT_FILE
    else
        echo "<li>$FILENAME passed  (<a href=\"$FILENAME\">original</a>)</li>" >> $RESULT_FILE
    fi
done
get_source_files css
for FILENAME in $SOURCE_FILES
do
    curl -m 2 -s -F "file=@$FILENAME;type=text/css" -F "profile=none" -F "usermedium=all" -F "warning=1" http://jigsaw.w3.org/css-validator/validator > $FILENAME.html
    grep -E "Congratulations! No Error Found\." $FILENAME.html > /dev/null
    if [ "$?" != "0" ] ; then
        echo "<li><a href=\"$FILENAME.html\">$FILENAME</a> (<a href=\"$FILENAME\">original</a>)</li>" >> $RESULT_FILE
    else
        echo "<li>$FILENAME passed (<a href=\"$FILENAME\">original</a>)</li>" >> $RESULT_FILE
    fi
done
cat >> $RESULT_FILE <<END_OF_HTML
</ul>
<p>Como validadores se han usado el <a href="http://validator.w3.org">W3C Markup Validator</a> para html
y <a href="http://jigsaw.w3.org/">W3C CSS Validator</a> para CSS
</body></html>
END_OF_HTML

cat > vpl_wexecution <<END_OF_SCRIPT
#!/bin/bash
x-www-browser $RESULT_FILE
END_OF_SCRIPT
chmod +x vpl_wexecution

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module - Problem with executing HTML pages

by Prakash Raju -

Thanks you Juan. That should be very useful for me. Yes

Sorry to bother you again. But can we execute jsp programs from VPL. If yes, how can we bring tomcat server into jail server??


Thanks,

Praveen

In reply to Prakash Raju

Re: New Virtual Programming Lab (VPL) module - Problem with executing HTML pages

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Sorry, I forgot answer this question in the previous post.

I think that it may be very difficult to run tomcat into a JailServer. Notice that the politic of VPL is that every execution is independent and don't left changes after finished. Launch an separated Tomcat for every run may be dificult. I have'nt reach to do this with VPL.

Best regards,
Juan Carlos.


In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module - Problem with executing HTML pages

by deepa ganu -
Hi Jaun , 

BUt the script would only check the validations of a html and css accroding to w3c, but just like how we can write test cases for web pages using selenium , can we write it too and trigger the selenium framework programatically  to have a functionality check. Coz along with the HTML page we are looking for javascript n functionality check too. Lemme know what you think about this?

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Gerrit Leder -

Hello,

thanks for vpl. The download of the jail archive was very slow...


BR

Gerrit

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by deepa ganu -

Hi jaun

can u please help us with this

a) Is the jsil server multi threaded. We are currently using a single jail server.While the load is less (let us say less than 10 users) there is no problem .However when the load is much more like 300 users simultaneously calling run we suspect that the jail server is responding to the ready request with not available.

b) If the jail server is not multithreaded how do we increase the number of jailservers without enhancing the physical machines?

c)If the jail served is indeed multithreaded how do we control its threading policy.


Do u think the problem is vpl plugin or jail server. Should we use load balancing server with moodle or add more jailnservers

In reply to deepa ganu

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Deepa,
Answer a) Yes the jail server can run multiple task at the same time. The algorithm used to balancing the load first ask the selected server if it can run a the new task (test if can give the needed memory to the task). If no server can run the task the system say "no server available".
If you retry the action the system will retry the test.
Answer b) I think that the best way to use a good server is using virtualization software. VMware technologie (vSphere) may be a good solution.
Answer c) Currently VPL has a unique load balancing politic. Try reducing the max memory for the tasks you use.

The problem you describe are related to VPL not to Moodle, I think that the solution is increase your jail servers (power or number). You also can try increasing the swap area in your jail servers to support more number of task simultaneously, but this can have an bad effect in the performance.

Think about the resources needed to run 300 task simultaneously.

Best regards.

Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Steve Towson -
Hello.

What programming languages does it support? Just C? How about Python?
In reply to Steve Towson

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hello Steve.
VPL supports other languages such as Ada, Java, C++.
You can find the list of supported programing languages at the page
http://vpl.dis.ulpgc.es/index.php/documentation/31-supported-programming-languages
Currently Python is not supported in the sense of syntax highlighting and files comparison, but this does not prevent to install an interpreter on a jail-server and execute code written in this language.
If you wish I can add "Python support" at the todo list.
If you have any problem installing a jail-server does not hesitate to ask me.
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Gulshan Kumar -
Dear Juan,

I have followed every step as mentioned in VPL Docs (for installation and configuration), but encountering the error "No jail server available" while 'Run'ing the C program. I have a CentOS 5.3, with PHP5.3 and Java 1.6.0 installed.

Please guide me.

In reply to Gulshan Kumar

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Dear Gulshan
Check this please:
1) After installing the jail-server you can use a “telnet” to check that the server is accepting requests. Don’t forget to use the adequate port with ”telnet” (the port number is set at "/etc/xinetd.d/vpl-xmlrpc-jail", but may change with NAT configuration). The server should respond with an error message because it expects an http request. If no reply you may have a server configuration issue or firewall problem.
2) Check that the URL you are using is according with the “-uri” parameter at "/etc/xinetd.d/vpl-xmlrpc-jail"
3) If you need more information you can add "-d 255" in “server_args” at "/etc/xinetd.d/vpl-xmlrpc-jail" to get detailed information in the system log (jail-server).

I am pleased to inform you that version 1.2 is available. It can give you more information about connection problems.

Please, let me know if this solves the problem

Best regards
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Dear Gulshan,
In the previous post I forgot to tell you that you should check the memory requirements of the activity. If your memory requirements are greater than the maximum value configured on the jail-server, then it will reject the request.

Kind regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Gulshan Kumar -
Dear Juan,

Thanks for your quick response, right now I'm out of town, but will definitely look into what you have suggested.
And will bother you again (if I stuck somewhere), i hope you don't mind ?
Again thanks for your reply.

Regards,
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Gulshan Kumar -
Dear Juan,


I have checked everything as you have suggested, telnet is opening a blank screen on the port mentioned at "/etc/xinetd.d/vpl-xmlrpc-jail"; but now getting a different kind of error it says 'Not executed'.

Thanks,
In reply to Gulshan Kumar

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Dear Gulshan Kumar,
Your instalation is now working, the message indicate that you do not generate the apropiate "vpl_execution" file by executing the "vpl_run.sh" script.
For example a simple "vpl_run.sh" for C language may be
---------begin of file--------------
#!/bin/sh
gcc -Wall -o vpl_execution *.c
----------end of file--------------
I think that this may be the last step to have a simple activity running.

Sorry, I'd like to ask you a question out of topic : are you relative of the famous Indian Bollywood movie producer?
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Brandon Horn -

I'm getting the same error. What would be an example of the file for Java? Once I make it, can I set it as the default for all assignments or do I have to edit it for each?

In reply to Brandon Horn

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Dear Brandon
A "vpl_run.sh" file content for Java language may be
---------begin of file--------------
#!/bin/sh
. vpl_environment.sh
#this path may vary on different jail-server
PATH=$PATH:/usr/lib/jvm/java-1.6.0-openjdk/bin
javac -J-Xmx128m *.java
NAME=$(basename $VPL_SUBFILE0 .java)
if [ -f $NAME.class ] ; then
echo "#!/bin/sh" >> vpl_execution
echo "PATH=\$PATH:/usr/lib/jvm/java-1.6.0-openjdk/bin" >> vpl_execution
echo "java -Xmx128m $NAME" >> vpl_execution
chmod +x vpl_execution
else
echo "Not compiled or error in filename"
echo "The main method must be in the first file."
fi
----------end of file--------------
This script compiles all *.java files and generates a "vpl_execution" file to run the program starting at the main method in the first file.
The memory limit must be set to 256Mb or greater.
Others VPL activities can use this script file by using the "based on" option.

Please, let me know if this solves your problem
Best regards
Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Brandon Horn -
Thanks for the help. I'm waiting for my hosting company to install the JDK instead of just the JRE so that javac is available. I'll let you know whether it works then.

If it does, you should definitely include sample vpl_run.sh files for various languages in the installation instructions. I would never have made up that file and without it, the add on is mostly a fancy text editor.

Brandon
In reply to Brandon Horn

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Dear Brandon
I have in my TODO list the task of make available basic VPL activities for as many languages as possible. This activities could be added easily to any course.
In your last post you said that your hosting company is going to install the JDK instead of just the JRE. I don't know about your instalation arquitecture, but you should note that you don’t need a compiler or interpreter on your Moodle server, except PHP. All the tools of programming languages must go in the jail-server. For security reasons, I don’t recommend using the moodle server as a jail-server, I strongly recomend to use virtual machines with readonly disks as jail-servers.

Best regards
Juan carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Brandon Horn -
Juan carlos,

I don't have much choice on using the same server. I'm running Moodle on a VPS. A second VPS or a machine with sufficient memory to run a virtual server inside are both prohibitively expensive. I'm also less worried about security issues because of the small number of users with access to my Moodle installation (any my ability to make their lives uncomfortable if they attack the server smile ). If my district ever decides to use this with multiple classes, I'll make sure they run the jail server in a virtual box.

With the current configuration (jail server on same box), where do I have to put the Java compiler so that the jail server can access it? Currently, javac is in the path:

/usr/local/jdk1.6.0_21/bin

As far as I can tell, the jail server has the path:

/jail

In /jail there are directories such as:

/jail/bin
/jail/home
/jail/usr

and so on.

In reply to Brandon Horn

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
The "/jail" directory is an adapted replica of the root file system, the processes in the jail sees the “/jail” directory as its root file system. You must use the same paths that in the host file system.

I suppose that your VPS is running Red-Hat, CentOS or equivalent linux distribution, if not, you may have problems with the scripts that start and stop the jail system because these scripts are made for these systems.

Do not hesitate to contact me if you have another question

Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Brandon Horn -
Juan Carlos,

Hi again. Thanks for the help so far. This would be incredibly useful to get running.

Here's the current situation. I am running CentOS and the jail server does run. I know it runs because I can telnet to it and because I get, "Not executed" rather than a failed connection.

I copied the bin directory from my JDK installation to:

/jail/usr/local/jdk1.6.0_21/bin

My vpl_run.sh file looks like this:

#!/bin/sh
. vpl_environment.sh
#this path may vary on different jail-server
#PATH=$PATH:/usr/lib/jvm/java-1.6.0-openjdk/bin
PATH=$PATH:/usr/local/jdk1.6.0_21/bin
javac -J-Xmx128m *.java
NAME=$(basename $VPL_SUBFILE0 .java)
if [ -f $NAME.class ] ; then
echo "#!/bin/sh" >> vpl_execution
echo "PATH=$PATH:/usr/local/jdk1.6.0_21/bin" >> vpl_execution
echo "java -Xmx128m $NAME" >> vpl_execution
chmod +x vpl_execution
else
echo "Not compiled or error in filename"
echo "The main method must be in the first file."
fi I'm stumped. Brandon

In reply to Brandon Horn

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hi Brandon,
First, you need to undo the copy of the JDK instalation to the “/jail” directory. In my last post I said that the “/jail” would be an adapted replica of the root file system, I omitted that this replica is made automatically by NFS. The vpl-jail-system service is the responsible to prepare the “/jail” directory (make the replica) and enable the vpl-xmlrpc-jail daemon.
You can use the command “service vpl-jail-system restart” to check if appear any error messages in this process.
If the vpl-jail-system start correctly you must see a read-only replica of “/bin” at “/jail/bin”. To add software to the jail system you only need to add software to the host system.

Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Brandon Horn -

Juan Carlos,

Hmm. I deleted the copy and I changed my path back to what it would be on the local system. There are no errors in the log. I still get, "Not executed"

What resources are required by your preconfigured virtual machine (CPU, disk, RAM)? I'm sure my hosting company could handle the installation, but I'm doubtful that the account has the resources to run it. I might be able to get some financial support from my school if I can show how useful this would be.

Brandon

In reply to Brandon Horn

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hi Brandon

I need more information to try to resolve the problem. Please copy the file “vpl_run.sh” to the file “vpl_evaluate.sh” and then use the button “evaluate” . This will give us more information about what is happening.

Juan Carlos
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Brandon Horn -
JC,

The message is still "Not executed" When the "Evaluate" button is pressed. This is true with the same code in vpl_run.sh and vpl_evaluate.sh and with the code only in vpl_evaluate.sh (and nothing in vpl_run.sh).

B
In reply to Brandon Horn

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Dear Brandon,

After take a closer look to the problems that you report, I think that you still have a jail-server problem. Please, check that the file system replica at the jail directory is working well (/jail/usr => /usr, /jail/bin => /bin and /jail/lib => /lib). I must notice that the jail-server for CentOS need a running NFS server.

To get more information about the problem add "-d 255" in “server_args” at "/etc/xinetd.d/vpl-xmlrpc-jail". This will generate a detailed report of the jail daemon executionin in the system log “/var/log/messages”.

If you don't found the problem, you can send me the "/var/log/messages” file to search it.

Best regards

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Brandon Horn -
Juan Carlos,

Thanks for all the help, but getting this to work is beyond me. I might try again in a year if I develop better skills with Linux.

One last question: Is there an easy way to uninstall the VPL module from Moodle? What changes to the Moodle database need to be undone on uninstall?

Brandon
In reply to Brandon Horn

Re: New Virtual Programming Lab (VPL) module

by Brandon Horn -

Thanks for helping me configure the server. It works great now!

For anyone else who got the jail server working but is having trouble getting Java files to compile and run, the attached TXT file contains code for vpl_run.sh and vpl_debug.sh that worked for me.

Brandon

In reply to Brandon Horn

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
How to remove VPL from a Moodle server:
1. Make a backup
2. Remove all the instances of VPL
3. Remove the directory “…/moodle/mod/vpl”
4. Remove the directory “../moodledata/vpl_data”
I don’t know the whole effect of removing VPL tables.
5. Remove (at your own risk) the VPL DB tables: vpl, vpl_submissions, vpl_jailservers, vpl_variations and vpl_assigned_variations.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Gulshan Kumar -
Dear Juan,


Thanks for the help extended, but my setup doesn't seems to work (even failed to run a Hello World program in C). Now it is taking a lot time and after a minute or so it throws Jail Connection Timeout, Console Timeout and proxy timeout.
I hope there will be some more setting required.
And I am sorry to tell you that I am not relative to movie producer Gulshan Kumar, its just the name and music which is common wink

Thanks

In reply to Gulshan Kumar

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Dear Gulshan,
It seems that you are getting all the problems that we can offer. The symptoms indicate that you have a firewall configuration issue on the moodle server. You need to open the range of ports you have set in the general configuration of the module, if for any reason you can’t open these ports, you also can use the module without interactive execution by setting the script file “vpl_evaluate.sh” . The content of this file may be, in your case, equal to the content of “vpl_run.sh”. In this case, the output of the execution is saved and is show in different pages of VPL: the applet editor, the submission view, the evaluation page, etc.

Juan carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Gulshan Kumar -
Dear Juan,


Thank you very much for your help, problem has been resolved by opening the ports.

Are the configurations same for C++ and Java compiler?

Thanks
In reply to Gulshan Kumar

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Dear Gulshan

The configuration for C++ is almost identical to the configuration for C. You only need to change the compiler from “gcc” to “g++”. The java configuration is more complex due to the need to run the java interpreter.

Again, an off topic question: In which context do you plan to use the VPL module?
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Gulshan Kumar -
Dear Juan,


Right now I will stick to the C and C++.
Anyhow thanks for the help.

Actually I am using Moodle for my college, someday I was wandering about the plugins for moodle, and your work strike the bell. And here I am.
I am trying your VPL just out of curiosity, nothing special.

Thanks for the help.
In reply to Gulshan Kumar

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Thank Gulshan,
I just want to know about the use of the module.

In my last post for you, I forgot to say tthat you must change, at the compiler comman, the filenames from "*.c" to "*.cpp" or the extensión for C++ that you use.

Best Regards
Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by udara weerakoon -

Dear Juan,

I have tried to run "Hello world" C program according to your guidence given, but I'm receiving an access denied message as show in the picutre. Could you please help me to overcome this problem?

Thank you.

Udara.

Attachment access denied.JPG
In reply to udara weerakoon

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Udara,

To bypass this problem (to run programs in console) you must not access to your Moodle from the same machine (the server machine).

This is a known problem (or behavior) of the latest versions of Oracle Java plug-in, for example IcedTea plug-in for Ubuntu doesn’t show this behavior. For security reasons, applets are forbidden to connect to the local machine. Really, applets only are allowed to connect to the server from where they were downloaded. Oracle Java plug-in seems that prioritizes the ban.

Best regards.

Note: the user can give more priviliges to a Java applet, but I think that in this case it is not needed.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by udara weerakoon -

Dear Juan,

First, Thank you so much for your quick reply. I really appreciate it.

I'm browsing Moodle LMS using my desktop machine (which has windows xp operating system), but the Moodle server is a ubuntu based one. One more point, both Moodle and Jial services run on the same ubuntu server. I have installed icedtea6-plugin in my ubuntu server (server that has hosted both moodle and jial services), but still I am getting the same error message sad.

Thank you

Udara

In reply to udara weerakoon

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Udara,
one question and one supposition:
Can you acces and run programs at the demo site http://vpldemo.dis.ulpgc.es/moodle with your Windows XP?
I suppose that you are using a firewall (at the client or server) that prevents the connection. If you can run programs at the demo site then the problem is at the server.
Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by udara weerakoon -

Dear Juan,

Yes, I can run programs at the demo site as both a student and a teacher without any problem. So, I don't think it is a problem in my desktop (client running on windows xp) machine, but probably the server. I have allowed port number 52000 in the firewall at the server. Do I need to configure the firewall (Server) any more?

Thank you.

 

Udara.

In reply to udara weerakoon

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

You need to open, on Moodle server,  the range of ports you have set in the general configuration of the VPL module.

Best regards.

Attachment screen.png
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by udara weerakoon -

Dear Juan,

Thank you very much, I appreciate your helping me.

My confussion is, Do I need to add any records to my iptables of the server, since both Jail and Moodle services are running in this server?

Thank you.

Udara.

In reply to udara weerakoon

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

You need to open the port range because the connections not only come from the Jail, also come from the applet console at the browser.


Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by udara weerakoon -

Dear Juan,

Great! Thank you so much

Udara.

In reply to Gulshan Kumar

Re: New Virtual Programming Lab (VPL) module

by Antonio Lepore -

Sorry, I search "/etc/xinetd.d/vpl-xmlrpc-jail" in server directory but nothing. How is possible this?

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by OEE_Dev KW_Univ -

Hi, I am trying to run a java program using your interesting VPL module. I Installed jail server under  CentOS 5.5 and everything seems to be fine. I did clean installation for CentOS and configure it by following steps mentoined in your documentation, i.e. I didn't use preconfigured installation and I don't want to use virtual machine. I am running jail server on separate machine and connecting it to the other server machine where moodle is running.

But I am getting timeout when attempting to run some code. When I checked the /var/log/messages file , it indicates that error has bee generated that POST is expected and found GET instead.

I reviewed the documentation provided on your site but I can NOT  well understand what is meant by the following statement :

" "-uri path". Sets the path to add the URL of the server. If we had a server named "localhost" the URL to use in requests would be "http://localhost:port/path. The default is "/RPC. This parameter can be used as key, because if not used in the URL the request is not heeded.
"-d #". Sets the debugging level, a greater number means more information in the system logs. "

  1. What is meant by server? server where moodle is running? Or server where jail service is running?  I am running jail server on separate machine and I configured firewall settings.
  2. What is meant by "/RPC"?
  3. Do I need a value for "/path"? What is it?
  4. What is value for "-uri" argument?

 

I didn't set any *.sh file, do i need them even I want to run each submission alone?

 

thanks and keep pacing forward

Best.

Oee.

In reply to OEE_Dev KW_Univ

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Oee,
I’ll try to answer your questions

Q1.    What is meant by server? server where moodle is running? Or server where jail service is running?  I am running jail server on separate machine and I configured firewall settings.
A1. In this paragraph “server” refers to “jail server”.

Q2.    What is meant by "/RPC"?
A2. The requests from the “moodle server” to the “Jail server” use XMLRPC protocol and “/RPC” is the default path in the URL of a XMLRPC service. Omitting the “-uri” parameter is equivalent to use “-uri /RPC”

Q3.   Do I need a value for "/path"? What is it?
A3. To simplify the configuration you may use “-uri /” then you can use as URL of your “jail server” http://hostname:port

Q4.  What is value for "-uri" argument?
A4. Well, “uri” is the parameter name for the “path” in the URL to the “jail server” (http://hostname:port/path)

Q5. I didn't set any *.sh file, do i need them even I want to run each submission alone?
A5. The VPL versions <=1.3 always need to setup “vpl_run.sh” file or  “vpl_evaluate.sh”  file to run programs. You may use the "based on" option to reduce the script files setting. The VPL 1.4 version will be loaded with default scripts for common programming languages as C, C++, Java, C#, etc.


A basic file for “vpl_run.sh” or “vpl_evaluate.sh” for Java may looks like this:
===========================
#!/bin/bash

#load VPL environment vars
. vpl_environment.sh
#reset LC_ALL
export LC_ALL=en_US.utf8
#Set path to JDK
PATH=$PATH:/usr/lib/jvm/java-1.6.0-openjdk/bin
#compile
echo "The first file/class must have the Main method"
javac -J-Xmx64m *.java
NAME=$(basename $VPL_SUBFILE0 .java)
if [ -f $NAME.class ] ; then
echo "#!/bin/bash" >> vpl_execution
echo "export LC_ALL=en_US.utf8" >> vpl_execution
echo "PATH=\$PATH:/usr/lib/jvm/java-1.6.0-openjdk/bin" >> vpl_execution
echo "java -Xmx64M -enableassertions $NAME" >> vpl_execution
chmod +x vpl_execution
else
echo "No compiled or error in file name"
fi
===========================

Examples of /etc/xinetd.d/vpl-xmlrpc-jail file:
1)
====================================
service vpl-xmlrpc-jail
{

port = 8080
# no server_args parameter

}
=====================================
If the server name is “jail1.uni.edu” then the URL to access the service in the “jail server” would be http://jail1.uni.edu:8080/RPC

2)
====================================
service vpl-xmlrpc-jail
{

port = 52000
server_args = -uri /

}
=====================================
If the server name is “jail1.uni.edu” then the URL to access the service in the “jail server” would be http://jail1.uni.edu:52000

Hope that this helps you.
Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Can't run c++ programs

by OEE_Dev KW_Univ -

Thank you for your response.

When I am accessing the jail server via web browser firefox I got the following reply written in a blank page :

Server: vpl-xmlrpc-jail
Connection: close
Content-Length: 41
Content-Type: text/html;chartype=UTF-8

<html><body>Not Implemented</body></html>

What does this message mean? Is my jail server working well and ready to accept request?
given that when I telnet jail server I got empty screen.

I have postponed testing compiling and running Java programs as I realized that
it would be better to firstly test C++ programs because C++ compiler is already installed
on the jail server and it works pretty fine and I can compile/execute c++ programs from
from command line using this command:

g++ -Wall -o vpl_execution test.cpp


So please help me first detecting and tackling compiling/executing C++ programs first.

one more question:
The ports range set in general settings page of a the module should be opened on the moodle server or jail server?

best.
In reply to OEE_Dev KW_Univ

Re: Can't run c++ programs

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Sorry for the delay of the response.
The message you get from the server is correct, your jail server is running and is reachable.
If you want to compile and run C++ programs you could use for “vpl_run.sh” and “vpl_evaluate.sh” a script like this:

------------------------------

#!/bin/bash
g++ -Wall -o vpl_execution *.cpp

-----------------------------
The port range set in the general setting should be opened in the Moodle server only.

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Can't run c and c++ programs

by Tanaji Patil -

Dear Juan,

I have installed Moodle 2.9 Server with mod_vpl 3.1.3 on CentOS 7 64-bit. Then on another server (again CentOS 7 64-bit) I installed vpl-jail-system-2.1.1. I tested it through browser and the status is OK. Then I tried to execute programs from moodle vpl activity, I am able to execute Java, Python programs but I am getting error for C & C++ programs as "gcc: error trying to exec 'cc1': execvp: No such file or directory".

Am I missing anything? I have executed install-vpl-sh script to install the jail-server.

In reply to Tanaji Patil

Re: Can't run c and c++ programs

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Tanaji,
vpl-jail-system-2.1.1 has been tested on Ubuntu 14.04 LTS and is the linux distribution that we recommended to use. I don't have a answer to your problem, I need spare time to reproduce your installation and find out the problem. If your are in a hurry, try using Ubuntu, if not, you may wait my response in a few days.

Best regards.
Juan Carlos Rodríguez


In reply to Juan Carlos Rodríguez-del-Pino

Re: Can't run c and c++ programs

by Tanaji Patil -

Hello Juan,

Thanks for reply. I will try it on Ubuntu  14.04 LTS.

Best Regards

Tanaji Patil

In reply to Tanaji Patil

Re: Can't run c and c++ programs

by Tanaji Patil -

Hi Juan,

Thanks a lot. I just tried on Ubuntu 14.04 LTS Server and it is working fine.

Regards,

Tanaji Patil


In reply to Juan Carlos Rodríguez-del-Pino

Re: Can't run c++ programs

by manoj joseph -

how to run  and comple multiple c files in vpl pluging?

It showing two mains found..

In reply to manoj joseph

Re: Can't run c++ programs

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

might be that you have two mains functions in your code files?


In reply to Juan Carlos Rodríguez-del-Pino

Re: Can't run c++ programs

by manoj joseph -

I have  two separate programs ,both having main fuctions .Both programs works if we run after deleting one file.If 10 files in vpl assignment how do we select each file for running.In vpl all programs running as single project i think

Attachment test
In reply to manoj joseph

Re: Can't run c++ programs

by Andrei Băutu -
Picture of Plugin developers

I believe you are correct. VPL tries to compile all files (similar to how you would compile a program from multiple files). That's why it complains about your files having multiple main functions. 

So if you want to give your students 2 programming task (eg. one to print hello world and the other to add two numbers), then you'll have to create 2 VPL activities.

Your problem is a bit related to my question here https://moodle.org/mod/forum/discuss.php?d=154988#p1447624 : How can I use one VPL activity for multiple programming tasks? OR (alternative option) How can I organize multiple VPL activities into some kind of group (so that the course page has less entries)?

Cheers,
Andrei

In reply to Andrei Băutu

Re: Can't run c++ programs

by manoj joseph -

Then,Why did they kept muliple file upload ?

In reply to manoj joseph

Re: Can't run c++ programs

by Andrei Băutu -
Picture of Plugin developers

There are many use-cases for programming tasks that require multiple files. Some examples:

- you ask your students to define a C++ library in separate files (header file and cpp file)

- you ask your students to write some program that read from a data file and you allow them to upload the program code + the data file.

- you ask your students to create a Drupal module or a Moodle plugin (which by definition have multiple files)

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by OEE_Dev KW_Univ -

Dear,

What jail server version should I install ?   vpl_xmlrpc_jail-1.0.1.tar.gz   OR  vpl_xmlrpc_jail-1.1.tar.gz  OR vpl_xmlrpc_jail-1.0.tar.gz  ?

I am running CentOS 5.5 clean installation on different machine other than Moodle server machine (Windows2000 server, PHP 5.2, IIS) and installed VPL-module version 1.3

Here are symptoms:

  1. When I click evaluate I got "No jail server available" error.
  2. When I click run , I got "Running (Timeout)"
  3. When telnet the jail server:port I got blank screen only
  4. and when access the server through the designated port via web browser, I got blank page with this text in it:
Server: vpl-xmlrpc-jail
Connection: close
Content-Length: 41
Content-Type: text/html;chartype=UTF-8

<html><body>Not Implemented</body></html>

 

By the way, How can I uninstall jail server from the machine?

 

Please guide me.

thank you for your effort and time

best.

In reply to OEE_Dev KW_Univ

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi again,
You should install vpl_xmlrpc_jail-1.1.tar.gz.
The symptoms show that your VPL module cannot reach the “jail server”.
1)    Check the URL of the jail server you set in the general setting. Be carefull with the URL path field (http://jailservername:jailserverport[/path]), it must match the configuration at file "/etc/xinetd/vpl-xmlrpc-jail" (-uri) in the "jail server".
2)    Check that your firewall lets the IIS/PHP server access the “jail server”. You can stop the firewall for a minute to check if the firewall configuration is the problem.

To uninstall the “jail server” from Centos use this steps
1)    Run “chkconfig --del vpl-jail-system”
2)    Remove “/etc/vpl” directory
3)    Remove “/jail” directory
4)    Remove “/etc/xinetd.d/vpl-xmlrpc-jail” file
5)    Run “service xinetd restart”

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Prav M -

Hi Juan,

I followed the instructions for installing Jail server on Ubuntu. When I try to access the vpl from Moodle, it give me a server busy. When I try to access via web page, this is what I get:

This xml file does not appear to have any style information associated with it. THe document tree is shown below.

<html>

<body>

<Not Implemented>

<br/>http GET request not implemented

</body>

<html/>

And can you explain the first portion of the vpl_xmlrpc-jail xinetd file?

protocol=tcp

type=UNLISTED

user=root (what user is this?, should we change it?)

server = /etc/vpl/vpl-xmlrpc-jail ( is this service file name?)

Also, in Ubuntu, do we install NFS? and should we open the port in /etc/services?

Thanks

Praveen

In reply to Prav M

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Prav,
The problem using the jail seems to be that you configure your assignment to request too much memory and you configure the jail server with a low memory limit. To resolve this problem reduce the memory requested at “Resources limits|Maximum memory used” or increment the memory limit at the jail daemon config file “/etc/vpl/vpl-xmlrpc-jail.conf”.
xinetd options:
protocol=tcp
This is the type of network protocol used

type=UNLISTED
This is for named services (VPL is not asigned)

user=root (what user is this?, should we change it?)
This is the user that runs the service. It must be root.
server = /etc/vpl/vpl-xmlrpc-jail ( is this service file name?)
Yes, this is the program that manage the service (the VPL jail daemon)
You don’t need to install NFS in Ubuntu, this is required only for CentOS/RedHat 5
Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Prav M -

The vpl-xmlrpc-jail.conf has only JAILPATH,MIN_PRISONER_UGID,MAX_PRISONER_UGID and MAXTIME.

Do I need to add MAXFILESIZE & MAXMEMORY?

And should I restart only the vpl-jail-system or also the xinetd?

 

Thanks for your help.!

In reply to Prav M

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

To have more information about why the deamon says it is busy add "-d 8" in “server_args” at "/etc/xinetd.d/vpl-xmlrpc-jail". This will generate a detailed log of the jail daemon execution in the system log “/var/log/messages”.

If you don't found the problem, you can send me the file "/var/log/messages” to review it.

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Gerrit Leder -

I have test data in vpl_evaluate.cases adopted from output test to "Hello World!"

Unfortunately there seems to be no input passing as command line arguments for my java class: The program detects no command line arguments.

I suppose that the input data specified is passed as "stdin" and not as the java command line argument.

Can this be changed?`

Or do you have a "vpl_evaluate.sh" for java classes that takes care of the command line argument input?


Thanks in advance!

Gerrit

In reply to Gerrit Leder

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Gerrit,
sorry, but the current version of VPL do not support passing arguments to the program tested. We have received different requests to improve the tests configuration and we are working to add new features as you can see in
https://moodle.org/mod/forum/discuss.php?d=154988#p1390964
Passing command arguments to the tested program will be included in the new features of VPL 3.3.

Best regards,
Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Gerrit Leder -

Thank you! Can I  plz have a look at the 3.3 development version? Do I checkout branch 3.3 or 3.3dev best?


BR

Gerrit

In reply to Gerrit Leder

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

The brach 3.3dev is the correct one.

BR

Juan Carlos.


In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Gerrit Leder -

I have one more question:


do you plan to release version 3.3 of VPL matching the release of moodle? And when will that roundabout be?


Thanks for your efforts!

BR

Gerrit

In reply to Gerrit Leder

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

No Gerrit, I am not planning to release VPL 3.3 at the same time that Moodle 3.3, but it may coincide. Notice that current VPL is also compatible with previous Moodle versions.

Best regards,

Juan Carlos


In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Gerrit Leder -

Hello Juan,


we are eagerly waiting for the command line parameter evaluation!

Another function we would like to see in this context, is a second button for execution of the application under test with the possibility to enter command line parameters, too!


Thanks in advance!

Gerrit

In reply to Gerrit Leder

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Gerrit,
we want to release the new 3.3 release of VPL, but with the new features properly tested. We also are trying accomplish and pass, as most as possible, the Moodle prechecks for plugins. We have incorporated continuos integration to the VPL development process by using travis-ci.org. Notice that VPL is a large plugin and it's needed time to adapt the code to the new Moodle requirementsand detect and remove the errors added in this changes.
About to your especific question, a realistic prevision is that VPL 3.3 will be released on july. A new feature, among others, will be the possibility of adding command line to the program of each test. It's not clear to add command line to the run process in the IDE in this release.

Best regards,
Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Acqua Alta -

Hi Juan,
Thanks for the great plugin.

According to this document:
https://vpl.dis.ulpgc.es/index.php/home/news
Since VPL 3.3.1, the default evaluation program supports sending 'information to the student program (or “program to run”) as command line arguments'.

How can it be done?

Just to be sure that I understand the info correctly, what I want to achieve is the following:
I want to create a VPL activity in which the students would have to write a C program that would pass arguments to the main function by using argc and argv.

Thanks in advance smile

In reply to OEE_Dev KW_Univ

Re: New Virtual Programming Lab (VPL) module

by John Andrewartha -

Sound like the Welcome to Linux Java Nightmare.

By default all Linux distro's install Open Java.  It is still to immature to run most of the Real Java.   Install Sun Java and it should work.

In reply to Gulshan Kumar

Re: New Virtual Programming Lab (VPL) module

by Joel Gogwim -

Hello Carlos,

Please I am in the process of installing the jail server following the documentation but continuously received the following error message.

[root@cbtmain vpl_xmlrpc_jail-1.0]# ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for g++... no
checking for c++... no
checking for gpp... no
checking for aCC... no
checking for CC... no
checking for cxx... no
checking for cc++... no
checking for cl... no
checking for FCC... no
checking for KCC... no
checking for RCC... no
checking for xlC_r... no
checking for xlC... no
checking for C++ compiler default output file name... configure: error: C++ compiler cannot create executables
See `config.log' for more details.
[root@cbtmain vpl_xmlrpc_jail-1.0]#

I need a help.

In reply to Joel Gogwim

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Joel,
The demon vpl_xmlrpc_jail is written in C++. I think that ‘configure’ is saying that you don’t have a C++ compiler (like g++) installed and  need one to compile the demon.
Best regards.

In reply to Steve Towson

Finding the ID of VPL activity stored in DATABASE

by Prakash Raju -

Hi Juan,

I would want to know the activity ID of each VPL activity. But, the $id variable inside /mod/vpl/view.php doesn't provide with the right activity ID that is stored in the database.  

For example, the $id variable now states the activity ID to be 458 in my production server. But the maximum ID value is only 375 in VPL table



What would be the right approach to knowing the activity ID stored in the database for any specific VPL activity?


Thanks,

Praveen Kumar

In reply to Prakash Raju

Re: Finding the ID of VPL activity stored in DATABASE

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Praveen,
the parameter $id that may found in many places in the code are in most cases the $id of a CourseModule. Moodle uses the coursemodule table to save information for every activity and resource. This is the reason because you found $ID with larges values than the VPL ids.

If you want to get the ID of the VPL record you may use the object $vpl created with new mod_vpl( $id ).
and then
$vpl->get_instance()->id
you may found the var $vpl already created in the code.

Best regards.


In reply to Juan Carlos Rodríguez-del-Pino

Re: Finding the ID of VPL activity stored in DATABASE

by Prakash Raju -

Hi Juan,

Thank you so much. I found the issue and was actually using sub queries to get the VPL instance id. Your approach is much simpler.

One more help if you don't mind. I want the entire code student types from the VPL_IDE to be available in a JS variable, compare with specific keywords and if the keywords are not present in the program, prevent the program from submission for run or auto-evaluation. 

To get the string from VPL_IDE, I referred to ace documentation and came up with 

var editor = ace.edit("editor");

editor.getValue();


But, this approach didn't work. can you help me out with a better solution? Also, let me know how to stop the program from running or auto evaluating if string not found in the program


Thanks in advance,

Praveen Kumar

In reply to Prakash Raju

Re: Finding the ID of VPL activity stored in DATABASE

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
I think that you can get this behavior easier using "execution files" and the "based on" features of VPL.
Follow this steps (suppouse the target language is Java):
1) Create a VPL activity named "Base Java". This activity is not to be used for student, keep it always hidden.
2) Copy the default java run script from mod/vpl/jail/default_scripts into the vpl_run.sh at the "execution files" in "advance features". This activity is the base for new customized activities for Java.
3) Create the activity that you want to control (e.g. "Java1"). Use the "based on" option to derivate from the "Base Java" activity. At this moment this activity has the same behaivour than the default action when not customized activities detec Java files.
4) Customize the "Java1" activity adding code to the "vpl_run.sh" file. For example you want to avoid the exection and evaluation of the student code if the code contents "customize". Use this code:

#!/bin/bash
if [ -f vpl_execution ] ; then
     grep "customize" $SOURCE_FILES > /dev/null
     if [ "$?" == "0" ] ; then
          echo "message"
          rm vpl_execute
     fi
fi

Best regards,
Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Brandon Horn -
Are you able to provide (paid) installation of the VPL jail and configuration of the firewall?

Brandon
In reply to Brandon Horn

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Sorry Brandon, but I do not provide VPL instalations/configurations for money. What I can do is to resolve any question you have regarding the installation of VPL for free.

I can suggest you that a linux expert installs VPL following the instruction provided in the documentation.

Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Andrey Semenyuk -

Mr. Juan Carlos,

We tried the VPL JAIL system. Examples C and Java work fine but C++ examples not working .
Could you help us?
Below are the configuration files and log files.
Thank you/

In reply to Andrey Semenyuk

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Andrey,

I suppose that you are using a prebuilt “jail system” then please post the “vpl_run.sh” file of the C++ activity to have a complete picture.

A simple content of “vpl_run.sh” for C++ may look like this

---------begin of file--------------
#!/bin/sh
g++ -Wall -o vpl_execution *.cpp
----------end of file--------------

Best regards

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by adrin diggs -

Hi i am working on a VPL Moodle module, but I can not get C, C++, or Java to compile and execute. My "vpl_run.sh" looks like the one above for C++. And I was wondering am I to "Add file" vpl_execution, and then select it as one of the "files to keep when running". When I do this my /var/log/messages say vpl_execution: pemissions denied

help is needed: thankyou

In reply to adrin diggs

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

HI Adrin,
I need more information to help you about your problems with C, C++ and  Java.  About the message you get when you add “vpl_execution” file and not getting it  by compilation, you must notice then that the file take the format of a shell script  and you must add “#!/bin/sh” as the first line and you need to add “chmod +x vpl_execution” in your “vpl_run.sh” to set it as executable.
Best regards.

In reply to Andrey Semenyuk

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Andrey,
Your problem seems to be that you have set a too low memory size limit. You must increase the memory size limit to16MB or a higher value in order  to run g++ and compile a C++ program.
Best regards

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Дмитрий я -

Does VPL programming language FreePascal?

In reply to Дмитрий я

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

The applet editor and the module supports syntax highlighting for Pascal, I don’t know the differences with FreePascal. The virtual machine with preconfigured Jail-system that you can download at VPL home page don’t have the FreePascal compiler installed but you can install it:
At the virtual machine execute
wget ftp://ftp.freepascal.org/pub/fpc/dist/2.2.4/i386-linux/rpm/fpc-2.2.4-1.i386.rpm
rpm –i fpc-2.2.4-1.i386.rpm
The last FreePascal version (2.4.0) has a “dependence not resolved” problem in the VM with Centos 5.

Best regards

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Andrey Semenyuk -

Thanks for helping me configure the VPL. It works great now!

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by OEE_Dev KW_Univ -

Is it possible to run VPL with moodle 1.7 and moodle 1.8 release ??

If NO, How can I make it run with moodle 1.7 release or Moodle 1.8 ?

 

Please help,

 

Thanks

Omer.

In reply to OEE_Dev KW_Univ

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Omer,
Sorry, but we are not planning to release a VPL version compatible with Moodle 1.7 or 1.8. We are planning, in a near future, to release a VPL version for Moodle 2.0.

Best regards

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Oleg Sychev -
Picture of Core developers Picture of Plugin developers
Hi. We in Volgograd State Technical University are looking for a way to integrate automatic program testing with Moodle server (thought we are using individual tasks for each assignment) and it is good to see work in the same way. Is there a way in VPL to configure module instance (from user interface) to automatically link student's program with some teacher-supplied library(s)? Or choose compile/run script from a number of existing ones. It couldn't be done in one script since some assignments require one special library, some - another and some no at all. (Of course, it would be better if code for such library could be uploaded by web interface, but not strictly necessary).
In reply to Oleg Sychev

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Oleg,

The use of automatic program testing is one of the main target of VPL. The libraries can be used in two ways: as source code  files of a VPL's activity, (they must be added in the “execution files” configuration page , better in a VPL activity shared as “based on”), or as software installed in every jail-servers you use.

To use one assignment for different tasks you can use “Variations”.  The variations define sets of different requirements for an assignment.  Each student will be randomly assigned a variation. Each variation has an identification code and a description. The variation description is shown to the students with the assignment description. The identification code is reported in the vpl_enviroment.sh , so it can be used in the script files (vpl_execution.sh, vpl_evaluation.sh) to do different actions depending on it.

Another way to control different task for one assignment may be to write a complex script able to detect the type of assignment submitted by checking , by example,the file names submitted by the student.

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Osvaldo Carvalho -

Hi, Juan,

How tests are specified when variants are used?

Best regards,

Osvaldo

In reply to Osvaldo Carvalho

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

At this moment the variations are not covered by the default evaluation program.
We use it in specific assessment programs that allow different assigning to each student.
The assigned variation to each student is sent to the evaluation process as a environment variable. The variable is named as $VPL_VARIATION0 and its value is the variation id. This environment variable is set in the vpl_enviroment.sh file.
If the users of VPL want to use variations with the default evaluation program then  it could be incorporated into future versions of this program.
Best regards.
Juan Carlos Rodríguez

In reply to Juan Carlos Rodríguez-del-Pino

Virtual Programming Lab (VPL), version 1.3 released

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

The VPL development team announces the public release of VPL 1.3, the third stable version of VPL. This new release adds some improve and fixes errors.

  • Added a new type of activity "example" used to show programs running.
  • Files from "Requested files" and "Execution files" can be downloaded as a ZIP file.
  • It uses the new 1.0.3 ACodeEditor version that adds a workaround for a Java 6.0_22 error.
  • Added Ubuntu support for the jail system (scripts to install and service)
  • Fixed Jail system connectivity error that avoid interactive execution if the server is behind a NAT

This version is backward compatible with VPL versions 1.x < 1.3. The upgrade from older version adds a new field to the database. It is recommended to upgrade to this new version.

In reply to Juan Carlos Rodríguez-del-Pino

Re: Virtual Programming Lab (VPL), version 1.3 released

by Eamon Costello -

Congratulations Juan. Looks very interesting though I have not installed it to look properly yet.

A short video would be great to go with the screenshoots to give people a flavour. Any plans to add PHP?

- Eamon

In reply to Eamon Costello

Re: Virtual Programming Lab (VPL), version 1.3 released

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Thank Eamon,
if you have some question about the installation don't hesitate to ask me.
To make screencasts about the installation and configuration of VPL activities is in my TODO list.
The system can handle almost any programming language that use console iteration. The system don't  highlight the sintax of PHP but can edit and run PHP. After your question I have added a PHP generic activity to the demo site
http://demovpl.dis.ulpgc.es/moodle
We are planning, for a near future, to add sintax highlighting for a wide variety of programming languages.


The "vpl_run.sh" used at the PHP generic activity is
-------------------------
1 #!/bin/bash
2 echo  "#!/bin/bash" > vpl_execution
3 cat vpl_environment.sh >> vpl_execution
4 echo "php5 -n -f \$VPL_SUBFILE0" >> vpl_execution
5 chmod +x vpl_execution

-------------------------

Best regards
Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: Virtual Programming Lab (VPL), version 1.3 released

by udara weerakoon -

Dear Juan,

I have tried to install VPL 1.3 with moolde 1.9, but when I was running a C program in the activitiy (moodle), I got the message stating "not executed". I am using my test server (Ubuntu server 10) to run both moodle and jail servers. Here I'm attaching the log file. There are two question I am particular about.

1. what should I do with *.sh files, where should I create those?

2. What is the purpose of ACodeEditor? how can i use it?

 

I really appreciate your helping me.

 

Thank you.

In reply to udara weerakoon

Re: Virtual Programming Lab (VPL), version 1.3 released

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Udara,
I’ll try to respond to your questions but not in the order you ask them.
==========
Question 1)
what should I do with *.sh files, where should I create those?
Answer 1)
There are three types of execution you can set for an activity: “run”, “debug” and “evaluate”. The “run” and “debug” actions do an online execution in a console (the console is part of the applet editor). The “evaluate” action does an offline execution and its output is saved as part of the submission.
Each action (“run”, “debug” and “evaluate”) has its own script: vpl_run.sh, vpl_debug.sh and vpl_evalaute.sh.  The goal of these scripts is generate a file named “vpl_execution”. This file must be a binary executable or a script and if it exists, after running the action script, it will be run.
You may set your script files (vpl_run.sh, vpl_debug.sh and vpl_evalaute.sh) by “updating” your VPL activity and then selecting “execution”. You can't set scripts when you are creating a new VPL activity.
==========
Question 2)
I got the message stating "not executed"
Answer 2)
This message say that your script linked to the action you request do not generate a file “vpl_execution”.
==========
Question 3)
What is the purpose of ACodeEditor? how can i use it?
Answer 3)
Really, to run VPL you don’t need the source files of “ACodeEditor”, the applet code editor. The VPL module already has the “ACodeEditor” compiled.  The source files of “ACodeEditor” are at the download page of the VPL site because it is Open Source as the rest of VPL.
==========
The log file you attach says that your Jail server is running OK, so far, but at your post you say that you are trying to run a C program and the file you use was “hello.java”.
To populate the script files, you can use the content I have suggested in other messages of the forum.


Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: Virtual Programming Lab (VPL), version 1.3 released

by udara weerakoon -

Dear Juan,

I gotch you, Thank you so much.

I had to chop the log file due to the restricted file size of 100K. That is why the log file does not contain my hello.c program's execution logs.

Again, I really appreciate your helping me.

 

udara.

In reply to udara weerakoon

unable to get vpl working in moodle 2.0

by saurabh singh -

Hello juan,

I am intrested in working for development of vpl.But in order to even start that i need to get it working.My moodle installation is version 2.0,When i am trying to install the vpl plugin it's saying broken plugin....It appears that vpl is not supported by moodle 2.0?Can i get it working in version 2.0?

Secondly i am having problems in configuring the jail server in my ubuntu machine,the vpl-jail-system service runs fine,but the vpl-xmlrpc-jail isnt recognized by the shell.

(I know these questions are too dumb for a wanabe developer but i have tried everything)

In reply to saurabh singh

Re: unable to get vpl working in moodle 2.0

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Saurabh,

Sorry, but VPL 1.3 is NOT COMPATIBLE with Moodle 2.0. VPL 1.4 that is near to be released will neither be COMPATIBLE with Moodle 2.0 . After the release of VPL 1.4 we will start a 2.0 branch of VPL. We are planning to make a first 2.0 compatible release of VPL before the end of the year. If you are planning to develop new VPL features you must take this into account.

vpl-xmlrpc-jail is a deamon intended to be managed by xinetd.
Did you install xinetd?

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: unable to get vpl working in moodle 2.0

by saurabh singh -

Yes xinetd is installed and is working..i can see it in the ps output.....

In reply to saurabh singh

Re: unable to get vpl working in moodle 2.0

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Saurabh,

To help you installing a "Jail server" I need more information about “the vpl-xmlrpc-jail isnt recognized by the shell”.
To check your “Jail server” you can follow the steps I posted here on 17 September 2010.


Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: unable to get vpl working in moodle 2.0

by saurabh singh -

sudo service vpl-xmlrpc-jail start

unrecognized  service

In reply to saurabh singh

Re: unable to get vpl working in moodle 2.0

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

The message you get running “sudo service vpl-xmlrpc-jail start” is normal, vpl-xmlrpc-jail is a demon controlled by “xinetd”, you can’t use the command “service” to control vpl-xmlrpc-jail. The start/stop script of “vpl-jail-system” controls the activation/deactivation of “vpl-xmlrpc-jail”. If you want to control manually the “vpl-xmlrpc-jail” service you must edit “/etc/xinetd.d/“vpl-xmlrpc-jail”” and reload xinetd.

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: unable to get vpl working in moodle 2.0

by Marcello Missiroli -

Some MORE dumb questions:

1) vpl-xmlrpc-jail is intended to be run on the Moodle host, or on the jail (VM) system?

2) When I install on Virtualbox the jail system provided, it seems that no port is open, espcially port 52000. What am I missing here?

3) When I install the vpl module in moodle, a testing Jail system URL is provided. How do I test it?

Thank you for the good work!

In reply to Marcello Missiroli

Re: unable to get vpl working in moodle 2.0

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Marcello,
I'll try to answer to your questions:
Q1) vpl-xmlrpc-jail is intended to be run on the Moodle host, or on the jail (VM) system?
A1) vpl-xmlrpc-jail is the daemon that manages the requests of execution received from a VPL module on Moodle server. vpl-xmlrpc-jail must be run on a jail system.

Q2) When I install on Virtualbox the jail system provided, it seems that no port is open, espcially port 52000. What am I missing here?
A2) I don't know. The vpl-xmlrpc-jail daemon is manage by xinetd and xinetd will open the appropriate/configured port

Q3) When I install the vpl module in moodle, a testing Jail system URL is provided. How do I test it?
A3) You can check the basic conectivity with the demo jail at Advanced settings->Check jail servers
You also can add any VPL activity and check to run some code in Test activity->Edit

Best regards

In reply to Juan Carlos Rodríguez-del-Pino

Re: unable to get vpl working in moodle 2.0

by Marcello Missiroli -

I made progress, and I think I'm halfway through. Even like this the module it's very helpful, but I hope I can do more.

I installed the jail system in the VM, and at least sending the program works: I can see the output of the compiler on the rightmost window.

However, then the system hangs, and it reports that it cannot connect (I can see a dialogbox containing the printf output, so the program runs allright). So I suspect it's a firewall issue, but

a) I've already opened the ports on the main machine (this is the output)

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     tcp  --  anywhere             anywhere             tcp spts:51001:51500

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         
piffy@moodle:~/VirtualBox VMs$

b) I've already activated the port forwarding on Virtualbox, as stated on the site.

So, I don't really know what to do next.

NOTICE: If/whenever I'm through with this, I promise I'll write a step-by-step, idiot-proof setup guide both in English and my language. smile

 

In reply to Marcello Missiroli

Re: unable to get vpl working in moodle 2.0

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

If you can see the execution result in the error dialogbox, then you have a correct connection with the jail server. One question: are you running the browser in the same machine than the Moodle server? if the answer is yes then try acceding to your Moodle server from other machine.
Best regards

In reply to Juan Carlos Rodríguez-del-Pino

Evaluation time and error

by ashok bhansali -

Dear Juan,

Two ques :

1. My jail server was working fine but suddenly it's been become too slow.. by atleast 5 to 10 times. I've changed the jail server system with fresh installation but still same. What could be the probable reason and proposed solution ?

2. If i set the Memory to 32 or 64 MB in Maximum Execution resources limit then the same program some times work and sometimes goes out of Memory. I am unable to understand the reasons.. pls suggest what to do?

Regards




In reply to ashok bhansali

Re: Evaluation time and error

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Ashok,
Two answers:
1) I have not heard about similar problem. I need more details about the problem to answer your question. You can do this to spot the problem:
a) when the system go slow login at the jail server and           run top or ps to see what is loading the system.
b) You can obtain a detailed log of the service by starting it in debug mode with "service vpl-jail-system start -d 8". The logs will be written in "/var/log/syslog
2) The check of the memory used by a task is done each second. All task may runs a second using more memory than the allowed. If your task is stopped some times then your task uses more memory than the allowed but some times the system does not catch it.

Best regards.



In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by udara weerakoon -

Hi,

I have tried hard to create a successful vpl activity to run a java program, but I was not successful. Here, I’m attaching the code in vpl_run.sh file:

1 #!/bin/sh

2 #load VPL environment vars

3 . vpl_environment.sh

4 # reset LC_ALL

5 export LC_ALL-en_US.utf8

6 PATH=PATH:/usr/lib/jvm/java-1.5.0-gcj-4.4/bin

7 echo "The first file/class must have the Main method"

8 javac -J-Xmx64m *.java

9 NAME=(basename VPL_SUBFILE0 .java)

10 if [ -f NAME.class ] ; then

11   echo "#!/bin/sh" >> vpl_execution

12   echo "export LC_ALL=en_US.utf8" >> vpl_execution

13   echo "PATH=\$PATH:/usr/lib/jvm/java-1.5.0-gcj-4.4/bin" >> vpl_execution

14   echo "java -Xnx64m -enableassertions $NAME" >> vpl_execution

15   chmod +x vpl_execution

16 else

17   echo "Not compiled or error in filename"

18   echo "The main method must be in the first file"

19 fi

 

Additionally, I’m attaching “messages” file of vpl actitivites for your convenient.

I have installed the proxy server “squid” in the same machine, but I didn’t configure it properly. The document in the official vpl website states “To establish the link the proxy needs to be able to open two ports. The two ports are selected from the range set.” Please, let me know the correct configuration statements to do that.

In reply to udara weerakoon

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Udara,

The “vpl_run.sh” file that you use has some typewrite errors:

-       Line 5: change – for =

-       Line 6: the second PATH must be $PATH

-       Line 9: VPL_SUBFILE0 must be $VPL_SUBFILE0

-       Line 10: NAME must be $NAME

I recommend to use OpenJDK instead of GCJ.

I see, Inspecting the attached file, that you need to increase the maxmemory size value at least to 128Mb to run a java program.

You don't need to install any proxy server. The proxy of the documentation is an internal part of the VPL module.

Best regard.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Scott Tearle -

Hi Juan,

Why haven't you used the Sun( Oracle ) JDK?  It's free and available for Windows and Linux.  It's a world standard (they invented the dang thing).  There are also the points that the IBM jdk is mainly used for very fast computations in specific environments, and the openjdk is only being developed in case the sun jdk goes propriatery.

Scott

Scott

In reply to Scott Tearle

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Of course, you can also use the Oracle JDK, it is free but not open source. I do not think there are great differences from one version to another, but OpenJDK is a bit easier to install because it is distributed as part of some Linux like Ubuntu.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by udara weerakoon -

Dear Juan,

Thank you very much, I really appreciate your helping me

Udara.

In reply to Juan Carlos Rodríguez-del-Pino

Release of VPL 1.4

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

The VPL development team is proud to announce the public release of VPL 1.4, the fourth version of VPL. This version incorporates many new features, highlighting that now you don't need to set up a script to run or debug programs and that you can test students programs without any programming.

  • Has been added default scripts to run and debug programs written in the following programming languages: Ada, C, C++, C#, Fortran, Haskell, Java, Matlab/Octave, Pascal, Perl, PHP, Prolog, Ruby, Scheme, Shell script, SQL and VHDL.
  • Has been added an evaluation program. To evaluate an student program, it is enough to write a file of test cases.
  • Has been added syntax highlighting for Matlab and Python.
  • Has been added a option to check and report jail-servers availability.
  • The applet, by default, is now launched using the Java Network Launch Protocol.
  • The applet now show figures and play sounds for Matlab/Octave programs.
  • The jail installation script now can install many compilers and interpreters.
  • The vpl-jail-system now are also distributed as LiveCD, allowing easier testing or installing a jail system in a real or virtual machine.

This version is backward compatible with previous VPL versions.

You can test this new version at the demo site http://demovpl.dis.ulpgc.es/moodle/

In reply to Juan Carlos Rodríguez-del-Pino

Re: Release of VPL 1.4

by eka fitriah -

Dear Juan,

 

I want to ask you about VPL plugin. Because I want to try this plugin. If I want to install this plugin on Windows OS (Windows XP or 7), how I should do for the installation? I have try to install the VPL plugin but I do not know when I have to fill the Jail servers list. I do not find the jai system for Windows. I only find the jail system for linux. How I suppose to do? Thanks for your help.

 

Warmly,

Eka

 

 

In reply to Juan Carlos Rodríguez-del-Pino

Re: Release of VPL 1.4

by Jan Derriks -

What a great plugin VPL is. Students like the "evaluate" to get immediate results.

We got the jail working on Gentoo and some memory checks needed to be disabled but now this works we find we need more documentation on the scripts and on the "similarity" function. What do those 95/98/ 73/ numbers in red tell me about the similarity?

Is there more documentation or a wiki where we can help adding documentation?

We would like to add "fixed/readonly" files to a C/C++ assignment requested files. To add some functions students must call but not change. Is that possible without hacking scripts?

In reply to Jan Derriks

Re: Release of VPL 1.4

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Jan,
Yes, our students love to get an immediate evaluation from VPL activities too.
Your report is the first news about a VPL jail server on Gentoo.
I know that many VPL features need more documentation and your suggestion of using a wiki seems to be a good idea.
The three numbers that appear at the similarity function are the percentage of similarity found using three different metrics. Each metric is affected by different patterns of source code change. This information is used to order the pairs of files from most to less similar, but the teacher always has the last word.
You can get C/C++ activities; with a similar behavior to what you ask here; taking into account those:
1) You can add files to the "Execution files" group. These files will be compiled with the submitted files by the student. These files are never shown to students and they can't override them.
2) You can add the same files of "1)" to the "Requested files" group. These files will be shown to the students and must be submitted and the students can change its content, but at compilation time, these files will be replaced by the corresponding files in the "Execution files" group.
3) You can show code of “1)” in the full description of the activity.

Enjoy VPL
Best regards.
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: Release of VPL 1.4

by Jan Derriks -

Hi Juan,

Thanks for the tip to add files into the "execution files" AND "requested files" section.
It's not pretty but serves the purpose. Must not forget to keep both versions in sync.

I have another tip: if you want to test Java exercises where students write "public static void main(int args[])" in their Assignment.java code, it is possible to test this by adding a Tester.java file that calls Assignment.main(args) with args set from evaluation inputs. However, the default java_run.sh script may call the wrong main method.

So I changed the java_run.sh in moodle/mod/vpl/jail/default_scripts so that IF there is a Tester.java file present, that wil be called as main.

 

#Search main procedure class
for FILENAME in $VPL_SUBFILES
do
        grep "void[ \n\t]*main[ \n\t]*(" $FILENAME 2>&1 >/dev/null
        if [ "$?" -eq "0" -a "$MAINCLASS" = "" ]        ; then
                MAINCLASS=$(basename $FILENAME .java)
        fi
        ## jand: Tester is special case
        if [ "$FILENAME" = "Tester.java" ] ; then
                MAINCLASS="Tester"
                break
        fi

Maybe this helps others writing testcases using Tester files too.

Next problem we have is: is there a way to test the student's code for specific constraints like "must use 1 FOR loop" or "javadoc must be present" or "maximum of three variables may be used"?

Tnx for any hints.

In reply to Jan Derriks

Re: Release of VPL 1.4

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

The VPL activities can be easily configurable.
If you can’t change the file “moodle/mod/vpl/jail/default_scripts/java_run.sh” and you want to change how one activity select the main Java procedure (or another thing) then you may modify the execution file "run_vpl.sh". If you want to set the same run_vpl.sh file for many activities then you may add a new VPL activity (for this purpose) and set there the run_vpl.sh. To use this run_vpl.sh file, you must set this activity as “based on” (in execution options) in the other VPL activity where you need it.

The next issue that you referred to is a hard problem. If you find an easy solution for Java or other programming language, please let us know.

Best regards.
I have attached the last java_run.sh and java_debug.sh files we are using.

In reply to Juan Carlos Rodríguez-del-Pino

Similarity and Watermarking

by Jean Martina -

Juan,

First of all, sorry for resurrecting such an old thread, but I found no other discussion on similarity and watermarking in the VPL. We are writing some documentation regarding the most cryptic features on the VPL for our courses in here and I have been inspecting a lot the code for this on similarity and watermarking. When using similarity checking some things are straight forward, like selecting the files and interpreting the results side-by-side. Some other things are very complicated to understand.

From the source code I already grasped the meaning of ===, <<<, >>> and ###. I also understand how the clustering works, but I am having a lot of trouble to understand the "3 metrics". It is unclear how they work and why these are important. Can you briefly tell me?

I am also having trouble to grasp the watermarking feature. I got the idea of tabulations and hashing, but cant see the actual use of it. Can you give and example of how it works?

Regards,

Jean

In reply to Jean Martina

Re: Similarity and Watermarking

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Jean,
I will try to answer to your questions.
Q. The "3 metrics". It is unclear how they work and why these are important. Can you briefly tell me?
A. For inexpert end users it is not important. This information give some internal details of why the system selected this pair of files. You can see a brief explanation of the features of every metric in the figure attached.
Q. what are the watermarks?
A. This is other feature that is used to try to detect plagiarism. This feature adds a watermark to the downloaded submissions. If the submission is modified slightly and is submitted by other user, the system will detect it. With your question I have reviewed the code and currently this feature is deactivated. I will reactivate or remove this feature in the next release.
Best regards.

Juan Carlos


Attachment Captura.JPG
In reply to Juan Carlos Rodríguez-del-Pino

Re: Similarity and Watermarking

by Jean Martina -

OK Juan,


As I said I am writing documentation for some colleagues here to use VPL. What do you think about the text bellow? Does it make sense?

-------

Similarity checking in the VPL environment works by doing a syntactical analysis of the code handed in by the student followed by clusterization and metrics extraction on file-by-file comparison. It starts with a tokenization followed by a language-bound syntax normalization on each file within the handed in work. With that  the comments and name identifiers are left behind.

After that, files are compared in pairs using a clustering algorithm. This clustering algorithm will match syntactically similar work, which them will be compared upon some metrics.

In VPL we have three different metrics, which can be understood from the Figure bellow \ref{fig:metrics}

\begin{figure}[htpb] 

\begin{center} 

\includegraphics[width=\textwidth]{metrics.jpg} 

\caption{Description of Similarity Detection Metrics - Picture from The VPL Forum at Moodle} 

\label{fig:metrics} 

\end{center} 

\end{figure} 

All the metrics will filter out comment and the name of identifiers. Metrics one and two will not be affected by code reorder, while metrics 2 and 3 are affected by size and number of systematic changes, metric one is just slightly affected. Metric one is affected by the complex changes in the expression, while metrics two and three and only affected by the size and number of changes.

In practice the there different metrics will help you to assess how similar two handed in files are even if code was re-ordered (Metric 1), and if there are changes in this code what's the size of these changes (Metric 2), and the number of overall changes  in the two compares files (Metric 3). 

-----

As I said similarity checking is one of the most cryptic part of the VPL environment. To convince people around here I will have to explain some of that. Posting on the forum will also help other to follow and keep it for the posterity.


Regards,


Jean

In reply to Jean Martina

Re: Similarity and Watermarking

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Your text explain partially the way that VPL search similarity.
The similarity search among source code may be a complex issue and this technologies must be used as aids to detect this cases, but all the users must be aware that the real judge must always be a teacher (better two or more).

Best regards.
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: Similarity and Watermarking

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

An important difference of the similarity search in VPL and other systems is that VPL never sends code or other information to external servers. All the process is local. You can add to the search other activities or archives in a ZIP file, but nothing more.

Best regards
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: Similarity and Watermarking

by deepa ganu -

HI Jaun, 

What is the meaning of  ===, <<<, >>> and ###  while showing similarity also need to know what does (*) means 100|100|78** when listing the files

In reply to Juan Carlos Rodríguez-del-Pino

Re: Release of VPL 1.4

by Jose Antonio Ortiz Ramirez -

Hello!!!

VPL 1.4 is compatible with MOODLE 2.x?

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Gaurav Parashar -

Dear Juan,

First of all thanks to build such a marvelous product, which solved so many issues of mine. 

There is an issue which i am not able to solve. The comment after pressing "Evaluate" button is

"virtual memory exhausted:Cannot allocate memory Error compiling evaluation program"

Thanks in advance.

Attachment Screenshot.png
In reply to Gaurav Parashar

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Gaurav,

it seems that you have set a so low memory limit that de C++  compiler (the evaluation program is written in C++) can’t run properly.
Try increasing the memory limit to at least 64Mb. Beware that you can set the memory limit value in two places (at each VPL instance and at the general setting of VPL module) and the lower one will be used.

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: Variations based on Moodle data

by Jan Derriks -

Hi Juan,

to prevent fraude to stimulate student's creativity I'd like to make assignments that use personal data to work on.

Like: write a program that reads file <your surname>.txt and replaces every <your phone number % 11>'th line with the text "censored by <your First Name>"

Where the <words> are from the Moodle user's profile.

Is that possible?

In reply to Jan Derriks

Re: Variations based on Moodle data

by Nick Papagiorgio -

Hello,

I'm trying to get moodle to run with VPL, but I still have some problems. Here's my setup: moodle_latest-19, VPL module 1.4.1, VPL jail system 1.2. I followed the tutorial " How to install a VPL jail system in Ubuntu" to set up the jail system. I also tried the live CD, but if anything, this made things worse.

I can telnet into the jail server and it says "ready" in the "check jails" tab under "execution". So far so good..

I've set up some small "hello world" test assignments, namely for C++ and Java. I intend to use it solely with Java later, but this is just for the sake of testing. I inserted "output = Hello world" to vpl_evaluate.cases in all assignments and left the other files blank/empty. Now to the problems:

  • I can successfully evaluate a C++ submission. It says "1 tests run/ 0 tests failed" (the test fails, when I change/corrupt the submission, so evaluation really seems to work). When I try to evaluate a Java submission I get:
Compilation
mmap failed for CEN and END part of zip file
Error occurred during initialization of VM
java/lang/ClassNotFoundException: error in opening JAR file
/usr/lib/jvm/java-6-openjdk/jre/lib/rt.jar
Not compiled
Comments
The compilation or preparation of execution has failed
  • I cannot simply "run" a submission, neither in C++ nor in Java. It just says "running" and then (after 30secs) "running (Timeout)".

I have no idea what's going on here, any help is greatly appreciated.

regards

papagiorgio

In reply to Nick Papagiorgio

Re: Variations based on Moodle data

by Jan Derriks -

 

I guess the Jail system's JDK is not OK. One nice way to test it:

1. do a DEBUG of a C/C++ session, then type SHELL in the GDB prompt and try the java -version command or javac to see if java / javac works.
2. As root, do chroot <jail folder> and test the java and javac there.

The shell command in GDB is a pretty sneaky way of getting shell access to the jail system for the time it is allowed. Fortunately it can do little harm.

In reply to Jan Derriks

Re: Variations based on Moodle data

by Nick Papagiorgio -

Thank you for the tips...it wasn't the jail system's JDK, it was an issue with the moodle server's firewall (which I apparently couldn't configure right). I set up a new moodle on a fresh Ubuntu in a virtual box and it worked with the (unaltered) jail-server right away.

I couldn't get shell access from the debugging, but at least I don't need it any more (for now) smile

In reply to Juan Carlos Rodríguez-del-Pino

Release of VPL 2.0

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

The VPL development team announce the public release of VPL 2.0. This new version is compatible with Moodle 2, incorporates new features and fixes some minors errors of VPL 1.4.

The new features are:

  • Has been added group work. Every group has a shared repository of submissions; any group member can submit a new version and all members of a group will get the same evaluation. At this moment, this feature works only with groupings.
  • It is possible to run a batch evaluation of submissions (at "submissions list")
  • At global module setting has been added options to set default resource limits. When an activity don't set a resource limit the default value will be used
  • Backup and restore in Moodle 2.
  • Restore of Moodle 1.9 backups but user's information will be lost. Moodle 2.2 seems that don't restore user's information from Moodle 1.9.
  • Upgrade from Moodle 1.9 keeping all user information.
  • Report some statistics of submissions of students (at "submissions list")
  • The index of VPL activities now shows the number of submissions and submissions no evaluated.
  • Translations to Catalan and Japanese, thanks to Antonio Piedras Morente and Imaizumi Takashi, respectively

http://vpl.dis.ulpgc.es

In reply to Juan Carlos Rodríguez-del-Pino

Re: Release of VPL 2.0 - segmantation fault error

by Jan Derriks -

 

After the installation of a new Gentoo linux with latest g++ compiler we found a serious bug in vpl_evaluate.cpp:

        static Evaluation* getSinglenton() {
                if (singlenton == NULL) {
                        singlenton = new Evaluation();
                }
        }

This function should return the singlenton variable. The patch for mod/jail/default_scripts/vpl_evaluate.cpp is:

750d749
<               return singlenton;
941c940
<                       printf("Testing %d/%ld : %s\n",i+1,testCases.size(),testCases[i].getCaseDescription().c_str());
---
>                       printf("Testing %d/%d : %s\n",i+1,testCases.size(),testCases[i].getCaseDescription().c_str());

The printf fix prevents a warning about the %d that should be %ld.

In reply to Juan Carlos Rodríguez-del-Pino

Re: Release of VPL 2.0

by Rangga Wiratno -

Does this version of VPL works for Moodle 2.3?

Is there a documentation or a manual on how to use VPL like how to set up the cases and others?

Thanks before

In reply to Rangga Wiratno

Re: Release of VPL 2.0

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

VPL seems to work correctly in Moodle 2.3, but our production server is 2.2 and we haven’t made an intense test of VPL in Moodle 2.3.
All the documentation we have are the module help pages and the docs at vpl.dis.ulpg.es.

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: Release of VPL 2.0

by Rangga Wiratno -

Yes, we are trying it in 2.3 and so far there are no problem, if a problem does occur I'll keep you informed.

I see, I'll try looking more into it and checking the Demos.

Thank you

In reply to Juan Carlos Rodríguez-del-Pino

Re: Release of VPL 2.0

by Finton Paul -

Hi Juan Carlos

I've managed to install the vpl module for moodle but don't know what next to do. As a matter of fact, my moodle site is hosted on a shared server (hosted by hostek.com) and I am not the administrator of that server.  Any help will be appreciated as it relates to what i can do to complete the jail system installation (if this is necessary).

In reply to Finton Paul

Re: Release of VPL 2.0

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Paul

Yes, you need a jail system configured and running. I don’t know your server limitations, but before installing a jail system you can test if your server can use the demojail correctly.

1)    Add a new VPL activity

2)    Go to “Test activity”

3)    Go to “Edit”

4)    Add a file, for example “hello.c”

5)    Add C code to the file.

6)    “Save” the submission

7)    Push “Run” button.

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: Release of VPL 2.0

by Finton Paul -

Hi Juan Carlos

I've done as instructed but I'm receiving the error message as depicted in the attachment.

No Jail Serve Available

Is this what should happen?

If yes, then my admin can create a Jailed server for my use.

If this shouldn't happen, then do you have any ideas/possible reasons why I am receiving this message?

Thanks for assistance with this matter.

In reply to Finton Paul

Re: Release of VPL 2.0

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

It seems that your server can’t connect with the demojail and commonly this is a firewall issue.
Due to security reasons, it is highly recommended that the jail server be installed in a dedicated machine.
The demojail server is at port 52000, not 5200. the second server that appears in your screenshot is incorrect.
Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: Release of VPL 2.0

by Adolfo Rodriguez -

Hello, I am testing VPL 2.0 and I have a problem with automatic evaluation. Testing a Hello World in Java, I have created the file vpl_evaluate .cases with two lines:

case=test1
output="Hello World"

When the automatic evaluation run the test fail with this result

Incorrect program result 
--- Input --- 

--- Program output --- 

stty: standard input: Invalid argument
Hello World


--- Expected output --- 

Hello World

The problem is the line with the error of stty. Is this a problem with my jail system? I have installed the jail system with the liveCD in a VirtualBox  machine. 

Thank you for your excellent work.

 

In reply to Juan Carlos Rodríguez-del-Pino

Re: Release of VPL 2.0

by Julio Caiza -

Hello Juan,

I would like to know how I could integrate tools like checkstyle and JUnit to make an evaluation more complete? and which are the archives to modify?

Thanks in advance.

In reply to Julio Caiza

Re: Release of VPL 2.0

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Julio,

The steps to customize the evaluation are:

1) Install the tools you want to use at the jail servers.

2) To use the tools, write a shell script that evaluates the student’s submission, editing the vpl_evaluate.sh at “advanced settings ► execution files”. This script must generate a file named vpl_execution. This file must be a binary executable or a script.

3) The output of vpl_execution execution is processed to extract, if possible, comments and a proposed grade for the assessment

See “advanced settings ► execution files” help for more details.

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: Release of VPL 2.0

by Michael Lang -

¡Hola!

We're currently trying to install VPL for a university project.
The setup is as follows:
- Moodle Server: openSUSE 11.4 + Moodle 2.3 + VPL 2.0.2
- Jail Server: Ubuntu 12.04 + Jail system 1.2

Both machines run as VMs, have access to the internet and are accessible from the university intranet only. At the moment we've got two points that we seem to be unable to resolve:

1) Run / Debug
When I put in a HelloWorld-application in C or Python evaluation works as expected. The code is executed and graded according to the evaluation cases configured.
Hitting the "Run" or "Debug" button, however, results in a timeout. No console window is shown either.
When I try the demo course (http://demovpl.dis.ulpgc.es/moodle/) it works fine - so it's probably not an issue with the browser or Java plugin.

The moodle Server is running the susefirewall2 and I've configured it to allow access to TCP and UDP ports 22, 80 and 51001-51500.
I've tried both the default run-files and custom ones with the same result.
The firewall-log messages don't show any allowed or rejected connections to ports 51001 to 51500 - only ports 22 and 80.
The Jail-Server isn't running any firewall - although I've tried activating one to log the incoming and outgoing messages.

Have you got any further suggestions based on what differences there are between run/debug and evaluate?

2) Java
Unlike the other programming languages, Java code cannot even be evaluated.
When evaluating, the JVM cannot start up due to the following message:

execution.txt:
Comment :=>>-The compilation or preparation of execution has failed
<|--
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
Not compiled
--|>
Grade :=>>0.00000

The settings that I've figured out which influence this are as follows:
Moodle -> Settings -> VPL Administration -> Advanced settings -> Maximum execution resource limits -> Maximum memory used: 256 MiB
Moodle -> Site administration -> Plugins -> Activity modules -> Virtual programming lab -> Maximum memory used: 512 MiB
Moodle -> Site administration -> Plugins -> Activity modules -> Virtual programming lab -> Maximum default memory used: 256 MiB
vpl_run.sh: javac -Xmx16m; java -Xmx16m
Memory free: 1,5GiB

I've tried changing these values and also adding -Xms Parameters - but with no different result.
I've also tried switching from the standard OpenJDK to the Oracle JDK 7 - didn't change anything either.
Running exaclty the same javac-command locally on the machine works without any problems. The only way to reproduce the error-message on the commandline was to add a -Xms larger than 4GiB (Server has only 2GiB RAM).
Do you know of any further settings that may be associated with this error or possible complications with the current (default) values?

Saludos,
  Michael

In reply to Michael Lang

Re: Release of VPL 2.0

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hola Michael, Thank you for a so detailed report. It’s seems that you have a Moodle-server firewall configuration problem. Try stopping your server firewall. VPL don´t use UDP protocol, you don’t need to configure UDP ports for VPL. To spot this problem It would be better to let me access as student to your server. Java need a big amount of resources to compile or run a program, you need to set memory limit at least to 256MiB and number of processes limit at least to 20. Best regards.
In reply to Juan Carlos Rodríguez-del-Pino

Re: Release of VPL 2.0

by Michael Lang -

Hi,

after some further progress, we just want to communicate back some of our findings and solutions to the problems addressed above.

Running/Debugging the submissions seems to indeed have been a firewall / network problem. We've been provided the VMs by our university IT department and they had misconfigured the VLAN settings.

The Java-Problem was being caused by the 64-bit version of Java. Because we're using Ubuntu 12.04 64-bit as Jail-Server, aptitude automatically installed the 64-bit version of oracle-jdk / openjdk. Once we switched to 32-bit openjdk the memory problems stopped.

Hopefully this helps others with the same problems in the future.

Best wishes,

Michael

In reply to Juan Carlos Rodríguez-del-Pino

Re: Release of VPL 2.0

by Julio Caiza -
Hello again Juan, I had though about upload to VPL a .zip file with some Java source files, then to modify the vpl_evaluate.sh script to grade in a particular way. The problem is about upload and send the zip file to the jail. I just made some tests and I think that the file is arriving corrupted to the jail. It is because the original zip file size is 9 KB, I see in the user directory in the jail and the file arrives with 6 B. Could you suggest me something? considering that I can't make a preprocessing in the Moodle server before send the files to the jail or would it be the only solution? Thanks in advance, Julio
In reply to Julio Caiza

Re: Release of VPL 2.0

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Julio,
At this moment VPL can’t handle binary files. This feature is in the VPL TODO list. There is a workaround for this problem: you can code the content of a binary file to (for example)  base64 and decode the file content in the server. The problem here is that you need to change the default script to decode the file. In the next VPL release, the decode process will be added in the default script and all the files with b64 extension will be decoded to a binary file with the same name but with the b64 extension removed.
I hope that this help.
Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: Release of VPL 2.0

by Julio Caiza -

Thanks Juan Carlos,

It was helpful.

 

Regards

Julio

In reply to Juan Carlos Rodríguez-del-Pino

VPL output console terminal

by Jan Derriks -

Hi Juan and all,

In a paper about VPL I read that there are plans to change the Java Applet into a Html5 window. Is this already work in progress? I have a few questions about the java ouput terminal:

1. is there a way to get the output of a program in a file or copy it to clipboard?

2. can I do cursor control in the output window? I want to simulate a lcd screen or a maze. VT100 control characters do not work.

PS: the paper is nice! I found it at

http://elrond.informatik.tu-freiberg.de/papers/WorldComp2012/EEE3753.pdf

 

 

In reply to Jan Derriks

Re: VPL output console terminal

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Jan and all,

The plan to replace the editor based on Java Applet by one based on HTML5 + JavaScript, remains, especially with the security problems arising from the Java Applet in last and current year. Although we have made some progress in this development, we have not achieved a full functional version and does not seem to be near.

I will try to answer your questions about java output terminal.
A 1. At this moment, you cannot save the program output to a file which is stored in the Moodle server. To get something similar, you must write, in the configuration file "vpl_evaluate.sh", the following:
----------------------------
#/bin/sh
. vpl_run.sh
----------------------------
this will make that when you push "evaluate" the program output will be saved as the result of the automatic evaluation.
I add to the list of tasks to be done: to allow copy text from the terminal to the clipboard

A 2. Sorry, but the output terminal is almost a dumb terminal and it does not emulate terminals as "VT100". This feature has been for a long time in the TODO list and still is there.  sad

Best regards.

 

In reply to Juan Carlos Rodríguez-del-Pino

Re: VPL output console terminal

by Jan Derriks -

Hi Juan

By copying data to /tmp/vpl_output and a symlink from the webserver to /var/jail/tmp/vpl_output we managed to get output to the client PC via a webserver on the machine that runs the jail. A bit clumsy but it works.

 

In reply to Jan Derriks

Re: VPL output console terminal

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Thanks for sharing your workaround, I think that if this solution resolve your problem then it is good. But be careful, I guess that you have noticed that your solution don't take into account that two or more user can run concurrently programs.
Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Moodle debugging VPL Errors

by Jan Derriks -

We upgraded to 2.3.4+ and in debugging mode, moodle complains about VPL:

The module vpl does not define the standard capability mod/vpl:addinstance

    line 3455 of /course/lib.php: call to debugging()
    line 1936 of /course/lib.php: call to course_allowed_module()

Is there a quick way to define the addinstance capability in mod/vpl/db/access.php ?

 

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Mark Howson -

Using VPL to run Linux labs?
I notice you use Cent OS to run you server and then us Virtual Box to set up VMs. After looking over you demo and pages I am wondering if you see it as possible to run labs training Linux level skills at the OS level?

I ask because I am currently trying to decide if the VPL module can be leveraged through adding additional features or if this type of lab support will have to be done from scratch.

In reply to Mark Howson

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Mark,

we now prefere running the jail servers on Ubuntu because installing interpreters and compilers for many programming languages is easy. We recommend installing the jail servers on a virtual machine but the use of VirtualBox is only an example. We think that VirtualBox is suitable for testing, for small installations or to reuse old hardware (without other virtualization capabilities).

If your labs require developing and testing drivers or recompiling the kernel then VPL is inadequate, but if you only need low level programming or shell scripting that don’t require root access, VPL may be useful out of the box. The full and correct answer to your question may be get by running your code at the demo site. If you don't get the expected answer, please, ask again attaching the offending code.

Best regards

 

 

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Aivar Annamaa -

Hi!

I'm trying to get VPL 2.0.2 working in CentOS 6.4. For testing purposes I have both Moodle and jail at the same (virtual) machine.

I had partial success -- could execute a Python script via VPL editor and saw the output. Then I messed around with my virtual machine (changed networking to bridged and then back to NAT). Now the situation is that jail server seems to be working (I can see localhost:52000 respond in my browser and I can telnet to it) but when I press the "Run" button in VPL editor or click the "Evaluate" link in "Grade" view, I get following error:

No Jail Server Available
localhost:52000 request failed: Failed to connect to ::1: Permission denied

(First time when I click the "Run" button the error message appears twice)

Can you recommend something to do about it?

best regards,Aivar

In reply to Aivar Annamaa

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Aivar,
I haven't checked a jail server in CentOS 6.4. You can use "Settings => Advanced Settings => Check Jail servers" as first test. Note that you must use a browser in a different machine to access the server and use the interactive console, If not, you get an "Permission denied" error in the console.
In any case check your server firewall. start removing the firewall adding it again when all are correct.

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Selecting correct execution script

by Aivar Annamaa -

Another question from me today:

Is it possible to specify (in assignment definition) which jail script should handle the submission?

Currently I've got the impression that jail server makes this decision according to file extension.

I would use VPL for evaluating Python 3 scripts. Sure, I can edit relevant script so that python3 interpreter is invoked for *.py files, but does it mean that I can't support Python2 and Python3 at the same time? (Most likely I don't even need them both. I just want to learn more about VPL).

In reply to Aivar Annamaa

Re: Selecting correct execution script

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Aivar,
The problem you describe is known. The workaround for an activity is to set a script to run, debug or evaluate. The script will be used instead of the default one. You also can use the "based on" feature to simplify the configuration of many activities.

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: Selecting correct execution script

by Aivar Annamaa -

Great tip, thanks Juan Carlos!

I'm interested only in evaluation, so I tried to create a custom vpl_evaluate.sh script in Python (attached). Although I used correct shebang line, the system still tried to execute it as a bash script. Is it a bug or feature?

Anyway, I got around this by adding my testing script as separate file and executed it via vpl_evaluate.sh. But I still have trouble getting the evaluation output right. According to VPL inline help, it should interpret text following "Grade :=>>" as proposed grade. But when I'm evaluating, I see all the output from my script as simple text in a box titled "Compilation". Have I misunderstood something?

I also noticed a confusing thing (bug?):1) Initially I misunderstood the difference between "execution files" and "requested files". I added my tester script via requested files and as a student I uploaded only the solution file. The system gave me confusing error message about "incorrect file name". Actually the first file was left empty (I assumed it will be filled by predefined file content), but second file had correct name.

I'm starting to like VPL more and more! (But the road to the enlightenment has been quite rocky smile )

Aivar.

PS. Initially I thought that vpl_run.sh is used when student presses "Run" button and vpl_evaluate.sh is used when student presses "Evaluate" button. Looks like it's not so simple though. Later I noticed that documentation actually explains this, but maybe it's worth pointing this out more directly.

In reply to Aivar Annamaa

Re: Selecting correct execution script

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Aivar,
I will try to answer all your questions.
-- Answer to Q1
This is the two things at the same time smile:
feature: add bash to resolve de problem of people that write scripts without shebang
bug: don't check for people like you, that want to use other script language (no bash).
In the next version of VPL this problem will be resolved

-- Answer to Q2
Yes, the "misunderstanding" is this: vpl_run.sh, vpl_debug.sh and vpl_evaluate.sh are script to prepare the execution stage. The result of running one of this script should be a vpl_execution file (script o binary).
You can use a vpl_evaluate.sh like this:
#!/bin/bash
cat >> vpl_execution <<'SCRIPT_END'
write here your phyton script file
SCRIPT_END
chmod  x vpl_execution

-- Answer to Q3 (comment)
"requested files" are the list of file the student must submit. But the teacher can set a initial content to this files, but the student must submit the files.
"execution files" are the scripts and files that will be send, with the student's files, to in the jail server.  If you don't check it in "Files to keep when running", all "execution files" will be removed before run vpl_execution.

The student must submit all the "requested files" and in the proper order (future release of VPL might improve this).
The files that can be optional are ("Submission restrictions|Maximum number of files" - "number of requested files")

-- Comment to PS
Your initial thought was the correct, but these scripts must generate vpl_execution.

Best regards
Juan Carlos

In reply to Aivar Annamaa

Testing my VPL installation

by Joel Gogwim -

Please I am a first timer in installing VPL; I have successfully installed vpl-jail-system version 2.0

I have configure the /etc/vpl/vpl-jail-system.conf file and vpl-jail-system started well but whenever I tried to check the availability of my execution server using the URLs http://172.16.15.13:80/OK and https://172.16.15.13:443/OK where 172.16.15.13 is the IP Address of the server and is the same thing added in my URLPATH=/ inside the config file mentioned above, it does not reurn OK in my browser instead it give and error message "The connection to the server was reset while the page was loading."

 

Please help me out.

 

 

In reply to Joel Gogwim

Re: Testing my VPL installation

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Joel,
The issue you describe seems to be due to a network problem. The IP of your server (172.16.15.13) is a private address which makes it not accessible from the internet, is only accessible from the same private network. If you plan to use VPL from outside this network, be aware that this IP is unreachable from the browsers and VPL 3.0 requires that the browser connect directly to the execution server.
To check if your execution server is running try this command from your execution server console
wget http://172.16.15.13/OK
or
wget http://127.0.0.1/OK
if all is correct, you must receive a 200 OK response

Best regards

In reply to Juan Carlos Rodríguez-del-Pino

Re: Testing my VPL installation

by Joel Gogwim -

Dear Jaun and Team,

I am just a beginner on VPL; I did installed it and have problem with the version of the jail server and that VPL so I now do a fresh installation on my MAC system because I was having problem with upgrading my Moodle to a version that could support VPL3.1. On the MAC I installed MAMP which comes with Moodle 2.7, Apache, PHP, MySQL, etc in one.

I successfully installed and configure VPL3.1 on my MAMP server but when I tried to test a Java program I received an error message saying 'PHP XMLRPC required' see below is a screenshot of the error, especially click on Run, Debug, Evaluate etc.


Please help me.


Attachment Screen Shot 2014-10-15 at 3.41.43 PM.png
In reply to Joel Gogwim

Re: Testing my VPL installation

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Joel Gogwim,
The XMLRPC PHP extension is an optional part of PHP that provide functions to VPL so that it can communicate with the jail server. The plugin VPL required this extension from its first version.
I have never use MAMP but I have downloaded it (from www.mamp.info) and it seem that do not provide xmlrpc.so. I have been looking for Moodle for mac in moodle.org and I have found Moodel4Mac and MAMP that come with xmlrpc.
Download it from
https://download.moodle.org/macosx/
Note: I haven't test it (I haven't a Mac). I only download the package and check that the xmlrpc.so is there and that the php.ini activates this extension

Best regards,
Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: Testing my VPL installation

by Joel Gogwim -

Hello Juan,

I appreciate your prompt response. I will explore it and give you feedback.


Thank you,

Joel

In reply to Juan Carlos Rodríguez-del-Pino

Re: Testing my VPL installation

by Joel Gogwim -

Hello Juan,

Compliments of the season!

Please I am still struggling with my VPL installation. I am able to overcome the XMLRPC PHP extension problem (by reinstalling the version of MAMP  you recommended). Currently my VPL installation is fine, jail server is also running but when I test a program I received the following error message: " No execution server available: 172.16.15.13 request failed: couldn't connect to host at 172.16.15.13:443 172.16.15.13 request failed: Empty reply from server".

The 172.16.15.13 is my jail server IP address; and the vpl / moodle server IP is 172.16.15.2

My /etc/vpl/vpl-jail-system-.conf file configuration is as follow:

#JAILPATH set the jail path
JAILPATH=/jail

#MIN_PRISONER_UGID set start first user id for prisoners
MIN_PRISONER_UGID=10000

#MIN_PRISONER_UGID set the last user id for prisoners
MAX_PRISONER_UGID=20000

#MAXTIME set the maximum time for a request in seconds
MAXTIME=600

#Maximum file size in bytes
#MAXFILESIZE=64000000

#Maximum memory size in bytes
#MAXMEMORY=2000000

#Maximum number of process
#MAXPROCESSES=500

#Path to control directory. the system save here information of request in progress
#CONTROLPATH="/var/vpl-jail-

system"

#Limit the servers from we accept request
#IP or net (type A, B and C) separate with espaces
#Format IP: full dot notation. Example: 128.122.11.22
#Format net: dot notation ending with dot. Example: 10.1.
#TASK_ONLY_FROM=10.10.3.

#To serve only to one interface of your system
#INTERFACE=128.1.1.1

#Socket port number to listen for connections (http: and wssmile
#default 80
PORT=80

#Socket port number to listen for secure connections (https: and wsssmile
#default 443
SECURE_PORT=443

#URL path for task request
#act as a password, if no matches with the path of the request then it's rejected
URLPATH=moodlevpl

While the VPL configuration for the jail server on my Moodle is (i.e. Execution servers list):

http://172.16.15.13:80/moodlevpl
http://172.16.15.13:443/moodlevpl

Please kindly help me.

In reply to Joel Gogwim

Re: Testing my VPL installation

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Joel,
I will try to help you. I have some comments about your configuration:

  1. You must change your URLPATH to URLPATH=/moodlevpl
  2. You don't need to add twice your execution server to the plugin configuration. This URL is used to connect the Moodle server with your execution server. If you use the secure port you must use https. I think that you must remove http://...:443 or use only https://.../moodlevpl
  3. About the IP you are using, you must be aware of my post https://moodle.org/mod/forum/discuss.php?d=154988#p1119372 and the limitations of using of the execution server in a private network
  4. If you wish, you can upgrade your VPL execution(jail) server to the 2.1 version


Best regards


In reply to Juan Carlos Rodríguez-del-Pino

Re: Testing my VPL installation

by Joel Gogwim -

Hello Juan,

I appreciates your help.

I have changed my URLPATH to URLPATH=/moodlevpl and leave only http://172.16.15.13:80/moodlevpl on my execution server setting.

The private IPs i.e. 172.16.15.13 and 172.16.15.2 I am using now are just for a test on the intranet, when it works, I will change all the IPs to public ones for Internet access.

After these changes, I run the program again and this time I got the following error message:

" No execution server available: 172.16.15.13 request failed: Empty reply from server"

Please do I missed something out again?



In reply to Joel Gogwim

Re: Testing my VPL installation

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Joel,
You can restart you execution (jail) server with a highest logging level. Run at command line
sudo service vpl-jail-system start -d 8

I recommend that you upgrade your execution server to the 2.1 version (this version improves the logging system)
You can see the execution details at /var/log/syslog

Best regards

In reply to Juan Carlos Rodríguez-del-Pino

Re: Testing my VPL installation

by Joel Gogwim -

Hello Juan,

I have tried the sudo service vpl-jail-system start -d 8 option but I still received the same error message. I will upgrade my jail server (execution) to 2.1 as recommended. And will keep you posted.


Thank you,

Joel.

In reply to Joel Gogwim

Re: Testing my VPL installation

by Joel Gogwim -

Hello Juan,

I have upgraded my jail server to 2.1.0 but the daemon refuses to start; so I then created a virtual box installed Ubuntu and later installed the jail server but still the daemon could not start. I continue to receive the following error message whenever I run the command 'sudo service vpl-jail-system start'

/sbin/start-stop-daemon: unable t ostat /etc/vpl/vpl-jail-server (No such file or directory)

*Daemon not started

Kindly help me out.


Regards,

Joel.

In reply to Joel Gogwim

Re: Testing my VPL installation

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Joel,
It seems that the problem is that the daemon is not where the service script expects.
You can rerun the command [sudo ./install-vpl-sh] and reinstall the daemon. You don't need to reinstall a fresh OS, it is secure running the installation repeatedly.

Please, send me the error messages you get and the installation log file [./installation.log]

Best regards
Juan Carlos

P.D.: Replace [ ] by quotes

In reply to Juan Carlos Rodríguez-del-Pino

Re: Testing my VPL installation

by Joel Gogwim -

Hi Juan,

I appreciate your patient with me. I just resumed from leave; and I am able to get my daemon running with 2.1.0 version. My problem know is how I can set the  VPL configuration for the jail server on my Moodle since my jail server is on virtualbox (i.e. the virtualbox is on the system running my moodle) with IP address of 10.0.2.15. I checked the online documentation for this but did not see something that could guide me. 

I felt almost there, please kindly help me again.

Thanks,

Joel Gogwim.


In reply to Joel Gogwim

Re: Testing my VPL installation

by Joel Gogwim -

Hi Juan,

I also see FIREWALL components inside the jail server 2.1. version conf file; please what is the recommended value for my situation (virtualbox)?


Best wishes,

Joel Gogwim.

In reply to Joel Gogwim

Re: Testing my VPL installation

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Level 2 may be a good option, but you may try first using level 0. Beware that the incoming connections are filtered if you are are using NAT mode.

Best regards.

In reply to Joel Gogwim

Re: Testing my VPL installation

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hi Joel,
If you are using a virtual machine into your Moodle server to host the execution (jail) server, this may be the configuration you need

1) You must assign two ports different than defaults (80 and 443) for example 52000 and 52001 to your execution (jail) server (service). Change properly the configuration file of the jail server (service).

2) Your jail server ports must be accessible from outside (not only from your Moodle server). If you are using NAT in your guest machine network then you must configure port forwarding: 52000 to guest_ip:52000 and 52001 to guest_ip:52001. If you are using bridge mode then you don't need configuration.

3) Use the correct URL (eg http://moodleservername:port/path) in the general plugin configuration in the Moodle server. The machine name must be equals to the Moodler server.

4) If you are using a firewall in your host machine you must open the selected ports.


Remember that your IP 10.0.2.15 is private and not reachable from Internet.

Best regards.

Juan Carlos
In reply to Juan Carlos Rodríguez-del-Pino

Option to disable "Edit" page

by Aivar Annamaa -

Hi!

I propose a new small feature for next VPL version:
Add a new option in the "Execution setting" page to hide "Edit" page from students.

The reason is Java -- it always causes problems (for example, it looks like google analytics tracking code was recently added to our Moodle setup and after that the editor in VPL "Edit" page just doesn't load anymore in Firefox)

Even better solution would be an option which switches editor from Java applet to plain textarea.

In reply to Juan Carlos Rodríguez-del-Pino

Can I download all submissions as zip file?

by Aivar Annamaa -

For some reason I haven't had success with plagiarism detection part of VPL -- it just doesn't show anything to me, not even a message of "nothing found".

I would use Stanford MOSS system for this, but I haven't found a way to download all submissions of a VPL exercise as a zip file (similar to possibility for downloading files associated with Moodle's generic tasks).

Is there such a possibility? If not, then I propose this as a new feature -- it would give VPL users more confidence that they wont be stuck if something in VPL stops working.

In reply to Aivar Annamaa

Re: Can I download all submissions as zip file?

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Aivar,
The reason to not show anything may be that this feature in VPL 2.0.2 only supports C, C++, Java, Ada, Scheme and Prolog. If you are using other programing language, please let me know.
Your request of download all submissions is implemented in VPL 2.0.3. We will release VPL 2.0.3 as soon as possible.
Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Edson Norberto Caceres -

Dear Juan

We have installed the VLP on a 2.5 Moodle. Using a student profile, when I submit a program I have got:

Compilation
virtual memory exhausted: Cannot allocate memory 
Error compiling evaluation program 

Please, can you help us with this error??

Thank you very much.

Edson

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Edson Norberto Caceres -

Dear Juan

Using a Teacher Profile, when I try to see the "Submissions list" I got (in Portuguese)

Erro ao ler a base de dados

Outras informações sobre este erro

If I try to follow the link of the error, I go to page without further information.

Please, could you give me some directions in order to solve this???

Thank you very much.

By the way, the tool is great.

Edson

 

 

In reply to Edson Norberto Caceres

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Edson,
I need more information to say something about your problem, please activate the Moodle debugging mode (Site Administration> Development> Debugging), repeat the action and get a screenshot.
By the way, we are working hard in the release of the new VPL version that has been tested in Moodle 2.5 and we hope to release a RC version the next week.
Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Edson Norberto Caceres -

Dear Juan

Attached the file with errors (in debugging mode).

Thank you for your attention.

Amplexos

Edson

Attachment vlpdebugg.png
In reply to Edson Norberto Caceres

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Edson,

thank you very much for your information. This seems like a strange error since I have not been able to repeat it. The problem seems to be the use of a parameter of the function get_users_by_capability of Moodle and PostgreSQL. Actually the parameter is expendable. Unless you want to wait for the release of VPL 2.0.3 you can modify the line 201 of the file views/submissionslist.php of VPL 2.0.2, changing

$currentgroup, implode (',', array_keys ($graders)));

by

$currentgroup);

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Edson Norberto Caceres -

We will (try to) change the line. As soon we do it I will post what happened. When the new release was ok, we will install it.

Thank you very much for your answer.

Amplexos

Edson

In reply to Edson Norberto Caceres

Re: New Virtual Programming Lab (VPL) module

by Edson Norberto Caceres -

We changed the line and we got a new error. Attached the debugging log.

Thank you for your attention and patience.

Amplexos

Edson

Attachment vlpdebugg02.png
In reply to Edson Norberto Caceres

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Edson,

after studying the issue, the conclusion I have reached is that there may be a problem with the SQL syntax used in VPL <2.0.3 and your PostgreSQL (the problem don’t affects to mySQL). The problem seems to be related with the omission of the keyword ‘AS’ in some queries.

You must wait until the publication of the new version of VPL to check if this resolve de problem.

P.S.: But if my guess is correct this issue with PostgreSQL may be present in other parts of Moodle not related with VPL.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Sam Mudle -

I would love to have VPL work like Stanford's CodingBat

In reply to Sam Mudle

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Jeremy,

Thanks for the information about Stanford's CodingBat.
VPL is a flexible tool and useful for many uses. If you want to get activities similar to those of CodingBat with VPL, for example: an activity that asks for the sum of two integers, follow these steps:
1) Add a new VPL activity and write there the problem description.
2) Go to “VPL administration>Requested files” and add the file Sum2.java
3) Edit and write the following code in Sum2.java
-----------------------
public class Sum2 {
     public static int sum2 (int a, int b) {
           / / Add here your solution
     }
}
-------------------------
This will be the initial content file for the student
4) Go to “VPL administration> Advanced settings > Execution files” and add a file called LoadSum2.java
5) Edit and write the following code in LoadSum2.java
import java.util.Scanner;
public class LoadSum2 {
    public static void main (String [] args) {
        Scanner input = new Scanner (System.in) ;
        int a = input.nextInt ();
        int b = input.nextInt ();
        System.out.println (Sum2.sum2 (a, b));
    }
}
This code will pass test cases to the student’s code.
6) Go to “VPL administration> Test cases” and write as example two cases:
Case  = Case 1
input = 1 2
output = 3
Case = Case 2
input = 5  -1
output = 4
7) Finally, go to the “VPL administration> Execution options” and set Run and Evaluate to Yes.

Now you have a VPL activity with functionalities similar to CodingBat.

I don’t know if these steps are too complex but once you do one of these activities it is easy to do a lot of them.
Best regards.

Attachment screen.jpg
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Jean Martina -

How can I use packages in the VPLs? 

I have students using some jar files in their code. I tried to add them as execution files but no luck.

I am also having problems to define packages and use the packages defined in other .java file in VPL. Any idea on how to sort this out?

 

Jean

In reply to Jean Martina

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Jean,

At this moment the editor and the upload file process (submissions) can’t handle folders or binary files. These are known problems but there are workaround for both:

1)    To place package files in the correct folder for Java you may customize the corresponding scripts (see example attached).

2)    To send binary files to the jail servers you may encode the files to base64 and add the “.b64” extension to its names. The default script will search and decode the files “.b64”.

I attach an example script for the compilation of a Java package in source format

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Jean Martina -

Just to give back! This is doing the packages for me. Not the best code but does it.

 

IFS=$'\n'

for i in `grep package *.java` ; do

FILE=`echo $i | cut -d: -f1`
PACKAGE=`echo $i | cut -d: -f2| cut -d" " -f2 | cut -d";" -f 1 | sed 's/\./\//g'`
mkdir -p $PACKAGE
mv $FILE $PACKAGE
done
IFS=""

In reply to Jean Martina

Re: New Virtual Programming Lab (VPL) module

by Aivar Annamaa -

I assume your goal is to move java files into proper directories according to their package. This looks like good solution, but if you don't care about location of *.java files themselves but only about location of compiled class files, then you can do it also with javac -d option.

Following command compiles all java files in current directory so that each class file ends up in proper directory under current directory:

javac -d .  *.java

I've tried it with Java 7 and Java 8.

In reply to Juan Carlos Rodríguez-del-Pino

Release of VPL 2.0.3

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

The VPL development team is proud to announce the public release of VPL 2.0.3RC. This new version is compatible with Moodle 2.3, 2.4 and 2.5, incorporates new features and fixes some minors errors of VPL 2.0. This release candidate version will be the final release of 2.0.3 if no significant error emerges within the next 3 weeks (please report any issue you find).
You can download this new version from the VPL site Download page.
The bug fixes and new features are the followings:

  • VPL now strictly follows hidden/show grade as set in gradebook
  • "Activity Description" shows relevant settings to teachers
  • "activity description" shows execution files to teachers
  • At similarity page, teachers can get all the students’ submissions in a zip file.
  • At grade page, teachers can “Copy” current submission to its work area. This allows modifying and testing student’s submissions easily.
  • Add syntax highlighting for Scala language (1)
  • Add similarity checks for Scala and Python languages (1)
  • Fix and improve syntax highlighting of Matlab
  • Fix syntax highlighting of scheme
  • Add code to run/debug/evaluate default scripts to decode of base64 (b64) files. This is an easy way to send binary files to jail servers.
  • Add the German translation (1)
  • Update the Catalan translation (2)
  • Update the Japanese translation (3)
  • Fix group work check for managers to allow editing and uploading work group submissions.


(1) Thanks to Lang Michael, Lückl Bernd and Lang Johannes
(2) Thanks to Antonio Piedras Morente
(3) Thanks to Imaizumi Takashi

This new version of VPL is accompanied by the release of AcodeEditor 1.3. AcodeEditor is the applet that let edit the code and run the programs in a text console. The bug fixes and new features that came with this new version are the followings:

  • Add syntax highlighting for Scala language (1)
  • Update Java reserved words
  • Fix minor errors in test cases syntax highlighting
  • Fix Matlab Strings syntax highlighting
  • Fix auto remove spaces
  • Fix cut operation
  • Deactivate Drag and Drop when in restricted mode
  • Released under GPL 3


IMPORTANT NOTICE: Due to the security issues emerged in the last two years in the Java Applet technology, the behavior of Java browser plug-in has changed trying to avoid the execution of malicious Java code. These changes require (for a smooth operation) that you keep updated Java to the last version. Any way, you can review and compile the ACodeEditor source code.

In reply to Juan Carlos Rodríguez-del-Pino

Re: Release of VPL 2.0.3

by Edson Norberto Caceres -

Dear Juan

We have done the upgrade and still we got an error. Bellow the log.

Thank you for your help.

Sincerely

Edson

Attachment vlpdebugg03.png
In reply to Edson Norberto Caceres

Re: Release of VPL 2.0.3

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Edson,
Thanks for your bug report. Again the problem seems to be due to PostgreSQL syntax restrictions. Please, check the final 2.0.3 version, now available. This version address the reported problem.

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: Release of VPL 2.0.3

by Edson Norberto Caceres -

Hi Juan.

We still got an error when using submission list and similarity.

The others options work fine.

Amplexos

Edson

Attachment vpl3
In reply to Juan Carlos Rodríguez-del-Pino

Re: Release of VPL 2.0.3

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

The final 2.0.3 version is now available. This version fix some problems found in the RC version and add the translation to Estonian. It is highly recommended to update to the new version.

In reply to Juan Carlos Rodríguez-del-Pino

Unable to run Java programs

by Pragati Dhingra -

Hello Juan,

Great contribution. VPL seems to be just the right tool to teach programming.

I am trying to configure VPL 2.0.3 to run Java programs but have not been successful.

Jail server is Ubuntu 12.04. I am able to execute small C programs, so I am assuming that setup is correct.

Here is the vpl_run.sh file that I have configured for Java VPL

   1 #!/bin/bash
    2 
    3 #load VPL environment vars
    4 . vpl_environment.sh
    5 #reset LC_ALL
    6 export LC_ALL=en_US.utf8
    7 #Set path to JDK
    8 PATH=$PATH:/usr/lib/jvm/java-1.6.0-openjdk-amd64/bin
    9 #compile
   10 echo "The first file/class must have the Main method"
   11 javac -J-Xmx512m *.java
   12 NAME=$(basename $VPL_SUBFILE0 .java)
   13 if [ -f $NAME.class ] ; then
   14 echo "#!/bin/bash" >> vpl_execution
   15 echo "export LC_ALL=en_US.utf8" >> vpl_execution
   16 echo "PATH=\$PATH:/usr/lib/jvm/java-1.6.0-openjdk-amd64/bin" >> vpl_execution
   17 echo "java -Xmx512M -enableassertions $NAME" >> vpl_execution
   18 chmod +x vpl_execution
   19 else
   20 echo "No compiled or error in file name"
   21 fi

This is the same file as what you recommended with just higher memory allocations.

However, this is the output I get when I submit a solution

Reviewed on Sunday, 11 August 2013, 7:42 AM by Automatic grade
Grade 0 / 100
Assessment report
[-]The compilation or preparation of execution has failed
The first file/class must have the Main method 
Error occurred during initialization of VM 
Could not reserve enough space for object heap 
Could not create the Java virtual machine. 
No compiled or error in file name

Jail server has 4 GB RAM and has enough free memory.

What am I missing? Also, can you please tell the location of default execution files.

Thanks!
Pragati
In reply to Pragati Dhingra

Re: Unable to run Java programs

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Pragati,
Your shell script seems to be correct, the problem is due to the  reserve of 512Mb of memory for the Java heap. If you set this memory for the heap then you will need a memory limit great than 512M (the execution of the Java VM needs much more). You should be aware that if you do not specify a value for the limit of memory to use in an activity, it takes the default value set in the global configuration of the module (Home ► Site administration ► Plugins ► Activity modules ► Virtual programming lab)
(the default value is 256MiB) .
The default scripts for all programming languages ​​are located under /vpl/jail/default_scripts
The default script for Java uses a heap of 16M
I add the default script to run Java programs (VPL 2.0.3).
If you need an specific script due to your Jail servers configuration then you can change your default script. If you need an specific script due to your activity, but you plan to use this script in other activities then you can try using the feature "based on".
Best regards
Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: Unable to run Java programs

by Pragati Dhingra -

Apologies for delayed reply.

I am still struggling to get this running. If I use the default value or any value up to 180m, I get insufficient memory error

Comments The compilation or preparation of execution has failed # # There is insufficient memory for the Java Runtime Environment to continue. # pthread_getattr_np # An error report file with more information is saved as: # /home/p13490/hs_err_pid2714.log ./vpl_run.sh: line 18: 2714 Aborted (core dumped) javac -J-Xmx180m -Xlint:deprecation *.java Not compiled

 

and for 190m or greater, I get this

Comments The compilation or preparation of execution has failed Error occurred during initialization of VM Could not reserve enough space for object heap Could not create the Java virtual machine. Not compiled

 

I used the same script as what you attached in your previous post and only updated the memory parameter on line 18

There is ample free memory (>3GB). Here is a current snapshot using top

KiB Mem:   4099148 total,   340096 used,  3759052 free,     7844 buffers
KiB Swap:  1999996 total,        0 used,  1999996 free,   158476 cached

I am not sure what else I should be trying.

In reply to Pragati Dhingra

Re: Unable to run Java programs

by Pragati Dhingra -

It finally worked. It seems that VPL does not like 64 bit jail servers.

I created a new Ubuntu 32 bit jail server and it worked just fine.

I had another question though. Jail server uses Java 6 by default and I want to use features of Java 7. If I just install Java 7 would it work out fine or are there some other configurations that I should update?

In reply to Pragati Dhingra

Re: Unable to run Java programs

by Pragati Dhingra -

I modified the install-sh file to install openjdk-7 instead of openjdk-6 and everything worked out fine.

I love VPL. smile

In reply to Pragati Dhingra

Re: Unable to run Java programs

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Apologies for delayed reply.

I have not tested Java7 in a jail server and  I don't know if it has problems.
I you test it, please tell us your experience.
Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: Unable to run Java programs

by Pragati Dhingra -

I am able to use Java 7 features fine. I haven't rolled out VPL to students yet. Will get to know more as it gets tested extensively. I shall keep you posted.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by saranya balaji -

The jail need to install "javac" to run this type of program

For PHP , The jail need to install "php5" to run this type of program

When i try to run the java, php programs in VPL its shows the above error message.

I installed the VPL Jail 1.2 Version. I installed successfully and no problem in jail server. Its running fine.

If i try to execute some programs like java, php . I got the Compilation error. In my server java, PHP5 are installed. I am able to run java/php without any problem.

I am using CentOS 6.3 , VPL Jail Server 1.2.

Thanks in advance,

Saranya.

 

 

 

In reply to saranya balaji

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Saranya,

First at all, I must say that I haven't tested VPL in CentOS 6.3. These messages are generated by the default run script that don't find the java compiler (javac) and the php5 interpreter in your CentOS 6.3.

The problems may be different for java than for PHP.

The default script for PHP tries to call to "php5" that for your system may be "php"

If you are sure that you have installed the java JDK and the php-cli, try writing your own "run_vpl.sh" script for a test activity in “execution files” configuration page. You can start with the "java_run.sh" I attach in a post in this thread a few months ago. Try removing the “check_programs” lines.

After you find the correct script for your installation you can replace the default script in your Moodle server that is located in .../mod/vpl/jail/default_scripts and please post your solution here.

Best regards

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by saranya balaji -

Hi Juan Carlos,

We tried writing the own scripts in the CentOS 6.3 but we couldn't find the solution. So we moved to ubuntu 12.0.4 (64-bit) . In the ubuntu(64-bit) machine, the default JavaSDK(64-bit) which is installed by jail server cause the "insufficient memory " error which can be resolved by installation of JavaSDK(32-bit).

 

Thanks,

Saranya.

 

 

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Andrius Lauraitis -

Hello everybody,

Is it possible to execute a C++ program like this ( i want to write some information to an external file):

#include <iostream>
#include <fstream>
using namespace std;

const char fdr[] = "rez.txt";

int main()
{
ofstream fr(fdr);
int a,b;
cin >> a;
cin >> b;
int suma = a + b;
fr << "Suma nauja" << suma * suma << endl;
fr.close();
return 0;
}

I can create the file rez.txt in the editor however when i run the program the file "rez.txt" stays empty. Is it possible to do this with VPL?


In reply to Andrius Lauraitis

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Andrius,
You can write information to an external file, but after the execution of your program, all the files are wiped out. The files you create in the editor are sent to the jail server to be part of the execution environment but never are retrieved.
At this moment VPL can't retrieve files from an execution in a jail server. The nearest feature to what do you want is this: After running your program with the evaluation option, the output (standard output and standard error) of the evaluation program is retrieve as the evaluation result. The last evaluation result is saved with the submitted files.
Also, you can write an evaluation program to process the file content and generate an appropriate output.

Best regards

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Carl LeBlond -

I almost have this working.  I have the following in vpl_run.sh and vpl_evalute.sh

    1 #!/bin/bash
    2 echo  "#!/bin/bash" > vpl_execution
    3 cat vpl_environment.sh >> vpl_execution
    4 echo "php5 -n -f \$VPL_SUBFILE0" >> vpl_execution
    5 chmod +x vpl_execution

When I click "evaluate" it seems to run fine, giving me the correct output.  However when I click "Run" a terminal pops up with following message in title bar.

Console 1 -  Connecting (www.mydomain.com:51143).....Connection refused.Then after a few seconds a popup shows this

Console connection timeout
-----------------------
Console output pending:
Hello World

 

I have iptables setup correct on my moodle I think with iptables -L giving

Chain cP-Firewall-1-INPUT (2 references)
target     prot opt source               destination         
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:imaps
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:tpcsrvr
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:domain
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:ftp
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:infowave
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:https
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:tsrmagt
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:http
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:26
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:webcache
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:imap
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:ssh
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:pop3s
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:pop3
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:smtp
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:gnunet
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:eli
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:nbx-ser
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:urd
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:nbx-dir
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:mysql
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:radsec
ACCEPT     udp  --  anywhere             anywhere            state NEW udp dpt:domain
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpts:51001:51500

My moodle server is on a VPS (centos 6.4) and I asked them if there was anything with the kvm i should consider and they said no.  My jail sever is ubuntu 12.04.  Seems like a problem on moodle vps config but can't figure it out?

 

 

In reply to Carl LeBlond

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Carl,
With the information that you supply, it seems that the problem is located on the client. The execution output has reached the Moodle server from the jail, but the console on the client could not connect to the Moodle server. May be a firewall in the client?
In any case, I can inform you that the version 3.0 of VPL to be published shortly (in a few days), will solve most of the current configuration problems. VPL 3.0 eliminates the use of Java applet and eliminates the need to open ports on the Moodle server. It's full compatible with previous version at data level but also it's needed to upgrade the jail server.

Best regards

 

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Carl LeBlond -

Thanks for the help. I look forward to the 3.0 version.

Carl

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Aivar Annamaa -

Hopefully new version of Jail server fixes this but just in case: compiling Jail system 1.2 gave me name error in Ubuntu 13.10 (32-bit, clean as they come in Amazon EC2).

Unfortunately I didn't save the error as I was in a hurry to switch my instance to an older Ubuntu (12.04 worked fine).

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Aivar Annamaa -

I noticed that VPL 3.0 and Jail Server 2.0 are released. Thats a great news, I'm exited about support for submitting files in a directory structure.

I tried out the new release, but unfortunately it doesn't seem to work in Moodle 2.4.1 and 2.5.4 on Windows -- the content part of "Advanced settings" => "Execution files" page is empty. No error messages were visible, although I had debug messages settings set to DEVELOPER.

The installation of the Jail server (on Ubuntu 12.04) completed without errors (only after I installed openssl-dev), and VPL module indicated that the server is ready.

In reply to Aivar Annamaa

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Aivar,
thanks for your bug report.

Yes, VPL 3.0 is out. This version addresses the problem of the Java applet and reduces the complexity of configuration and use of the previous version.
You are reporting 2 problems that we didn't see in the test fase. Your are reporting the need of install openssl-dev package in Ubuntu 12.04, I guess your are refering to the libssl-dev package. The vpl-jail-system installer, "install-vpl-sh", installs this package and then compiles the server deamon. The "install-vpl-sh" script is the only one you need to install the software.
I am testing now VPL with Moodle 2.5.4+ and I will say what I'll find as soon as possible.

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Aivar Annamaa -

Your're right, it was libssl-dev that I had to install.

I thought that I have to do ./configure and make before ./install-vpl-sh, so probably it would have been fine if I did only ./install-vpl-sh

In reply to Aivar Annamaa

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Aivar,
I have tested VPL 3.0 in a just installed Moodle 2.5.4+ and I can't reproduce the problem you report, the system works without problems. Please try to give more details of the problem.

Best regards.

Attachment demo.jpg
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Aivar Annamaa -

Here is the screenshot of the page where I was hoping to be able to upload my vpl_evaluate.sh and some test scripts:

 

I didn't install VPL 3.0 to fresh Moodle installation: there was older VPL module installed before. I uninstalled the old plugin and deleted mod/vpl folder before installing new version. Should I try this again with fresh Moodle installation?

In reply to Aivar Annamaa

Re: New Virtual Programming Lab (VPL) module

by Aivar Annamaa -

Now I tried it with fresh moodle 2.5.4+ installation and the result is the same.

I'll add a screenshot from my moodle installation, so that you see what modules my PHP has installed. My PHP version is 5.3.13

 

In reply to Aivar Annamaa

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hello Aivar, The screenshot that you show say to me that it is not a PHP problem, it seems to be a JavaScript problem. The edition and execution system of VPL 3.0 is based in JavaScript code. I guess that you are using an updated browser. These browsers have a JavaScript console that will show the possible error. Please, go to the JavaScript console of your browser, and show us the output that you find after loading the "Execution files" page. Best regards.
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Aivar Annamaa -

Thanks for the response!

I think I found the problem: there was syntax error in a PHP-generated piece of javascript and it looked like unexpanded short php tags (<?=... ?>). I had short tags disabled (it was default setting in Wamp server). When I enabled short tags, the page content appeared finally. I will continue my testing tomorrow.

In reply to Aivar Annamaa

Re: New Virtual Programming Lab (VPL) module

by Aivar Annamaa -

It seems to work, thanks! The editor looks really nice, good work! smile

There is a small problem with easy workaround, but I thought that maybe you want to know about it (I noticed the same problem with older VPL as well):

if I have all "No"-s in "Execution options", then after submitting the solution by uploading the file I get following error:

Coding error detected, it must be fixed by a programmer: Invalid state passed to moodle_page::set_state. We are in state 2 and state 1 was requested.

Debug info:
Error code: codingerror
Stack trace:
  • line 841 of \lib\pagelib.php: coding_exception thrown
  • line 789 of \lib\outputrenderers.php: call to moodle_page->set_state()
  • line 296 of \mod\vpl\locallib.php: call to core_renderer->header()
  • line 84 of \mod\vpl\forms\submission.php: call to vpl_redirect()

The solution actually gets uploaded. The same error happens both in designer role and in student role.

(I think I have seen this error occasionally also when "evaluate" in "execution settings" was set to "yes", but I can't replicate it at the moment)

 

In reply to Aivar Annamaa

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Thanks very much Aivar,
This problems will be resolved as soon as possible.
Please, don't hesitate in telling us any other problem you found.

 

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Aivar Annamaa -

I didn't have any memory problems when I used VPL for Python programs but I have Java memory troubles under VPL Jail 1.2 almost every time I set up a Java exercise in VPL.

Today I tried Java 8 under jail and I was not able to execute even java -version (nor java -Xmx16m -version) when VPL exercise memory limit was set to 256MB -- this gave me "Could not reserve enough space for code cache". Can it be that java process really needs more memory for this task? (I could run it with memory limit raised to 512MB.)

I was able to overcome this problem by adding -client switch to java, ie. java -client -version ran fine with 256MB.

What memory related issues should I should take into account when using VPL jail 1.2? I don't have memory limit setting in my /etc/vpl/vpl-xmlrpc-jail.conf. Should I add one in order to override the default setting? What is the default?

 

 

In reply to Aivar Annamaa

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Aivar,

this problem with Java in VPL Jail 1.2 made us change completely the way we limit the use of memory in VPL jail 2.0.

The VPL Jail 1.2 limits the virtual memory of users’ processes (but the virtual memory is not really the memory that the process is using). Java tend to use a large amount of virtual memory, in 64 bits systems Java maps easily more than 2Gb, in 32 bits systems the size of virtual memory that Java needs can be superior to 256Mb. Running java (OpenJDK7 32bit) with your suggested command line option (-client) seems to use around 65MB less virtual memory than without it.

 

We think that it will be better switch to VPL 3.0 + jail2.0 as soon as possible.

 

By default, the memory limit in jail 1.2 is INT_MAX. Add a memory limit in your jail server 1.2 configuration will not change the problem.

 

Best regards

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Aivar Annamaa -

Thank you for the response!

OK, I will ask our server admin to upgrade VPL soon.

Is it safe to run jail2.0 and jail1.2 together in the same system? This way I could first test the VPL 3.0 in our official test-Moodle.

 

 

BTW: the VPL 3.0 announcement says "Can be used directories on the required files, execution files or the files submitted by students" -- what does it actually mean? Can students upload files in a directory structure? Should it be zipped? I tried uploading a zip file but it looks like the system treated it as a text file.

In reply to Aivar Annamaa

Re: New Virtual Programming Lab (VPL) module

by Aivar Annamaa -

One more thing -- when I test-installed Jail 2.0 then it installed a lot of GUI-related packages. Can this be avoided? I'm using VPL only for evaluation of students' work and I don't see how I can use GUI programs for that.

Still, it would be interesting to know how do you use VPL's Run and Debug features in teaching. Are these meant only for saving students the hassle of installing necessary stuff on their computers? Do your students actually develop their solutions in the browser?

In reply to Aivar Annamaa

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

I will try to answer all your questions:
1) “Is it safe to run jail2.0 and jail1.2 together in the same system?” During the development of jail 2.0 we never consider this scenery. It may be possible, but I think it requires a lot of work.
2) "Can be used directories on the required files, execution files or the files submitted by students" what does it actually mean?
The module and the jail server are ready to use files in a directory structure but in this first feature release, this is only possible at the editor. You can't upload files to a directory without the editor.
3) "... installed a lot of GUI-related packages. Can this be avoided?"
The new jail server can run programs with GUI. If you don't use it you can remove it from your jail server, but I think that freeing 1 GB of disk space don't pay the work.
4) "... Are these meant only for saving students the hassle of installing necessary stuff on their computers?"
In general our students are free to use any IDE, but in the first contact they may prefer an easy to use development tool with few options (save/run/debug/evaluate). They also can work in any PC with a browser and get the bonus of using the evaluation feature. On the other hand they lost the autocomplete features and a good debugger of an IDE.
On the other hand, if the student use the editor, the teacher can get a better picture of the students' work (the system keeps previous submissions). The teacher can easily answer questions about a student work without the need of download or run any code in their machine. The teacher can also run easily GUI works as part of the evaluation.
We also use the system to do exams under controlled conditions, in these cases the use of the editor is required.

In short, many students and teachers use the editor when the job is small or even medium, but this is not commonly mandatory.


Best regards

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Aivar Annamaa -

Thank you for your thorough answer!

I agree that often the installation of tools can be too frustrating and sometimes the tools themselves are also frustrating smile

But still, more experienced students do love their IDE-s. Have you considered adding a web API to VPL? This way one could integrate other tools with VPL, eg. there could be an Eclipse plugin for submitting code directly from Eclipse. I've heard that a Finnish company has tried something like that (http://viope.com/en/schools/news/viope-eclipse-plugin-2013.html).

Currently I'm working on a Python IDE for beginners (https://bitbucket.org/aivarannamaa/thonny). In the future this IDE will be able to talk with our own home baked interactive web-textbook:

  1. The student logs into the textbook and clicks a special link next to an exercise
  2. the server responds with a python file containing a submission URL together with a token generated for identifying this student and this exercise
  3. the file gets opened in Thonny IDE (alternatively the student just copy-pastes the url+token from the textbook)
  4. the student writes the solution and presses the submit button in the IDE (no login needed here, the token is used for authentication)
  5. server checks the solution (possibly inside VPL jail, if I'm able to decipher the protocol) and sends the response to IDE, which shows it to the student
  6. (if necessary, the student goes back to point 4)

I think the same scheme could work also when you substitute textbook with VPL and Thonny IDE with Eclipse. I could contribute to creating the Eclipse plugin, if necessary.

In reply to Aivar Annamaa

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Aivar,


I had not thought of adding a web API to VPL, but your question made ​​me reconsider it. If someone is interested in developing a plugin for Eclipse that interacts with VPL, I will develop the web API. The idea is not new, but the offer to develop the plugin, yes. Also, this is an appropriate time because at present the web API can be developed with little effort.

Best Regards

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Aivar Annamaa -

OK, I could start working on the Eclipse submission plugin in the end of June and hopefully complete the first version before August. Unfortunately I can't promise anything earlier. If this is OK with you then we have a deal smile

 

(About VPL 3.0.1 -- I sent the code to our admin and hopefully I can tell you tomorrow, whether it fixed the problems.)

In reply to Aivar Annamaa

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Thank you, the upgrade went fine!

There are two small issues remaining: although I set up the plugin to use http, when I press "Evaluate" in the editor, it tries to connect to "https://<my-jail-server>/OK" and because of self signed certificate it creates this warning and requires accepting the certificate. Is there a way to avoid this?

This is NOT a issue, it is a feature. No matter what type conection you use from Moodel server to jail server (http or https), if you connect your browser to your Moodle server ussing https then the browser MUST connect to the jail server using wss. This is not a VPL elecction is a browser requisite, almost all browser reject to mix https (secure http) with ws (plain websocket), only Chrome accept this mix.

In any way, we think that its better to use https and wss with self-signed certificates than clear text. 

(Unfortunately I don't know much about network stuff, so I'd be grateful if you could recommend me a tutorial or guide for changing the certificate, if that's what is needed).

To avoid this you must get a certificate signed by a trusted CA. Also, you can easy customize your self-signed certificates. Take a look to the installation script 'install-vpl-sh', change the certificate information and run the script again (it is safe to run it several times) but before remove the key and certificate files "/etc/vpl/*.pem". This will regenerate customized certificates, but this will not avoid the request of accepting self signed certificate.


What are the possibilities for formatting the evaluator feedback? When I look at the output of built-in, IO based evaluator, it looks like there is some special markup used that allows to create headings or smth like that. Is this documented somewhere?

No, but I write it here.

Grade comment (automatic or manual) format

Lines starting with "-" are titles. The title may end with "(grade)". Example:- Error bla bla (-2)
Students don't see this discount. The grade (negative value = discount) is used by the button "calculate" in grade page.
Lines starting with > is shown as preformated text.
filename:linenumber generate hyperlink.

 


Thanks for your work again!

Aivar
(You can reply to forum, if you think this may be useful for others as well)

Best regards

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Aivar Annamaa -

Thank you for the answer!

Actually, it turned out that the problem with accepting the certificate was my smaller problem. The main problem, that I discovered only now, is that as my jail-server is behind the firewall, the students can't access the evaluation feature outside our local network.

Is the browser connecting to jail-server only for checking whether the service is available, or does it perform the whole evaluation protocol directly with jail-server? I assumed that the "Evaluate" button delegates communication with the jail to Moodle server, am I wrong about this?

In conclusion, are there any ways to leave the jail-server behind the firewall and at the same time allow students to access evaluation feature outside of local network?

best regards,
Aivar

In reply to Aivar Annamaa

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

I'm sorry Aivar,
but the current version of VPL require that the browser connects to the execution/jail server to monitor the process. The previous VPL versions kept the connection from the Moodle server to the execution server with a high resource use.
In VPL 3 all the execution/jail servers must be reachable from internet behind or not of a firewall. Only the service ports (http/ws and https/wss) of the servers need to be reachable.
If you want, also you can revert the upgrade, there is no difference on data used.

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Aivar Annamaa -

I think I'm able to convince the admin to open the required ports for the outside world. Until then I can use a small server outside our network. I don't want to give up the new editor smile

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Aivar Annamaa -

I discovered a small problem:

Indentations in preformated feedback text doesn't show on editor page. They do show in submission view page.

Eg. When I output

<|--
-+ test8_Combination
Tried with following input program:

>if n > 100 then {
>    print("big!")
>} else {
>    print("small!!")
>};
OK: your grammar accepts this. --|>

then the indentations are shown on submission view but not on editor page.

In reply to Aivar Annamaa

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Aivar,
yes, this a known issue that has been resolved in the working 3.1 version available in GitHub. This problem is due to a trim of the lines processes that is not needed (line 530 of VPLIDE.js).
=====================================
- return $JQVPL.trim(s.replace(/&/g, "&amp;").replace(/</g, "&lt;")
- .replace(/>/g, "&gt;"));
+ return s.replace(/&/g, "&amp;").replace(/</g, "&lt;")
+ .replace(/>/g, "&gt;");
=====================================
Best regards

 

In reply to Aivar Annamaa

Re: New Virtual Programming Lab (VPL) module

by Reza Ervani -

Nice to hear this.

We are also need eclipse plugin for Moodle submission. And I think it is nice if we can know the development progress and also learn something from all developer for this plugin.

Where can we get the code (or tracker) for this plugin development ?

Big Thanks,

Reza Ervani
Sekolah Rumah Ilmu Indonesia

In reply to Aivar Annamaa

Re: New Virtual Programming Lab (VPL) module

by Reza Ervani -

Dear Mr. Annamaa,

Is there any new progress news about Eclipse Module for VPL ? 

Regard,

Reza Ervani
Sekolah Terbuka Rumah Ilmu Indonesia

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Antonio Lepore -

Hi, I've started using moodle for my final work at university. I installed vpl in moodle ad admin but i can't understand how users can use it, f.e. how teacher can create quiz for student.

Thanks.

In reply to Antonio Lepore

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Antonio,
your question is too general for give a simple answer. The VPL activities act similar to the Moodle task, I do a "copy" and "paste" here of part of the general documentation.
-----------------
Creating a simple activity

Follow these steps:
Create a VPL activity
Set the name of the activity and its description
Set the deadline
Set the maximum number of files that every student can upload
Set the maximum score to get
Save the new activity
Go to options and set the execution actions (run/debug/evaluate) that the student can do
It is desirable to set, in "Required Files", the names of the files that the student must submit.
-----------------

Best regards

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Antonio Lepore -
Thanks for your answer but i have another question. Can I made a quiz with authomatic evaluation? And if I can, how?
F.e.
I give  text to students, they make their own program and then system give me an authomatic evaluation of their test.
Thank you!
In reply to Antonio Lepore

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Antonio,
You can find more information about automatic evaluation in VPL at the following links:

http://vpl.dis.ulpgc.es/index.php/en/documentation/76-general-documentation
Section "Creating automated tests"
and
http://vpl.dis.ulpgc.es/index.php/en/documentation/58-automatic-evaluation-of-students-submissions

Best regards

In reply to Juan Carlos Rodríguez-del-Pino

Having problem creating user vpl_evaluate.sh script

by Dominique Thiebaut -

Dear Ruan Carlos,

First, thanks for putting together such a useful and sophisticated module for Moodle.

I teach computer science and am interested in setting VPL up for my class next semester.  

I have setup two virtual servers, one running LAMP+Moodle+VPL module, the other one running the vpl-jail-system.

It took me a while, but everything seems to run fine.   I have a simply python 3 program called test2.py that I am currently using as test:

x = float( input( "> " ) )
y = float( input( "> " ) ) 
print( min( x, y ) ) 

And I have a vpl_evaluate.cases file to test it:

case = Test 2a
input = 3
5
output = 3.0
case = Test 2b
input = 3
3
output = 3.0
case = Test 2c
input = 1000
-1000
output = -1000.0


When I run or evaluate the script with the default vpl_run.sh and vpl_evaluate.sh, i.e. without specifying them, I get the console, and I can enter 2 numbers and get the smallest one back, and the evaluate gives me a "0/3 tests fail" which is good.

When I create my own vpl_run.sh script, it also works fine and runs the program in the console.

#! /bin/bash
echo "#! /bin/bash"     > vpl_execution
echo python3.4 test2.py          >> vpl_execution
chmod a+x vpl_execution
However, trying to set the vpl_evaluate.sh script to the code above makes the system hang.
A 1-line window opens up and starts showing a counter showing seconds elapsing: "Evaluating: 3 seg", then 4 seg, 5 seg, etc.

When I look at the vpl-jail-server, I see that a new directory is created

jail/home/p15913# ls -l
total 16
-rwx------ 1 15913 15913 1559 Jun  7 21:28 common_script.sh
-rw------- 1 15913 15913   77 Jun  7 21:28 test2.py
-rwx------ 1 15913 15913  360 Jun  7 21:28 vpl_environment.sh
-rwxr-xr-x 1 15913 15913   32 Jun  7 21:28 vpl_execution
but it seems that vpl_evaluate.sh or vpl_evaluate.cases does not get created there.

I've been tweaking many different things, but I'm not finding out what the problem is.  It looks like my vpl_evaluate.sh is missing something.

Is there something obvious I'm missing?

Many thanks for any info/feedback you could share.

Dominique




In reply to Dominique Thiebaut

Re: Having problem creating user vpl_evaluate.sh script

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Dominique,
Thank for the clear exposition of your problem.
All types of executions (run/debug/evaluate) take two stages: The first generates vpl_execution or vpl_wexecution, the second executes vpl_?execution. But before start the second, the system remove all the execution files (vpl_evaluate.sh, vpl_evaluate.cases, etc.) that you set in  "ADVANCED SETTINGS  ► EXECUTION FILES".
Your 'ls' may be showing that you are in the second stage.
You can go to " ADVANCED SETTINGS /  FILES TO KEEP WHEN RUNNING" and set the files that you miss as to be kept. Also  you can rename the files in vpl_evaluation.sh and the system will not be able to delete them.

Best regards


In reply to Juan Carlos Rodríguez-del-Pino

Re: Having problem creating user vpl_evaluate.sh script

by Dominique Thiebaut -

Thanks for the quick response, Juan Carlos.

Unfortunately, setting the files to keep to all the vpl_run/evaluate/cases does not solve my problem.

However, I discovered that I get an error on the jail server when I attempt to use my own vpl_evaluate.sh:

ERROR: apport (pid 8308) Tue Jun 10 10:16:51 2014: Unhandled exception:
Traceback (most recent call last):
  File "/usr/share/apport/apport", line 298, in <module>
    cwd = os.readlink('/proc/' + pid + '/cwd')
FileNotFoundError: [Errno 2] No such file or directory: '/proc/8307/cwd'
ERROR: apport (pid 8308) Tue Jun 10 10:16:51 2014: pid: 8308, uid: 0, gid: 0, euid: 0, egid: 0
ERROR: apport (pid 8308) Tue Jun 10 10:16:51 2014: environment: environ({})
ERROR: apport (pid 8310) Tue Jun 10 10:16:51 2014: another apport instance is already running, aborting
Apport is a tool that apparently gathers crash information, and I imagine the vpl_jail system is making use of it.   Here it looks like I have two such instances running at the same time.
Any suggestion for fixing this?
Thanks again,

Dominique
In reply to Dominique Thiebaut

Re: Having problem creating user vpl_evaluate.sh script

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Dominique,
the error you show is not due to VPL and I don't know the reason of the problem. Nevertheless, I found that apport is logging a normal action in vpl-jail-server as an error. This is my fault I wrote a call to abort() instead of exit(). This problem (the logging) of apport will be solved in vpl-jail-server 2.0.2.

Returning to your question, I think that the better way to help you to resolve your problem with vpl_evaluation.sh is that you show the details of the activity you are developing.
A backup file with the activity migth be great! if you are using "based on" don't forget to also add this activity

Best regards.
Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: Having problem creating user vpl_evaluate.sh script

by Dominique Thiebaut -

Sure, here's a description of the activity:

Test Python 1

Due date: Sunday, 31 August 2014, 8:00 PM
Requested files: test1.py (Download)
Type of work: Individual work
Grade settings: Maximum grade: 100
Run: Yes Evaluate: Yes
Automatic grade: Yes

This is the second trial...

Execution files

vpl_run.sh

    1 #! /bin/bash
    2 echo "#! /bin/bash" > vpl_execution
    3 echo "python3.4 test1.py" >> vpl_execution
    4 chmod a+x vpl_execution
    5 

vpl_debug.sh

vpl_evaluate.sh

    1 #! /bin/bash
    2 echo "#! /bin/bash" > vpl_execution
    3 echo "python3.4 test1.py" >> vpl_execution
    4 chmod a+x vpl_execution
    5 

vpl_evaluate.cases

    1 Case = Test 1
    2 output = "Hello World!
    3 "
    4 



When I test the activity in the VPL administration module, I go to Edit and enter this simple code:

print( "Hello World!" )

which I save.  I click on Run and get the correct output in the console.  

Now, for some reason I don't understand, when I click on Evaluate, I do not get the counter shown seconds elapsing (I haven't changed anything in my setup), but instead I get the output of the program but no evaluation of its output and no grade.


Moodle VPL Evaluate Window


I am forging ahead and learning how to setup VPL activities without having a custom vpl_evaluate.sh file, but I imagine that I will need to do so in the future, so any help on this would be much appreciated.

By the way, I am documenting my progress and putting sample VPL activities on my wiki, mostly so that I can remember how to set this up when the time comes next semester.  Others  may find them useful too:  http://cs.smith.edu/dftwiki/index.php/Tutorials


Thanks again for the superb tool and support!

Dominique

In reply to Dominique Thiebaut

Re: Having problem creating user vpl_evaluate.sh script

by Dominique Thiebaut -

Ah!  I did find what I think is the problem.   I just created a new VPL activity and created my own vpl_evaluate.sh, which is now stuck running and counting seconds as I originally described in my first post.

When I look on the jail server, I see that the files tested are located in /jail/home/p19526:

root@VPLServer:/jail/home/p19526# ls -l
total 32
-rwx------ 1 19526 19526 1559 Jun 11 10:23 common_script.sh
-rw------- 1 19526 19526  233 Jun 11 10:23 gremlin.py
-rw------- 1 19526 19526   97 Jun 11 10:23 sample.txt
-rwx------ 1 19526 19526  408 Jun 11 10:23 vpl_environment.sh
-rw------- 1 19526 19526  175 Jun 11 10:23 vpl_evaluate.cases
-rwx------ 1 19526 19526  162 Jun 11 10:23 vpl_evaluate.sh
-rwxr-xr-x 1 19526 19526   49 Jun 11 10:23 vpl_execution
-rwx------ 1 19526 19526  162 Jun 11 10:23 vpl_run.sh

However, when I check the vpl-related processes running, I see this:

root@VPLServer:/jail/home/p19526# ps auxw | grep vpl
root      2242  0.0  0.0  23520  1000 ?        S    Jun04   5:01 /etc/vpl/vpl-jail-server
root     22910  0.6  0.0  32232  1856 ?        S    10:23   0:00 /etc/vpl/vpl-jail-server
19526    22911  0.0  0.0      0     0 ?        Zs   10:23   0:00 [vpl_evaluate.sh] <defunct>
19526    22913  0.0  0.0  17960  1436 pts/3    Ss+  10:23   0:00 /bin/bash /home/p19526/vpl_execution
root     22915  1.0  0.0  23912  1724 ?        S    10:23   0:01 /etc/vpl/vpl-jail-server
root     22963  0.0  0.0  11744   924 pts/0    S+   10:25   0:00 grep --color=auto vpl

Note that the vpl_execution file was executed from "/home/p19526/", which does not exist.  It should have been "/jail/home/p19526"...

I will try to figure out where/how this setting can be modified...

Dominique


In reply to Dominique Thiebaut

Re: Having problem creating user vpl_evaluate.sh script

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

The ps output is normal. Due to chroot, the path

/home/p19526/vpl_execution

is correct.


Best regards


In reply to Juan Carlos Rodríguez-del-Pino

Re: Having problem creating user vpl_evaluate.sh script

by Afzaal Shabbir -

Hi Juan,

i have a totally unrelated question, is it possible to install Moodle+VPL PLugin + Jail service install in one virtual machine?

i need to give this logic to one of our client who is unable to understand why we need to have two machines dedicated to moodle.

In reply to Afzaal Shabbir

Re: Having problem creating user vpl_evaluate.sh script

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Yes, it's possible, but not recommended. The load of execution in the jail server can interfere in the execution of Moodle. The security is another problem that can arise.

If you have enough hardware assigned to the moodle server you can install Virtualbox in your virtual machine (yes, a virtual machine into a virtual machine) and install there the jail server.

You must be aware of three things:

1) Your jail server (service) must have assigned two ports differents than defaults (80 and 443) for example 52000 and 52001. Change properly the configuration file.

2) Your jail server ports must be accessible from internet (not only from your Moodle server). You can use NAT port forwarding if using in VirtualBox

3) Use the correct URL (eg http://servername:port/path) in the general plugin configuration in the Moodle server


Best regards

Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: Having problem creating user vpl_evaluate.sh script

by Afzaal Shabbir -

Thank you very much for detailed response. really appreciate your help.

Cheers,

A

In reply to Dominique Thiebaut

Re: Having problem creating user vpl_evaluate.sh script

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Dominique,
Thanks for your tutorial, any help is appreciated.

Again your clear report of the issue makes me to point out the problem easily.

The problem is that vpl_evaluation.sh is the script to generate the program/script that evaluates the student's program and NOT the student's program that is going to be evaluated.

The default vpl_evaluate.sh uses the result of vpl_run.sh (vpl_execute) as the program to be evaluated.
Notice that the output of the execution of vpl_execute, generated by vpl_evaluate.sh, is the result of the evaluation. You can see the format of the output of this  execution in the documentation .

Best regards

In reply to Juan Carlos Rodríguez-del-Pino

Question: How to make output of program evaluated become the grade

by Dominique Thiebaut -

Thank you so much for all the help, Juan Carlos.

I have another question, if you don't mind.

I would like to have students submit assembly language programs, and one of the requirements for one of the tests would be to generate code that as small an executable as possible.  In other words they would have to pay close attention to the size of their code and of their data.

I have figured out how to test/evaluate an assembly language program.  That's fine. (By the way, I documented the VPL activity here for those interested: http://cs.smith.edu/dftwiki/index.php/Tutorial_Moodle_VPL_Assembly_Language_with_Output)

Now, I know I could add a new program to the "Execution Files" section of the VPL administration block that could get the size of the executable version of the student assembly program.   This second program could easily output 100, 90, 80, 70, etc... depending on whether the size of the student program is within 10%, 20%, 30%, 40%, etc.,  of the best size. 

I would like the output of this second program (with will be a number between 100 and 0) to become the grade assigned to the student program.

I'm still very confused about how to write a vpl_evaluate.sh script that would take this number output by the program and make it the grade.

Any suggestion or hint?

Merci!

Dominique

In reply to Dominique Thiebaut

Re: Question: How to make output of program evaluated become the grade

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

In this case I think that an example will be better. Copy and paste the following script into vpl_evaluate.sh and push evaluate in the test activity.
-------------------------------------------

#!/bin/bash
cat >vpl_execution <<END_SCRIPT
#!/bin/bash
# This is an example of evaluation output
#
# One line comment
echo "Comment :=>>This is a one line comment"
# Multiline comment
#start tag
echo "<|--"
echo "This is a multi line comment (line 1)"
echo "This is a multi line comment (line 2)"
echo "This is a multi line comment (line 3)"
echo "This is a multi line comment (line 4)"
#end tag
echo "--|>"
#This is a grade set
echo "Grade :=>>1Value"
# Comments may have some format
echo "<|--"
echo "-Titles start lines with '-'"
echo "Normal text"
echo ">preformated text"
echo "--|>"

#Last grade is taken
echo "Grade :=>>Value"
END_SCRIPT
chmod +x vpl_execution

--------------------------------

Best regards

In reply to Juan Carlos Rodríguez-del-Pino

Re: Question: How to make output of program evaluated become the grade

by Dominique Thiebaut -

Once again, thanks for the quick answer.  This was what I needed to figure out how to make it work.  I can now test a program and assign a grade inversely proportional to the size of the executable version of the program.  

I have documented it here for those interested: http://cs.smith.edu/dftwiki/index.php/Tutorial:_Moodle_VPL_--_Testing_the_Size_of_A_Program%27s_Executable

Thanks much!

Dominique

In reply to Juan Carlos Rodríguez-del-Pino

Roadmap for 3.1?

by Michael Tanczos -

I was curious as to what you were exploring for 3.1 - Is there any type of roadmap you are working with?   Also, I know there is another code-related plugin for moodle that integrates automated code-checking into quiz questions.   However the java code that is run is done directly on the server, which I'm not too keen on.

Is there any documentation on how to utilize the jail server as well?   It might be neat to have a suite of both assessment and assignment types that can utilize the jail server.

In reply to Michael Tanczos

Re: Roadmap for 3.1?

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hello Michael,
the 3.1 version is almost ready, but will not bring big news:
1) New web service. This will allow to write external clients for VPL (for example: an Eclipse plugin).
2) Adapt the code to running in Moodle 2.6 and 2.7
3) Add default script for Lua, D, Clojure and lisp languages
4) Add support for regular expressions to the default evaluation program
5) Update to noVNC 0.4-173. This fix the keyboard problem
6) Fix minor errors.
At this moment there are isn't a Jail server API documentation. But if some people is really interested in using the jail server for other purposes I will write the docs. In any case, it will be of low priority for me at this moment. You always can deduct the API by reading the code of the module.

Best regards
Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: Roadmap for 3.1?

by Jhon Carlos -

Sir, i get this error, 

how to sole please help..


Failed to construct 'WebSocket': The URL 'ws:///52551982455300/monitor' is invalid.
In reply to Jhon Carlos

Re: Roadmap for 3.1?

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

It seems that you have some configuration problem.

Please, show me the "Execution servers list" that you set in the VPL plugin general configuration and the file "vpl-jail-system.conf" in the execution server.


Best regards

In reply to Juan Carlos Rodríguez-del-Pino

Re: Roadmap for 3.1?

by Dilvan Moreira -

   Hi,

   Very nice plugin! I am a professor at University of São Paulo (Brazil). We would like to be able to have questions taken from a list of programming questions. Similarly to what the moodle question engine does with the question bank. I have a student working on this. We would like to change your plugin to add this feature and contribute it back to the project. We would like to know:

1. Would it be better to rewrite part of the plugin as a question type? So the plugin could be instantiated as an assignment or a question type.

2.  Or would it be better to add the features of a question list and question draw (randomly choosing one or more questions) in the assignment plugin?

In either case, any advice in how to tackle the problem will be very welcomed.

Dilvan.

In reply to Dilvan Moreira

Re: Roadmap for 3.1?

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Dilvan,
I think that the better solution is to create e new type of question.
The possibility of using VPL activities (or similar) as quiz questions would be a very good feature. To take advantage of the VPL infrastructure I think that the good balance should be create a type of question that use VPL as test provider for the defined questions. VPL don't has this feature then you (we) need to establish and write an API at VPL to accomplish this function.
Best regards.


In reply to Dilvan Moreira

Re: Roadmap for 3.1?

by Rahul Garg -

Hi Dilvan,

   I am a faculty from India.  I am working with a student for exactly the same feature -- VPL based questions for quizzes. I am wondering if it will be possible to join hands to accomplish this quickly (would like to have this feature before the fall semester starts). Please let me know.

Thanks,

- R


In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Jhon Carlos -

Hello,

I need your help.


How can i install this VPL in my ONLINE HOSTING SERVER ? 

How to install the execution server in my online hosting site.. ?

In reply to Jhon Carlos

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Sorry for the late reply, I have been traveling to different countries and I have been unable to respond earlier.

I don't know if I can guide you due to the lack of information. I don't know anything about your "online hosting server", there are a full range of "online hosting servers" . In any case, to install the "execution server" you need to have a full control of your "online server" including the OS.

Ask a concrete question with full information about the situation (full "online hosting server" details) and then I can give you a answer.


Best regards

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Haytham Abdulla -

Dear Sir,

Thank you for the great plugin.

I think your server is down:

http://vpl.dis.ulpgc.es/


is there any mirror?

In reply to Haytham Abdulla

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Dear Haytham Abdulla,
Thanks for your message.
yes, we know our server is down. We are migrating the server to other system and it is taking more time than expected.

Best regards
In reply to Juan Carlos Rodríguez-del-Pino

Trying to evaluate Java program. Can get comment and grade output, but VPL does not accept them.

by Dominique Thiebaut -

Hi,

I am trying to automatically grade a Java program that will generate a simple string of numbers.

I have a java program (Tester.java)  that inherits the student submitted program (Homework.java), and tests it.   In the vpl_run.sh file, both java files are compiled and Tester is executed (see at the end of this post for details).

Tester outputs its evaluation of the student program in this form (simplified):

<|-
Your program output: 1 7 21 35 35 21 7 1
Correct output!
-|>
grade :=>> 100

I am not sure what I should put in the vpl_evaluate.cases file, since Tester is doing all the work, i.e. checking the output of the program and assigning the grade.    If vpl_evaluate.cases  is empty, VPL complains with "No test case found".  If I put a "case = Test 1" line in it, it complains that  the output  is missing.   If I put a dummy "OK"  string in it, then I get this:


VPL output


Here are the basic settings for my VPL Project:

Due date: Thursday, September 18, 2014, 1:00 PM
Requested files: Hw1_1.java (Download)
Type of work: Individual work
Grade settings: Maximum grade: 100
Run: Yes Evaluate: Yes

Requested files

Hw1_1.java

    1 // paste your code below...
    2 

Execution files

vpl_run.sh

    1 cat > vpl_execution << 'EOF'
    2 #! /bin/bash
    3 javac -J-Xmx128m VPLFakeTester.java 
    4 javac -J-Xmx128m VPLJavaTester.java 
    5 java VPLJavaTester Hw1_1.java patterns.txt
    6   
    7 EOF
    8   
    9 chmod +x vpl_execution


Thanks for any help on this!


In reply to Dominique Thiebaut

Re: Trying to evaluate Java program. Can get comment and grade output, but VPL does not accept them.

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Dominique,
I'm glad see that you are advancing in the use of VPL.  Your are in the correct way to use your own program tester, but you must be aware that the evaluation is launched from vpl_evaluation.sh and not from vpl_run.sh.
The script "vpl_run.sh" is intended to be only for the execution (in terminal) of student's own code. You must copy (or move) your vpl_run.sh to vpl_evaluate.sh.

Other comment about the script that you show: I think that is better to use the script to compile the code and after, if all is OK, generate the execution script. VPL processes the output of the script execution (vpl_run.sh,vpl_evaluate.sh) and the output of the vpl_execution on different way.

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Jhon Carlos -

Sir,

I wish to install your execution jail server in AMAZON WEB SERVICE..


i.e install jail system in UBUNTU server provided by AWS... 

Could you please guide me..

I have setup my ubuntu server and installed VPL.. 

In reply to Jhon Carlos

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
The steps for installation and configuration are:
  1. Install an Ubuntu server as clean as possible
  2. Download the latest version of the software (vpl-jail-system) with the command
    wget http://vpl.dis.ulpgc.es/releases/vpl_jail_system-2.0.2.tar.gz
  3. Unzip and install the vpl-jail-system
    tar -xvf vpl_jail_system-latest.tar.gz
    cd vpl_jail_system-*
    sudo ./install-vpl-sh
  4. Follow the instructions and wait for the necessary downloads. The installation script will try to install the development software commonly used, but you may need to install some other by hand.
  5. Stop the service with the command
    sudo service vpl-jail-system stop
  6. Edit the file /etc/vpl/vpl-jail-system.conf. Set the URLPATH that will be used as key in connections with your execution server
  7. Start the service
    sudo service vpl-jail-system start
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Jhon Carlos -
Sir,

i'm not clear with the 6th step.. i cant understand what to do..

could you please explain.

In reply to Jhon Carlos

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

"/etc/vpl/vpl-jail-system.conf" is the configuration file  of your execution server. You must edit it to customize your execution server.
This is a text file with a common format in linux.
See http://vpl.dis.ulpgc.es/index.php/en/documentation/78-execution-server-configuration for details
The parameter URLPATH is important to avoid that your server accept task from unauthorized servers (You can also use TASK_ONLY_FROM)
Use URLPATH as a the key to access your execuion server. The value set must be used in the URL to your server as the path.
Example:
with server name "exec.com" and "URLPATH=password" the the URL you must use to access your server is
http://exec.com/password

See also the section "Checking the installation of an execution server" in general documentation
http://vpl.dis.ulpgc.es/index.php/en/documentation/76-general-documentation

Best regards

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Jhon Carlos -

Thank you sir,


all that confuses me is "URLPATH"... Sir what is this urlpath and how to get this ?


Thanks

In reply to Jhon Carlos

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

URLPATH is a parameter you can/must set in the file "/etc/vpl/vpl-jail-system.conf". You must invent a text to be used as URLPATH.
For example, suppose I want to use "INDIA" in my execution server called "execute.com"  then
1) I will modify /etc/vpl/vpl-jail-system.conf setting:
URLPATH=INDIA
2) I will modify/add in the my moodle server the VPL module general setting execution servers list the URL
http://execute.com/INDIA

best regards



In reply to Juan Carlos Rodríguez-del-Pino

VPL: How to run a graphical tkinter (Python) program

by Aivar Annamaa -

Hi Juan Carlos!

Is it possible to run a graphical Python program in jail and see the output in Moodle? I'd like to make it easier for instructors to check the solutions for an exercise where students had to draw something with Python turtle.

When I tried, I got a console, which said:

_tkinter.TclError: no display name and no $DISPLAY environment variable

What should be the value of $DISPLAY?


In reply to Aivar Annamaa

Re: VPL: How to run a graphical tkinter (Python) program

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

The $DISPLAY environment variable will point at a screen, when using a graphical interface on your local computer. You might have some luck playing around with the xvfb command, but all I can say about that is to point you at these websites:

http://linux.die.net/man/1/xvfb

http://superuser.com/questions/58829/redirecting-x-output


In reply to Davo Smith

Re: VPL: How to run a graphical tkinter (Python) program

by Jhon Carlos -

I'm getting this error in your demo execution server : 

request failed: connect() timed out!
Please solve and help me use it... I cant setup my own execution server..
In reply to Jhon Carlos

Re: VPL: How to run a graphical tkinter (Python) program

by Max Maff -

I have almost the same error. When I hit "Run" I get this after 6 sec of processing:

No execution server available: demojail.dis.ulpgc.es request failed: connect() timed out!


Seems strange. Please, say what additional info should I give to you to solve this. Thanks.

In reply to Max Maff

Re: VPL: How to run a graphical tkinter (Python) program

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Max Maff,

First I must ask to everyone that is going to report an issue that must give a full detailed report. Without all the information may be very difficult to spot the problem.

From your post, I see that you are using our demo jail server. The messages say that your Moodle server can connect with our demo jail server. Our demo jail server has been up and running for a long time then I only see two possible problems:

1) It may be some temporary network issue.

2) Your Moodle server is protected by a firewall that don't let it connects with the jail server.

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: VPL: How to run a graphical tkinter (Python) program

by Max Maff -

Hello Mr. Carlos,

Thank you for quick answer!

That's true about demo jail server. I've configured my own, but the problem is not about jail server.

I use proxy-server in Moodle. It works, because I can get updates over the web. One addition: proxy only accepts connections on 80 port (both directions). It rejects everything else, also 443.

Maybe, VPL module can't work through proxy?

I can give you a detailed report, but what should I include in it? I've done all steps from documentation of VPL white installing.

In reply to Max Maff

Re: VPL: How to run a graphical tkinter (Python) program

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Mr. Maff,
VPL uses cURL to connect to the execution (jail) server. VPL will use other port than 80 only if you use "https" or set explicitly a port in the URL to your jail server.
I assume you are not using a transparent proxy then, to manage proxy connections, you must use the OS environment vars: http_proxy and https_proxy.
Example:

export http_proxy=http://username:password@proxyserver.com:port/
export https_proxy=$http_proxy

Best regards.

P.D.: A detailed report may include:
versions of Moodle, VPL plugin, jail server, browser, OSs used, screenshots and how to replicate the error.


In reply to Max Maff

Re: VPL: How to run a graphical tkinter (Python) program

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

VPL uses WebSockets to connect the browser with the execution server. If your are using a proxy, it must be WebSocket compatible.
See
http://en.wikipedia.org/wiki/WebSocket#Proxy_traversal

In reply to Juan Carlos Rodríguez-del-Pino

Re: VPL: How to run a graphical tkinter (Python) program

by Max Maff -

Hello Mr. Carlos.

Thank you for the help!

I've done a little research and here's the results.

1. I've set up jail server in the same subnet as Moodle. I've used client computer from this subnet to access Moodle website. VPL works, I can run tests.

2. Same settings, but this time I've used my home computer and accessed Moodle website through the Internet. I've struggled with WebSockets problem. As I described above, we use proxy (Squid 2) for external access into internal network (where Moodle and jail servers located). And Squid doesn't allow WebSocket connections. So, I've got "Connection failed" error in browser's console. HTTPS also haven't solved the problem. And I can't change Squid settings. So, it's the end for this option for me (internal jail server).

3. I've switched back to http://demojail.dis.ulpgc.es

Same error: No execution server available: demojail.dis.ulpgc.es request failed: connect() timed out!

Seems like cURL methods in VPL classes don't use system proxy settings. When I SSH to Moodle server and execute #curl demojail.dis.ulpgc.es/OK - it works. But it doesn't when client clicks "Run" in their web browser. (I use tunnel for SSH)

I believe, I should explicity set proxy settings in VPL config files. Please, point me to the appropriate files.

Also, you can add proxy field into VPL settings in Moodle in next releases. The code may looks like this:

function curlFile($url,$proxy_ip,$proxy_port,$loginpassw){//$loginpassw = 'username:password';//$proxy_ip = '192.168.1.1';//$proxy_port = '12345';//$url = 'http://www.domain.com';

    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_HEADER,0);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
    curl_setopt($ch, CURLOPT_PROXYPORT, $proxy_port);
    curl_setopt($ch, CURLOPT_PROXYTYPE,'HTTP');
    curl_setopt($ch, CURLOPT_PROXY, $proxy_ip);
    curl_setopt($ch, CURLOPT_PROXYUSERPWD, $loginpassw);
    $data = curl_exec($ch);
    curl_close($ch);return $data;}
In reply to Max Maff

Re: VPL: How to run a graphical tkinter (Python) program

by Max Maff -

Solved with fix in /home/web/moodle/mod/vpl/jail/jailserver_manager.class.php

curl_setopt($ch, CURLOPT_PROXY, 'https://proxy:port/'); (line 42)

And using of external jail server, ofc.

In reply to Max Maff

Re: VPL: How to run a graphical tkinter (Python) program

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

I'll add a new options in the VPL configuration to set the proxy configuration .

Best regards and thanks for your solution.


In reply to Aivar Annamaa

Re: VPL: How to run a graphical tkinter (Python) program

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
yes, you can run almost any GUI(linux) program in jail and see and interact with it in Moodle. This feature is available from VPL 3.0, but still is not available by default to some programming languages as for Python.
Please, don't modify the $DISPLAY environment variable, it is handle by the jail system.
To run/debug a program as GUI (if not available by default) you need to write your own run/debug script. The difference of this script with the normal one is that the generated program must be called "vpl_wexecute".

The following script is ready to detect python+tkinter: #load common script and check programs
. common_script.sh
check_program python
cat common_script.sh > vpl_execution
echo "python $VPL_SUBFILE0" >>vpl_execution
chmod +x vpl_execution
grep -E "^from[\t ]*Tkinter[\t ]*import" $VPL_SUBFILE0 2>&1 >/dev/null
if [ "$?" -eq "0" ]    ; then
    mv vpl_execution vpl_wexecution
fi

Best regards.

Attachment Captura2.PNG
In reply to Juan Carlos Rodríguez-del-Pino

Re: VPL: How to run a graphical tkinter (Python) program

by Aivar Annamaa -

Great, it works! smile

Thanks!

In reply to Juan Carlos Rodríguez-del-Pino

Re: VPL: How to run a graphical tkinter (Python) program

by Smita Shrivastava -

Hi Juan Carlos,

Can you please let me know where we should add the above script in VPL? I have added a VPL activity in Moodle and included the above script as "vpl_wexecute.sh" in 'Execution Files' under 'Advanced Settings' but I still see the same error: "_tkinter.TclError: no display name and no $DISPLAY environment variable".

Thanks.



In reply to Smita Shrivastava

Re: VPL: How to run a graphical tkinter (Python) program

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Smita Shrivastava,
This is a bug that avoids detecting the use of GUI.
This problem will be resolved in the next release.  As a workaround, you can add to the source code a comment that contains "Tkinter", please keep the case of the letters.

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: VPL: How to run a graphical tkinter (Python) program

by Smita Shrivastava -
Hi Juan Carlos,

Thank you very much for your help! I was able to get the UI working.

Best
Smita
In reply to Juan Carlos Rodríguez-del-Pino

Re: VPL: How to run a graphical tkinter (Python) program

by Smita Shrivastava -

Hi Juan Carlos,

Is there a timeline for the next release of VPL where the GUI bugfix will be available?

Thanks

Smita

In reply to Smita Shrivastava

Re: VPL: How to run a graphical tkinter (Python) program

by Smita Shrivastava -

Hi Juan Carlos,

Sorry for writing again. I wanted to share with you what I'm trying to do in case there is a workaround before the next release of VPL comes out.

I am using the Python turtle module and I am trying to take user input from the console using the input() function. I am seeing this error at the line where the input() function is called: 'EOFError: EOF when reading a line'.
 
I am able to take user inputs when I am not using turtle functions in my code and I don't have Tkinter as a comment in the code. 
I am also able to use the turtle module without taking user inputs and I am able to see turtle output on the GUI. It is just that when I combine both (input from console and turtle output on GUI) that I see this error. In order to get the turtle output on the GUI, I have added #Tkinter as a comment.

I also tried moving the input() function before and after the turtle function call and I see the same error in both scenarios.

I wanted to find out if there is a script that I need to add to enable taking user inputs for turtle module in Python.

Would greatly appreciate your help and inputs.

Best regards
Smita Shrivastava

In reply to Smita Shrivastava

Re: VPL: How to run a graphical tkinter (Python) program

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

By default, VPL does not offer this feature. VPL does not allow console iteration when running Python with GUI.
If you want this behavior, you must set the following script at "advanced features->execution files->vpl_run.sh" file.

#!/bin/bash
# This file is part of VPL for Moodle - http://vpl.dis.ulpgc.es/
# Script for running Python language
# Copyright (C) 2014 onwards Juan Carlos Rodríguez-del-Pino
# License http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
# Author Juan Carlos Rodríguez-del-Pino <jcrodriguez@dis.ulpgc.es>

# @vpl_script_description Using python3 with the first file
# load common script and check programs
. common_script.sh
check_program python3
get_first_source_file py
cat common_script.sh > vpl_execution
echo "export TERM=ansi" >>vpl_execution
echo "python3 \"$FIRST_SOURCE_FILE\"" >>vpl_execution
chmod +x vpl_execution
mv vpl_execution console_execution
get_source_files py
check_program x-terminal-emulator xterm
cat common_script.sh > vpl_execution
echo "$PROGRAM -e ./console_execution" >> vpl_execution
echo "sleep 5s" >> vpl_execution
echo "wait_end console_execution" >> vpl_execution
mv vpl_execution vpl_wexecution

Best regards,

Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: VPL: How to run a graphical tkinter (Python) program

by Smita Shrivastava -

Hi Juan Carlos,

Thank you very much! I have added this script and I am now able to take user input and pass the input to turtle functions. I had a few more questions related to this -
1) In case of an error, I don't see an error message on the console anymore. Is there a way to enable this?
2) The UI closes immediately after the code is executed. I have currently added sleep() at the end of the code in order to see the output on the UI. Is there a way to make the UI stay a little longer so that the output could be observed without adding sleep().
3) Is there a way to set the screen size and location for the console as well as the UI?

I also had a question on the image formats that are supported -
4) I am trying to add a shape to the turtle using turtle.shape(imagename) and I am able to add .gif images but not other formats. Is there a restriction on the image format that could be used in VPL?

I also had a question on Input for Java programs -
5) I am doing a similar exercise in Java where I am taking user input and using it on the UI. For this I am currently using javax.swing.JOptionPane to take user inputs. Is there a similar script that I can use to take user inputs via console and use it for output on the UI?

Thank you again for your help!

Best Regards
Smita Shrivastava

In reply to Smita Shrivastava

Re: VPL: How to run a graphical tkinter (Python) program

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

I will try to answer your questions:
A1) You can add a "read" command to wait for the "return key"
echo "read"" >>vpl_execution
add after  "echo python3 ...
A2) I think that this issue about programming and not related to VPL or the custom script.
A3) Sorry, but I don't know.
A4) No. VPL manages as binary the image files with the following file extensions: gif, jpg, jpeg, png, ico. The use of these files programmatically is not related to VPL.
A5) No, I don't have a similar solution for Java. Notice that I have a specific script to resolve your problem with Python because a colleague had the same problem, and I wrote the script for him. We are planning to develop a global solution but not yet done.

best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: VPL: How to run a graphical tkinter (Python) program

by Smita Shrivastava -
Hi Juan Carlos,

I am able to get the UI working after adding the #Tkinter to the source code. I wanted to find out if there a way to hide this from the soure code by including this in any of the execution files. Can you please let me know?

Thank you very much for your help!

Best regards
Smita Shrivastava
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Jhon Carlos -

Sir,

My server is running good.. It returns "OK" on testing..


Now when i click on Evaluate or Run or Debug .. 

I get this :

Failed to construct 'WebSocket': The URL 'ws:///22442518253039/monitor' is invalid.

In reply to Jhon Carlos

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello, CSE Batch
I don't know why you get this message. Please, show me the URL that are you using to point to your execution (jail) server in the VPL general plugin configuration. It seems that you are using an empty URL and you must use a full URL.

Best regards.


In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Juwita W -

Hi, I have the same problem when I'm trying to run the code:

Failed WebSocket


For the execution jail, we made our own jail server. So the configuration in the VPL general plugin configuration is like this:

VPL general plugin configuration

There is no problem when using demojail, but it turn like this when we try using our own jail server. Hope you can help us. Thank you

In reply to Juwita W

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Juwita

The problem is that you must write, at execution server list, the URL to access the server, not only the IP or DNS name.

I must add code to detect this bad configuration and avoid problems to the users.

You must write
http://172.31.40.60

You must notice also that this IP belongs to a private net and therefore your jail server will not be reachable from internet.

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Juwita W -

It works perfectly! 

Thank you very much, Juan.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Jhon Carlos -

I have two questions :


1) How to automatically grade students ?


2) How to hide test cases from students ?

         i.e when they click evaluate, i don't want them to see the test cases.

In reply to Jhon Carlos

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello, CSE Batch
1) In a VPL activity go to "Setting -> Execution options" and activate "automatic grade"
2) At this moment if you activate the evaluation button to the students you can't hide the failed test cases to the students. We think that showing only the proposed grade or the final grade (if automatic evaluation is active) can be inadequate for the student. They may get a bad grade without explanation.
I want to notice that you can re-evaluate all the submission with one click, you can add/modify cases and re-evaluate in the submission list this will update the proposed grade and automatic grade if needed.

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Kevin Wiliarty -

Hello,

We are new to VPL and we are experiencing an interesting oddity. In a custom evaluation script ( written in Python) we have some code like this:

import inspect

import time

def comment(s):
    '''formats strings to create VPL comments'''
    print('Comment :=>> ' + s)

comment("Evaluation Time:" + str(time.strftime("%c")))

When the evaluation runs, the time shown is 4 hours ahead of our local time. Running the same code in a Python terminal on the jail server gives the correct current time, however.

The output to Moodle from an evaluation looks like this:

Reviewed on Tuesday, September 30, 2014, 2:25 PM by  Automatic grade
Grade 40 / 100
Assessment report
Evaluation Time:Tue Sep 30 18:25:03 2014

You can see the discrepancy between the "Reviewed on" time and the "Evaluation Time." We believe that the jail server has the correct time, and we are wondering if there is a configuration somewhere in the vpl that we need to adjust.

Any help would be appreciated.

In reply to Kevin Wiliarty

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Kevin,
From your bug report, I have been searching and, I think, I have located the problem. The issue is caused by the lack of the "localtime" file in the "etc" directory of the jail. In a few days I will release a new bug fix version of the jail that will resolve this and other problems.

Best regards.


In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Kevin Wiliarty -

That's great news. Thank you so much for attending to it. I'll keep an eye out for your fix.

Cheers!

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Jhon Carlos -
New look to VPL site... Nice work sir !!

All the best
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Jhon Carlos -

Hello sir,

I'm giving my students an program to calculate factorial using functions.

This is my requested file, which act as an template.

Requested files

factorial.c

    1 int factorial (int n)
    2 {
    3     //your code
    4     return fact;
    5 }
    6 
    7 int main()
    8 {
    9     //your code
   10     printf("%d! = %d",num,factorial(num));
   11     return 0;
   12 }

But if my student submits the program like this 


1 #include <stdio.h> 2 //int factorial (int n) 3 /*{ 4 return fact; 8 } */ 10 int main() 11 { 12 int num,i,fact=1; 13 scanf("%d",&num); 14 for(i=1;i<=num;i++) 15 fact=fact*i; 16 printf("%d! = %d",num,fact); 17 return 0; 18 }

he is getting full grade, but i don't want this to happen.

How to do that ?

In reply to Jhon Carlos

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello CSE Batch,
I am pleased seeing that you have finally managed that VPL run in your server.
The problem that you expose here is very interesting and the answer may be useful for many VPL users. The first thing we have to be aware is that If we use the default tester program of VPL, we only can test the response of the program to any input but no how the response has been achieved. The first solution to your problem is that the teacher do a slight revision. This is bad news but not entirely. If we make the proper exercise we can get what we want. To facilitate the automatic evaluation of a exercise it is preferable that every requested element may be checked separately, if necessary we must divide the exercise in various parts.

In your case you can separate the "factorial" function from the "main". To test the factorial we can generate an activity that request the funtion in a file "factorial.c" without main (only the factorial function) we add to the "execution files" of the activity a file main.c with the main.  To check the main do the inverse.

A more complex way, but better is doing your own "vpl_run.sh", this way you can fine control the execution and the interface that the student generate.

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Jhon Carlos -
Hello Juan and yeah , Thanks ..


1) what is the use and purpose of 'vpl_run.sh' ?

2) Also, consider if I give my students an program to find the length of string without using string.h, how could I check if they have done it correctly or not ? ( such type of questions are too help full ) 



In reply to Jhon Carlos

Re: New Virtual Programming Lab (VPL) module

by Jhon Carlos -
and also,

how could i clear the submission list ?

In reply to Jhon Carlos

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

The module does not have a specific feature to "clean" the submission list. But you can "duplicate" the activity, getting an equal, but without  submissions.


Attachment Captura.PNG
In reply to Jhon Carlos

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
1) This is copied from http://vpl.dis.ulpgc.es/index.php/en/support
----------------------------
Creating scripts
The scripts for running/debugging and evaluation is a powerful tool for the creation of activities tailored to specific needs and using automated test mechanism different from the default. A simple way to start a own script is to take the default script for the language used as the start point. The default scripts are located in "/mod/vpl/jail/default_scripts/".

The purpose of the script is to compile or prepare the implementation of the action requested run/debug/evaluate. If the script succeed it will generate an executable file called vpl_execution to be run on a textual console or vpl_wexecution for execution in a graphics console.
---------------------------
default vpl_run.sh for C
---------------------------------------------------------------------------------------
#!/bin/bash
# Default C language run script for VPL
# Copyright (C) 2014 Juan Carlos Rodríguez-del-Pino
# License http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
# Author Juan Carlos Rodríguez-del-Pino <jcrodriguez@dis.ulpgc.es>

#load common script and check programs
. common_script.sh
check_program gcc
get_source_files c
#compile
gcc -o vpl_execution -std=c99 $SOURCE_FILES -lm -lutil
---------------------------------------------------------------------------------------
2) You can do almost anything programmatically to check the student code, but the effort may be high, the cost you pay is the time you expend to do an appropriate shell script.
For example: in vpl_run.sh before compile the program you can test if the student has write strcpy in its code by using "grep"

grep -e strcpy $SOURCE_FILES 2&>1 1> /dev/null
if [ "$?" == "0" ] ; then
     echo "Error: the use of strcpy is forbidden"
else
     gcc -o vpl_execution -std=c99 $SOURCE_FILES -lm -lutil
fi
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Alberto Lopes -

Hello, Prof. Juan Carlos and VPL developers.

I am trying to install VPL on a Debian machine. However, my SSH connection dropped while the jail install script was still executing. When I logged in again, and tried to re-execute the script, I got messages like this:

/etc/init.d/vpl-jail-system: line 73: /jail/etc/group: Read-only file system
chmod: changing permissions of `/jail/etc/group': Read-only file system
chmod: changing permissions of `/jail/etc/ld.so.conf': Read-only file system
chmod: changing permissions of `/jail/etc/ld.so.cache': Read-only file system
mount: warning: /jail/etc/ConsoleKit seems to be mounted read-only.
[FAIL] Can't mkdir /jail/etc/ImageMagick ... failed!

What can I do to fix that? Is there a easy way to unroll all the changes the install script made so far to my system?

By the way, where can I find uninstall information for both the VPL moodle plugin and the jail server?


Thank you.

In reply to Alberto Lopes

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Alberto,
Sorry, I have never test the installation of the vpl-jail-system in a Debian machine, but some people has reported a success in this task.
The problem that you show is due to a fail in the service script (it isn't smart enough). Please, clean the "/jail" dir, by hand, and try again.
I will try modify this script to improve the way that it reacts to this cases.

To uninstall the jail system you can use the "uninstall" script that came with the distribution. To uninstall the VPL plugin follows the indications  to uninstall any plugin in www.moodle.org.

Best regards.


In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Alberto Lopes -
Does the script do something to the mount points of the filesystem?

I suspect that because now I cannot delete the /jail directory or even touch a test file:

root@transfer:~# rm -Rf /jail
rm: cannot remove `/jail/etc/passwd': Read-only file system
rm: cannot remove `/jail/etc/group': Read-only file system
rm: cannot remove `/jail/etc/ld.so.conf': Read-only file system
rm: cannot remove `/jail/etc/ConsoleKit': Read-only file system
rm: cannot remove `/jail/etc/ld.so.cache': Read-only file system
root@transfer:~# cd
root@transfer:~# touch test
touch: cannot touch `test': Read-only file system

Thanks for your support.

In reply to Alberto Lopes

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

The vpl-jail-system try to simulate in "/jail" a new full filesystem but almost read only and without suid files. The script that start/stop the service is the responsible of mounting and unmounting replicas of the main directories of the real filesystem.

If the script fail it is common to find mounted dir under "/jail", but it's not common to have the full file system readonly.

I have installed vpl_jail_system-2.0.2 into a clean Debian 7.6 64bits (running in a virtual machine). The installation go after introducing the Debian CD-1 instalation disk (if not the installation was stalled asking it with no message) . I have found that some packages are missing from Ubuntu to Debian, for example: firefox must be changed by Iceweasel. Despite of all this the vpl_jail_system compiled and run without mayor problems.

The system you are are using is full dedicated server (may be virtualized) or some kind of virtual private server shared?

I don't know if the vpl_jail_service can run in this type of systems.

Best regards.

In reply to Alberto Lopes

Re: New Virtual Programming Lab (VPL) module

by Juan Cruz Martinez Luquez -

Hi Alberto,

I had the same issue trying to install VPL Jail system on an OpenVZ container (managed by Proxmox VE). I can not give you a solution because I decided to install the Jail system on a fresh installed Ubuntu using KVM instead of a container.

Regards!

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Rafael Pinto -

Is it possible to put automatic constraints on the submitted code?

For instance, I have an introductory exercise where the student must code in PHP to assign the value 100 to some variable, add 20 to it and then show the result. I'd like to force the student to code all those steps instead of just using "echo 120" to get the correct output. Just checking for the presence of the strings "<?php", "?>", "100", "20", "+",  "=", "$", ";" and "echo" would be enough for me (but it would be still better if I could also check for the absence of a "120" string too).

In reply to Rafael Pinto

Re: New Virtual Programming Lab (VPL) module

by Rafael Pinto -
SOLVED.
Just edited vpl_run.sh for the specific VPL according to a previous answer I found here, with minor modifications:
#!/bin/bash
# $Id: php_run.sh,v 1.3 2012-09-24 15:13:21 juanca Exp $
# Default PHP language run script for VPL
# Copyright (C) 2012 Juan Carlos Rodríguez-del-Pino
# License http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
# Author Juan Carlos Rodríguez-del-Pino <jcrodriguez@dis.ulpgc.es>
#load common script and check programs
. common_script.sh
check_program php5
grep -q -e 120 $VPL_SUBFILE0 2&>1
if [ "$?" == "0" ] ; then
     echo "Error: you are not allowed to output the result directly"
else
    cat common_script.sh > vpl_execution
    echo "php5 -n -f $VPL_SUBFILE0" >>vpl_execution
    chmod +x vpl_execution
fi
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Rafael Pinto -

Could you provide a PHP example for adding 2 numbers along with the test cases? I don't seem to be able to get PHP to work with stdin inputs. For instance, $a = fgets(STDIN); will block and give a timeout error, as if no data was passed to STDIN.

In reply to Rafael Pinto

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Rafael,

I have tested this case:

--------------------

case = 1
input = 7
13
output = 20

--------------------

without problem.

PHP example:

--------------------

<?php
$a = fgets(STDIN);
$b = fgets(STDIN);
echo $a+$b;
--------------------

Please provide your test cases to try to reproduce your problem.


In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Rafael Pinto -
Thank you very much, Juan.

My test cases:
    1 case = Test 1
    2 input = 1
    3 output = "foi 1"
    4 case = Test 2
    5 input = 2
    6 output = "foi 2"
My code:
<?php
$a = fgets(STDIN);
echo "foi $a";
?>
I tried your example for adding two numbers too, and it also timeouts. Maybe it is some server misconfiguration? Can you think of any reason for it to fail to send the input data to my php program?
In reply to Rafael Pinto

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

I have been unable to reproduce your problem.

what versión of VPL plugin and execution server are you using?

To know if the problem is a bug, the activity setting or your installation, please:

1) test your activity in http://demovpl.dis.ulpgc.es/moodle

2) Use http://demojail.dis.ulpgc.es as execution server

Your cases are almost correct. But you must be aware that if you use "input = 1", the space after the "=" will be send as part of the input. The result of fgets() is of type string and then in your code $a contents " 1". If you use "output="foi 1""(exact match) then your code will not pass the test.


Best regards


In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Rafael Pinto -

VPL 3.1 with jail server 2.0.2

I've tried your example again but instead of clicking 'Run', I clicked 'Evaluate' and it works. The 'Run' option still gives me a timeout (not a big deal). But if I run your example with 2 identical test cases (or any other test cases), 'Evaluate' gives me a timeout again.

case = 1
input = 7
13
output = 20
case = 2
input = 7
13
output = 20

The same applies to any tests set (my previous example works with 1 test case too). IOW, it is working only for evaluation AND if my test set has only 1 test case.

Also, I'm on linux. Any chance I'm pasting some '\n' and VPL expects a '\r\n' to split test cases?

In reply to Rafael Pinto

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

It seems your are using adequate versions of VPL and of the jail server.

More questions:

3) What OS uses your Jail server?

4) What Browser are you using?

I don't know if you have tested the demovpl and demojail.

I would like to see the messages you get.


I attach screenshots of what I get in demovpl using your cases and code


Attachment Captura.PNG
Attachment Captura1.PNG
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Garry Gardiner -

Hello There,

I have just installed VPL for our Computing department to use, there is one slight snag. I have been asked if we can have python 3.4 on it instead of 2.7.

I am sorry if I am being dense, but how can I achieve this?

Thank you

In reply to Garry Gardiner

Re: New Virtual Programming Lab (VPL) module

by Michael Jones -

Hi Garry

I asked this question a while back - the guy who created the plug-in provided this advice:

Dear Jones,


You only need to update your jail server NOT your Moodle server. In the case that your Moodle server and jail server are the same (not recommend) Python3 normally (Ubuntu for example) do NOT interfere with Python2 you must explicitly call the interpreter with "python3" and Python2 is still the default.

best regards

 
Mike


In reply to Michael Jones

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Garry and Michael ,

¿How the python execution works? (by default)

1. The system select a default script to run the code (submission files) based on the files extension

2. For ".py" the system uses vpl/jail/default_scripts/python_run.sh. This script uses command "python" as interpreter.

3. The summision files and this script is send to the execution server.

4. Compilation phase: the script is run generating "vpl_execution".

5. Execution phase: "vpl_execution" is run


If you want to run python3:

1) Install python3 in your jail/execution server

2) Make one or more of the following steps

2.1) Change your default python interpreter in your jail/execution server

2.2) Change your file "vpl/jail/default_scripts/python_run.sh" in your moodle to generate a vpl_execution that use python3 as interpreter

2.3) Modify python_run.sh as described in 2.2 but save it to vpl_run.sh of your VPL activity. This activity will use vpl_run.sh instead of the"vpl/jail/default_scripts/python_run.sh"

2.4) Create a new activity called "base python3" follow step 2.3 and then uses this activity as "based on" in "execution options" in all the activities that you want to use python3. You only need to write the script one time in the "base python3" activity. Activity "base python3" acts as template of other activities then It is better to hide this activity to students.


Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Jhon Carlos -
Hey Juan,

thankz for all your help..


Well now i need suggestions.. I'm planning to conduct an programming contest n my college using VPL...


Please give me some tips and suggestions for setting up moodle and vpl at its best for coding contest !!

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Jhon Carlos -
Hey Juan,

thankz for all your help..


Well now i need suggestions.. I'm planning to conduct an programming contest n my college using VPL...


Please give me some tips and suggestions for setting up moodle and vpl at its best for coding contest !!

In reply to Juan Carlos Rodríguez-del-Pino

jail server installation on shared web hosting

by Awadhesh Srivastava -

Can I install jail server on shared hosting (Hostgator shared web hosting). If yes then would it be same steps as mentioned on your site?

In reply to Awadhesh Srivastava

Re: jail server installation on shared web hosting

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

I think that you can't.
You need a server where you should have the privileges to install the new linux service as root, install the compilers/interpreters and use the new service as a non shared resource.

Best regards


In reply to Juan Carlos Rodríguez-del-Pino

VPL c++ compiler problems

by Theresa Wilson -

Hello - We are hoping to use vpl in our data structures class, but I am having trouble getting c++ submissions to compile on the jail server.

Here is what I have in vpl_run.sh

#!/bin/sh
g++ -Wall -o vpl_execution *.cpp

 

Every time I try to run a cpp submission, I get the following compiler error:

g++: error trying to exec 'cc1plus': execvp: No such file or directory

 

I've been investigating and exploring on the jail server, and experimenting with python submissions to compile g++ programs, and I've finally run out of ideas.

Essentially, any time the g++ in /jail/bin is used to compile, the above error is produced. But /jail/bin/g++ is an exact copy of /bin/g++, correct? And /bin/g++ never produces this error.

My best guess is that something is off in the configuration of the jail server. That something isn't getting copied over when the jail server is started that needs to be copied over.

That, however, is as far as I got. Suggestions?

In reply to Theresa Wilson

Re: VPL c++ compiler problems

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Theresa,
I am trying to replicate your problem with jail server 2.0.2 in Ubuntu 14.04 and VPL module 3.1
First, your script in "vpl_run.sh" is correct. It compile without problem a simple "Hello world" in C++. You can also point your VPL activity to http://demojail.dis.ulpgc.es and check it.
I have tested the activity with the lowest settable resource value without succes (no problem).
After googling a while, I think:
1) Your g++ installation is broken (but you tell me that run ok out of the jail)
2) The script, part of the deamon that replicates the filesystem in the jail, don't replicates something needed. What OS version are you using in your jail server?
Please, tell me the details of your execution enviroment to have more information.
1) Jail server version
2) Jail server OS version, hardware limits.
3) VPL module version

Best regards.
Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

Jail Server Problems

by Charlie Daly -


Hi Juan,

this looks really nice. I have been installing this using docker containers. Moodle and the module seem to work properly. When I use your test jail server, everything works. However, when I use my jail server (installed on docker), then when I attempt to run a program under test, I get the following message:

"Jail error: I can't execve: /home/p16708/vpl_run.sh (No such file or directory)"

I have tried installing two versions of the software:

vpl-jail-system-2.1.0.tar.gz and vpl-jail-system-2.0.3.tar.gz

Both versions fail with the same message.

I have tried this with both Java and Python exercises.

I am hoping you can help. Thank you very much,

Charlie

In reply to Charlie Daly

Re: Jail Server Problems

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Charlie,
the solution suggested by Aivar seems very good at this moment.
I haven't tested the vpl jail daemon as a Docker container. When I have spare time I' ll test it and I will say something about it.
Best regards.
Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: Ace editor

by Ankit Ramtriya -

I am developing a moodle plug-in so how do I integrate ace editor in my moodle plug-in.

In reply to Ankit Ramtriya

Re: Ace editor

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

You are going to need to provide more information 

In reply to Marcus Green

Re: Ace editor

by Ankit Ramtriya -

I'm developing a plugin for moodle. this plug-in uses the ace editor for editing the code.so i need help that how can i use the ace editor in my plugin.

In reply to Juan Carlos Rodríguez-del-Pino

Re: Jail Server Problems

by Charlie Daly -


Hi Juan,

I gave up on Docker and am using normal virtual machines and everything is working very nicely. VPL is a very impressive piece of work.


Thank You,

Charlie

In reply to Charlie Daly

Re: Jail Server Problems

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Thanks Charlie,

I have tested VPL jail server on Docker and I found some incompatibilities that make impossible to use it. The main problem is that apparently Docker don't let to mount part of the file system to mimic the actual one (thing that VPL needs). One way to resolve this problem is to remove the chroot from the VPL jail server and work with file system under the Docker control. The problem is that this needs time to be programed and to learn more about the security implications of this change.


Best regards,

Juan Carlos


In reply to Juan Carlos Rodríguez-del-Pino

Re: Jail Server Problems

by Regis Smith -

It may be possible to get the jail server running in an LXC container.  I was able to get it installed and running, as shown here:

.  (The boot sequence ends at 2:22.)  However, I have not yet tested it with Moodle.  I'll give it a try over the weekend and report back.


In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Dipanjan Chakraborty -

Hi,

Can you please confirm if Moodle version 2.8 is supported?

In reply to Dipanjan Chakraborty

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Dipanjan,
I haven't tested VPL 3.1 on Moodle 2.8, but the release notes of Moodle 2.8 indicates that VPL 3.1 must run on this release. Beware that VPL 3.1 don't supports some new features of 2.7 and 2.8, specifically the new logging system (track of user actions) . See VPL 3.1 release notes. The lack of this features do not limit normal use of VPL. The next release of VPL will resolve this issues.
Best regards.
Juan Carlos Rodríguez

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Kevin Wiliarty -

Hello,

I support an instructor who has a package of assignment evaluation files that she cannot currently use in the VPL because there are more than 100 of them. I can see in the code (forms/executionfiles.php) that there is a hard-coded limit of 100 execution files. I would be tempted to bump this for her, but wondered if you think there might be undesired consequences. If not, would it be a welcome change to add an admin setting? I could code it up and file a pull request on github.

Thanks for the great plugin!

In reply to Kevin Wiliarty

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Kevin,
You can increase that limit, VPL 3.1 don't have other big limitations. The only problem will be that you will get an editor with so many files opened that will be difficult to manage. The file editor of VPL 3.1 is not thought for manage so many open files.
There is a workaround that can help you with task of sending so large number of files to the execution server:
1) Package your files  (tar, zip, gz) eg. pack.zip
2) Encode your file to base64 format
3) Rename your encode file to pack.zip.b64
4) Add the file to your activity (import or copy/paste)
5) Add code to your (run, debug,evaluate) script to uncompress your pack.zip before use.
Beware that the system will decode from base64 any file with extensión ".b64" (and remove the .b64 extensión)

The next VPL 3.2 will resolve this problem with an editor ready to handle a large number of file (including images and other binary files).

I attach images of the new editor in action

Best regards.


Attachment Captura.JPG
Attachment Captura1.JPG
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Kevin Wiliarty -

Many, many thanks for the speedy and helpful reply! You have given me both immediate solutions and things to look forward to smile

In reply to Juan Carlos Rodríguez-del-Pino

VPL: Batch evaluation vs. single submission evaluation

by Aivar Annamaa -

Hi Carlos!

Sometimes I change VPL tests after the students have submitted their solutions and I try to reevaluate all submissions. With Java tasks, this process seems to iterate over all submissions, but when I check later, some submissions still show the previous evaluation result. When I evaluate those manually, everything goes fine.

I made a small test -- when my vpl_evaluate.sh is

#!/bin/bash

printf '#!/bin/bash\n' > vpl_execution
printf '. vpl_environment.sh\n' >> vpl_execution
printf 'echo "Grade :=>> 1000"\n' >> vpl_execution

chmod +x vpl_execution

then batch mode updates all grades.

But when I add java compilation:

#!/bin/bash

# compilation
PATH=$PATH:/usr/local/bin
javac -d . -encoding UTF-8 -cp .:/usr/share/java/akt/* *.java


printf '#!/bin/bash\n' > vpl_execution
printf '. vpl_environment.sh\n' >> vpl_execution
printf 'echo "Grade :=>> 1000"\n' >> vpl_execution

chmod +x vpl_execution

then some submissions are skipped. When I run the batch several times, then finally all grades will be updated, but it takes quite long time.

What could be the problem here? Is there a time limit for running vpl_evaluate.sh?


In reply to Aivar Annamaa

Re: VPL: Batch evaluation vs. single submission evaluation

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Aivaar,
Thanks for your bug report and for your code to reproduce the problem.
How many students are you using?
What VPL version is showing this problem?

I will try to find and resolve this problem as soon as possible.

Best regards,
Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: VPL: Batch evaluation vs. single submission evaluation

by Aivar Annamaa -

Actually, it turns out I can't reproduce this situation even myself -- I tried again the script that only echos constant grade and this time it didn't work for half of the students. Then I tried it again (with different constant to see where the grade was changed), and now all 45 students got updated. So it's very unpredictable. 

I did see connection error message 3 times during the batch processing, but it seems that those students were the ones who did get updated.

My Moodle Plugin version shows 3.1.1, but I think it was installed last year, not after 20th of Feb this year (http://vpl.dis.ulpgc.es/index.php/home/news/73-release-of-vpl311). So maybe I have old version.

Github says there is a branch called v3.1.2 -- can you predict when this will be released? If soon, then I'd rather wait for this version.

What about v3.2? Are there any new features coming?


In reply to Aivar Annamaa

Re: VPL: Batch evaluation vs. single submission evaluation

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Aivar,
Our release planning is as follow:

  • v3.1.2 (Will be released in a few weeks)
  • Adds settings to use proy from Moodle server to execution server.
  • Adds settings to use ws or wss under administrator control
  • Adds HTML similarity support
  • I will also  try to resolve the problem you reported


  • Release V3.2  (Will be released in next months)
  • Adds support for binary files: images, zip, jar.
  • The editor adds support for files drag and drop
  • The editor adds support for .zip decompression
  • The editor changes to handle editions of hundreds of files
  • The submission view will highlight more languages
  • Update of Ace editor and noVNC client
  • Default script for php server.


Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Edgar Merino -

Estimado Juan Carlos,

Instalè ya el servidor y el mòdulo vpl 3.1.1 en MOODle 2.8, y ya me servìa sin problemas, no se que pasò pero ya no recibo respuesta del servidor haber si me puede ayudar, de antemano el documento con las imàgenes esta en drive, gracias.


https://drive.google.com/file/d/0B9YV0wL2GLQAOUc3bEdjTHB2M2c/view?usp=sharing


In reply to Edgar Merino

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Edgar,
I have seen your pdf and I have found that your problem is that your vpl-jail-system is using a private network IP. You can use this type of IP but this limits the use of the system to networks that have access to the private one (commonly only the same private network).
Notice that from the VPL 3.0, the jail-system require a public IP.
I also have seen that you are using an old version of VPL jail system. It may be better that you upgrade your installation to VPL jail execution system 2.1
http://vpl.dis.ulpgc.es/releases/vpl-jail-system-2.1.0.tar.gz

Best regards.

P.D.. He respondido en inglés porque el foro es en inglés. Saludos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
The development team of VPL for Moodle is conducting a survey about possible improvements of VPL.  This survey will take you less than 5 minutes. By filling this survey, you are helping the evolution of VPL in the best way.

Thanks for your participation
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Sonja Sperber -

Hi Juan Carlos,


we want to offer C - programming courses on our moodle plattform.

The students should be able to paste short C-Programs in a web editor

and be a able to compile it, update the source code etc.

So VPL seems to be a very good plugin. In order to achieve the

interactive programming tool like mentioned before I think one must 

install the moodle plugin as well as the execution server right ?

I could install the plugin without probs. Whe I tried to install execution server

like explained here:

http://vpl.dis.ulpgc.es/index.php/support/2014-09-27-15-06-22/40-how-to-install-vpl-jail-system

i ran into probs. When I ran  ./install-vpl-sh he ask me to remove apache, which I denied.

The installation process stopped but the deamon could not be started.      

Can you help me here to get the execution-server run ... ?


Moreover, is there step - by - step description that describes

the interplay between moodle plugin and Execution server, i.e. 

the configurations necessary to have an interactive programming tool

in Moodle ?

Thanks for your help!


Best regards,


Sonja


 


     

In reply to Sonja Sperber

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Sonja,

By default the execution service is ready to run using ports 80 and 443. These ports are normally used by the web servers. If you are using apache (or web server) in this ports then change the configuration of the vpl-jail-server in order to use another unused ports (remember to change appropriately the URL to reach the service).
http://vpl.dis.ulpgc.es/index.php/support/2014-09-27-15-06-22/66-execution-server-configuration

Nevertheless, I must notice that it is very risky to use apache and the vpl-jail-server in the same machine. I think that the security could be a problem, but I am sure that the execution of external code can consume CPU (eg an infinite loop) and degrade the response rate of the web server.

I will try to brief you about the required connections of the vpl-jail-server daemon.
This daemon is charge of managing the execution of the code. The source files come from the moodle server as a XMLRPC request by http or https. When the code is running, the server also requires communication with the user's browser by Websocket technology (ws: or wsssmile.

Bets regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

If you don't have the possibility of use another dedicated machine as "execution (jail) server", you might use a virtualization software, as VirtualBox, to install there the "execution server". This solution is very versatile because you can easily set the limits of the resources dedicated to the "execution server", mainly CPUs and memory and also you get a more secure configuration.

By the way, I take this post to kindly ask all users of VPL to respond to the survey that we are conducting. It is about the use of VPL and possible improvements and it will take you less than 5 minutes. By filling this survey, you are helping the evolution of VPL in the best way.

https://docs.google.com/forms/d/1GWIkSi30DQVOAda7L0OvdB-mX6XvHUN53-t255Caq4U/viewform

Many thanks for considering my request.

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

How to make hidden test cases

by Sri Ram Manoj Kambhampati -

Hello Juan Carlos

VPL is a good plugin to integrate programming based assignments into moodle. However, VPL doesn't seem to have a mechanism to hide the test cases that are failed. VPL is displaying the input and output of the test case for which the evaluation of the source code failed. At the time of examination, it is highly necessary not to disclose the test cases that have failed to evaluate. How do I deal with it. Do I need to make changes in the "vpl_evaluate.sh" file? If so, how can I do it?


Thanks

Sri Ram Manoj K

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by rohit katariya -
I am installing vpl and moodle.
I have 2 ubuntu cloud VMs.
The installation page says we will need to install virtual box(which according to my understanding is required to run jail server and moodle on same machine).

But in my case, as I have 2 separate machines, I would not require installation of virtual box.

Am I right? would like to confirm before proceeding.
In reply to rohit katariya

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Rohit,
If you have 2 machines then you don't need to use VirtualBox or another lightweight hypervisor.

The documentation that you refer here, is good but not the official one.

Best regards.

http://vpl.dis.ulpgc.es

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by rohit katariya -

Sir,

I was able to install jail server and moodle and they are communicating among them required, thanks for your help.

This is when I am logged in from my moodle server macahine itself.

I am struck at this error

Incorrect access detected, this server may be accessed only through "http://172.16.2.74/moodle" address, sorry.
Please notify server administrator.
This page should automatically redirect. If nothing is happening please use the continue link below.
Continue

172.16.2.74 is the private ip within the network of the VM.I have a public ip(within the academic network) in range 10.237.x.x  assigned to the machine. when I change the ip in var/www/html/moodle/conf.php, I am able to get moodle running without the above error but after this, I am unable to compile vpl actiivity as when I try to do this the moodle is not able to communicate to jail server(connection fail error).

Please suggest a sollution.

In reply to rohit katariya

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hello Rohit,
the moodle message is saying that the IP/name you use to reach the Moodle server is not the same that the server has in "config.php".
Your server has more than one IP?
Are you using NAT inside the private network?
Beware that any 10.237.x.x IP is private.
If you want to use Moodle+VPL from internet, both your Moodle server and jail server must have a public IP.
Beware that PRIVATE IPs are all the following ranges: 10.x.x.x, 172.16.x.x-172.31.x.x and 192.168.x.x.
more detail at http://en.wikipedia.org/wiki/Private_network

If you want a better response, please describe in detail the networks of your machines.

Best regards
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by rohit katariya -
yes sir I have 2 IPs.
The moodle is to run in our college campus intranet which has ip in range 10.x.x.x. For this I have been allotted 2 virtual machines one for installing moodle and other for execution server. yes these interface through NAT and have IPs in range 172.x.x.x. The above machine on which moodle is being installed has 2 IPs one is private ip in range 172.x.x.x and other in range 10.x.x.x which I am calling public(only in campus).
My jail server doesn't have a public ip, but it has private ip in the same range as the private ip of the moodle server. Will still require a public ip for the jail server?
In reply to rohit katariya

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

The Moodle server and the jail server (both) MUST be reachable from the clients. The system will not work if you use a network architecture that allow only to the Moodle server connect to the jail server.
I think you have two easy options here:
1) take out of the NAT net your Moodle and jail machines, and uses 10.x.x.x IPs
2) Use NAT forwarding to access to your Moodle and jail server inside your 172.x.x.x net. You will use the exposed IP outside your NAT (one IP in 10.x.x.x) but your real IP inside your NAT will be one for moodle and one for the jail server in the net 127.x.x.x.
2.a) you must config your jail server to use ports different than Moodle (e.g. 8000 and 9000)
2.b) you must config the VPL plugin (module) to use as URL of jail service the exposed IP+port (e.g.  http://10.1.1.1:8000)
2.c) you must configure your NAT to forwarding ports 8000 and 9000 to your jail server ip and port (e.g. 172.1.1.100)
2.d) Remember to set in your config.php your exposed IP.

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by rohit katariya -

Sir, I don't have the access to NAT box that the VMs use. can I do NAT forwarding from the machine with public IP  without need of an access to nat box.


is this what i am looking for ? Local Port Forwarding

In reply to rohit katariya

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Sorry, but I think that no. That is for use with SSH and not at net level.

I am not an expert, but If your Moodle server has two IP, one at 10.x.x.x net and other at 172.x.x.x.x, then iptables at your Moodle server may be your solution. Using iptables for port forwarding will becomes your Moodle server into a NAT box. I don't know the load issues that can arise with this configuration.

I must say that I am not an expert configuring iptables.
Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by rohit katariya -

sir,

is it possible to have more than one questions in an activity or to group several activities together?

I am trying to create a programming test which will have around 5-10 questions for which these questions should appear as a group. 

Is there an option in which student cannot change the code given by the instructor and only fill in the required portion of the code.

Also is there an option to give sample test cases for students so that he sees only the correct output of the sample test cases when he presses evaluate.

In reply to rohit katariya

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Q. is it possible to have more than one questions in an activity or to group several activities together? I am trying to create a programming test which will have around 5-10 questions for which these questions should appear as a group.
A. No. VPL allows to create activities but not groups of activities. You can create a "Grade category".

Q. Is there an option in which student cannot change the code given by the instructor and only fill in the required portion of the code.
A. No. At this moment you can't.

Q. Also is there an option to give sample test cases for students so that he sees only the correct output of the sample test cases when he presses evaluate.
A. No. but you can see similar question and answer at this forum.

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by rohit katariya -

Sir,

Thank you for your response.

I will need to make a lot of changes to gui according to my needs and would like to combine it with quiz module so that I can create a test like environment.

So, I was wondering if I can build a similar module myself according to my needs and use your execution server at the back-end. It would be helpful if you could share the api which I can use for communication between your execution server and the new module.

In reply to rohit katariya

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

I will share the API of the execution server, but there is no document and at this moment. I can't dedicate time to write one. The API is really inside the code. I hope to get enough time, after the summer, to generate the document.

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Navigation Panel Missing from a VPL Activity

by Sri Ram Manoj Kambhampati -
I've ran into the trouble of missing navigation pane from vpl activities on moodle 2.8.5. I'm hosting moodle on my laptop with XAMPP. The version of my VPL Plugin is 3.1.2.

THe console of the web browser doesn't display anything.

I've made an attachment of how the activity it is looking.



Thanks

Sri Ram Manoj K

Attachment Screen Shot 2015-06-18 at 01.37.56 copy.png
In reply to Sri Ram Manoj Kambhampati

Re: Navigation Panel Missing from a VPL Activity

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Sri Ram Manoj Kambhampati,
I need more information to spot the problem, I haven't been able to reproduce it on Moodle 2.8.6 (the 2.8 version that is available). If you are so kind to send me a backup of the problematic activity, I will restore it at my Moodle and it will be easier to reproduce the problem. A file with the HTML that your browser receive will also help.

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Andrea Pruccoli -
Hi Juan.

I have created several VPL activities to run python programs, and all works fine (running, debugging, evalutaion).
But I have encountered odd conducts for what concernes submissions and grades assignment.

1) When student is editing his file, when he saves the file, by teacher side I can see that a submission has been added to the "Submissions list" section, and by clicking on it, the teacher can grade the file.
This happens every time a student saves his file. Is this normal? Can I prevent the student from doing a submission anytime he saves the file he is editing?

2) I've set the option "Maximum number of files" at 1, and after a student submits a file from the "Submission" section, by teacher side I see the submission. If the student tries to submit another file, by student side the submission succeeds, even though by teacher side I don't see the submission in the "Submissions list". But if the student modifies the file from the "Edit" section and saves it, as the point above. Then he is able to submit another file from the "Submission" section. Can I prevent the student from avoiding the "Maximum number of files" restriction? Moreover, shouldn't the student not be able to edit and save a file after he has submitted a file if I set the "Maximum number of files" at 1?

3) After a teacher evaluates and grades a submission of a student, the student can edit and save the file, and this create another submission (as pointed at point 1). But shouldn't the student not be able to edit and save a file after the teacher has graded his submission?

Thanks in advance,
Andrea
In reply to Andrea Pruccoli

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Andrea,
At this moment (v3.1.2) the way that VPL works is
1) The student can save all the versions they want until the due date.
2) The last version is the one that will be assessed by the teacher.
3) If the due date of the activity has not been reached then student can resubmit again the work, evaluated or not.

I will try now to answer every question
A1) This behavior is normal. VPL lacks of the concept of draft or final submission.
A2) The "Maximum number of files" is maximum number of files the student can upload every time.  If you don't want to keep all the versions you can change it at the plugin setting.
A3) Yes, the student can resubmit again the work. Really this is a bad behavior of VPL. We will change this in the next release.

All these questions are related to the expectation that VPL would have a similar behavior to the assignment module (task). We are asking help to the users of VPL to guide its development by answering a survey. We have asked about these features in the first question. You can find the survey at
https://docs.google.com/forms/d/1GWIkSi30DQVOAda7L0OvdB-mX6XvHUN53-t255Caq4U/viewform

We are sure that the way that VPL is used may be improved.

Best regards.

Juan Carlos
P.D.: If you find other odd behavior, please ask again.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Andrea Pruccoli -

Thanks for the fast reply, I'm looking forward the new release.


Best regards,

Andrea

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Andrea Pruccoli -

Hi again,

can VPL module work with the File System of the machine where I am (me working like a Student)?

If yes, is the interaction discouraged?


Best regards,


Andrea

In reply to Andrea Pruccoli

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Andrea,
every execution is run by a transient user with limits, e.g. the size of every file. When the execution is finished, the users data is cleaned.
The programs/users can work with files and directories but nothing remains.

Best regards.
Juan Carlos.


In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Andrea Pruccoli -

Hi Juan,

thanks for the reply.

I have another question. I tried to execute some sql queries, but I've found that the tables I create with a sql file are deleted when the execution is finished, just as you said.

However, on the demo site I saw that there is a default table, and I too want to create a default table that can be seen by the students during their execution, but I can't figure out how to do so.

So how can I achieve this?


Waiting for your reply, best regards,


Andrea.

In reply to Andrea Pruccoli

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Andrea,
this is an undocumented feature of the SQL default script.
how the default SQL script works?
1) sqlite 3 is the database engine that we use
2) "vpl.db" is the file that keeps the database
3) The script run all the ".sql" files defined in the "execution files"
4) The script run all the ".sql" files submitted by the students
5) The script run sqlite3 in command line mode
With this behavior you just need to define a ".sql" file in the "execution files" and write there code to define the database tables and insert the initial rows.

https://github.com/jcrodriguez-dis/moodle-mod_vpl/blob/master/jail/default_scripts/sql_run.sh

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Andrea Pruccoli -

That works perfect, many thanks for your support and fast replies!


Regards.

In reply to Andrea Pruccoli

Re: New Virtual Programming Lab (VPL) module

by Naveendurai K -

I have an issue in sql insert query

scenario 1

the above error is displayed when i type while writing insert query as displayed in the screenshot im getting an error while saving


"insert into customers"


Scenario2 works fine

if i type 

insert into 

customers .......

in two different lines


the query here gets saved with no issues

In reply to Naveendurai K

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hello Naveendurai,
The problem you report is strange. It may be that your network connection has a next-generation firewall. This type of firewall examines the traffic content looking for security threats.
It may be that the firewall considers that the file with the SQL instruction that is sent to the Moodle server to save is an attack.
This problem can be resolved by using a point to point cyphered connection. Https avoids that the firewall can examine the traffic content. Another solution may be that VPL incorporates and internal cipher method to prevent the firewall from thinking that the SQL code is an attack.

Best regards,
Juan Carlos.
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Naveendurai K -

Thank you juan

I have another question .is it possible have multi language option in vpl.


In the above screen shot ,i have two files created via requested files option( C and java)

I want to execute the above program using C and java .But once i click compile & run Main.c gets compiled as it comes first in the file alignment as listed above.

Can we run both C and java for the same question in VPL based the language user selects

Kindly clarify on it

In reply to Naveendurai K

Re: New Virtual Programming Lab (VPL) module

by babu M -
On Nov 24, 2019 1:19 AM, "Naveendurai K (via Moodle.org)" <
In reply to Naveendurai K

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Naveendurai,
the system has been developed to test one student program but not two or more student programs at the same time.
If you want to test the solution for the same problem in two or more programming languages, you need to have two or more VPL activities.
If you want to allow the students to use any programming language to solve the problem, let the students set the source file name.
You can do the system evaluate what do you want, but you need to customize the "run" and "evaluation" scripts.
 
Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by rohit katariya -

Sir, the documentation page says

"

Numbers: only numbers are written. Only numbers are checked out, the rest of the text is ignored. The real numbers are checked with tolerance

example:

output = 4

5 6.8

"


How can we set custom tolerance for real numbers?

In reply to rohit katariya

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Rohit,
sorry, but the floating point numbers tolerance is fixed. I take note for a new enhance of next version of the automatic evaluation program of VPL.
If you really need to change it, you can modify the automatic evaluation program of VPL.
Best regards.


In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by rohit katariya -

Sir,

Can you please tell if there is a value of the predefined tolerance.

Regards,

-R


In reply to rohit katariya

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

The tolerance is 0.01%, this means that the obtained number is considered correct if it is between + or - 0.01% of the correct one.

Best regards.

Juan Carlos


In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Anusha E -

Hi Juan ,

I have installed jail server on my ubutnu 14.04.

When i start demon using

sudo service vpl-jail-system start)

Demon is started but im losing my internet connect.


Im getting internet if i stop jail sevrer.

Can you please help me out

Thanks.

In reply to Anusha E

Re: New Virtual Programming Lab (VPL) module

by rohit katariya -

turn off the firewall feature in the config file.


Quoting Juan's answer when I had similar problem:

Hello Rohit,
the symptoms you're describing are normal, this is a feature from the 2.1 version. The daemon is configuring the firewall of your system. See the details of how to tune this feature in the "Execution server configuration" page.
http://vpl.dis.ulpgc.es/index.php/support/2014-09-27-15-06-22/66-execution-server-configuration

Best regards.
Juan Carlos Rodríguez
hope this helps smile
In reply to Juan Carlos Rodríguez-del-Pino

OpenGL in VPL 3.0?

by Aldo von Wangenheim -

Dear Juan Carlos,

at UFSC, during the last 18 months, we were trying to port a significant part of the programming courses of the CS and IS undergraduate programs to Moodle/VPL. So far this has been working fantastically for courses where the programming assignments involve producing ASCII-outputting applications. 

For programming assignments that produce graphic applications this was not tested yet. This is now my task: I have been teaching Computer Graphics at the CS undergraduate program for 16 years and the endeavor to revolutionize the teaching strategy is now mine.

The course is divided into 3 modules:

  1. Fundamentals of Interactive Computer Graphics: Here the students have to stepwise develop an Interactive Graphic System from scratch, including clipping, curves, surfaces, meshes,  stops when they can produce 3D wireframes of bicubic surfaces. We decided to state C++ and GTK+3 as requirements and have tested some dummy assignments on VPL and everything works fine. This is perfect.
  2. Light, zBuffer, Shading and Surfaces (also implemented from scratch): same as above. Can be solved on the VPL with GTK+3.
  3. Hierarchical Models and Animation: here the students have to use OpenGL This absolutely did not work on VPL 3, not even the simplest empty-window opening program. 
We performed various tests and I will describe each one in the next posts.


In reply to Aldo von Wangenheim

Re: OpenGL in VPL 3.0?

by Aldo von Wangenheim -

First Test: Using a simple GLUT program that opens an empty window.

This is the most standard test to see if an OpenGL application is running on a platform and employs the high level API GLUT to turn the code platform-independent and simple. In order not to force the students to tinker with X-windows programming details (which will be necessary if you employ pure OpenGL coding), making them loose focus, GLUT-based code should run on any educational platform.

Compiling OpenGL/GLUT code under VPL was straightforward after the necessary packages were installed on the server. 

It did not run.  The error we obtained was:

OpenGL GLX extension version not supported by display :<display number>

A screenshot of the output is below (code further below):


#include <stdio.h>
#include <stdlib.h>
#include <GL/glut.h>


void draw(void) {

    // Black background
    glClearColor(0.0f,0.0f,0.0f,1.0f);
    glClear(GL_COLOR_BUFFER_BIT);
    //Draw i
    glFlush();

}

//Main program

int main(int argc, char **argv) {

    glutInit(&argc, argv);

    /*Setting up  The Display
    /    -RGB color model + Alpha Channel = GLUT_RGBA
    */
    glutInitDisplayMode(GLUT_RGBA|GLUT_SINGLE);

    //Configure Window Postion
    glutInitWindowPosition(50, 25);

    //Configure Window Size
    glutInitWindowSize(480,480);

    //Create Window
    glutCreateWindow("Hello OpenGL");


    //Call to the drawing function
    glutDisplayFunc(draw);

    // Loop require by OpenGL
    glutMainLoop();
    return 0;
}

The compiler call was:

g++ -o vpl_wexecution glut1.c -lGLU -lGL -lglut
In reply to Aldo von Wangenheim

Re: OpenGL in VPL 3.0?

by Aldo von Wangenheim -

In time: to install and compile OpenGL GLUT applications on Linux you just need to install these two packages (OpenGL runtime - MESA is part of standard Linux distributions and does not need to be installed):

Runtimes (default and probably already installed on your server):
sudo apt-get install freeglut3
Development package (not default in Linux distributions and must be installed manually):
sudo apt-get install freeglut3-dev 
A good reference you'll find here:
http://igorbarbosa.com/articles/opengl-glut-with-linux-mint-and-ubuntu-12-04/
In reply to Aldo von Wangenheim

Re: OpenGL in VPL 3.0?

by Aldo von Wangenheim -

Second test: Compiling and Running and Application that falls back to OpenGL 2.1 when opening and achieving an OpenGL 3.0 context is not possible.

Since the error message hinted at version and extension, we tried two things at once:

  • produce OpenGL code that does not employ GLUT (even if this won't be feasible later for educational purposes - but it is a form to test if OpenGL runs)
  • produce OpenGL  code that does not rely on the possibility of cretaing an OpenGL 3.0 context, but rather has the ability to fall back to an earlier version).

We tested the code first on a barebones Linux distribution with the minimu infrastructure and it did run. It did also compile on the VPL server.

It did not run on the VPL server.

The error message, however, was different this time:

Invalid GLX version

So apparently the application did try to open an OpenGL 3 context, did not succeed, did then try to open an OpenGL 2.1 context and also failed producing this error. The program should produce a trace of its tries, but this did not appear on the text output pane.



The code (it is long - no GLUT to make things easier):

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <GL/gl.h>
#include <GL/glx.h>
 
#define GLX_CONTEXT_MAJOR_VERSION_ARB       0x2091
#define GLX_CONTEXT_MINOR_VERSION_ARB       0x2092

typedef GLXContext (*glXCreateContextAttribsARBProc)(Display*, GLXFBConfig, GLXContext, Bool, const int*);
 
// Helper to check for extension string presence.  Adapted from:
//   http://www.opengl.org/resources/features/OGLextensions/
static bool isExtensionSupported(const char *extList, const char *extension)
{
  const char *start;
  const char *where, *terminator;
 
  /* Extension names should not have spaces. */
  where = strchr(extension, ' ');
  if (where || *extension == '\0')
    return false;
 
  /* It takes a bit of care to be fool-proof about parsing the
     OpenGL extensions string. Don't be fooled by sub-strings,
     etc. */
  for (start=extList;;) {
    where = strstr(start, extension);
 
    if (!where)
      break;
 
    terminator = where + strlen(extension);
 
    if ( where == start || *(where - 1) == ' ' )
      if ( *terminator == ' ' || *terminator == '\0' )
        return true;
 
    start = terminator;
  }
 
  return false;
}
 
static bool ctxErrorOccurred = false;
static int ctxErrorHandler( Display *dpy, XErrorEvent *ev )
{
    ctxErrorOccurred = true;
    return 0;
}
 
int main(int argc, char* argv[])
{
  Display *display = XOpenDisplay(NULL);
 
  if (!display)
  {
    printf("Failed to open X display\n");
    exit(1);
  }
 
  // Get a matching FB config
  static int visual_attribs[] =
    {
      GLX_X_RENDERABLE    , True,
      GLX_DRAWABLE_TYPE   , GLX_WINDOW_BIT,
      GLX_RENDER_TYPE     , GLX_RGBA_BIT,
      GLX_X_VISUAL_TYPE   , GLX_TRUE_COLOR,
      GLX_RED_SIZE        , 8,
      GLX_GREEN_SIZE      , 8,
      GLX_BLUE_SIZE       , 8,
      GLX_ALPHA_SIZE      , 8,
      GLX_DEPTH_SIZE      , 24,
      GLX_STENCIL_SIZE    , 8,
      GLX_DOUBLEBUFFER    , True,
      //GLX_SAMPLE_BUFFERS  , 1,
      //GLX_SAMPLES         , 4,
      None
    };
 
  int glx_major, glx_minor;
 
  // FBConfigs were added in GLX version 1.3.
  if ( !glXQueryVersion( display, &glx_major, &glx_minor ) ||
       ( ( glx_major == 1 ) && ( glx_minor < 3 ) ) || ( glx_major < 1 ) )
  {
    printf("Invalid GLX version");
    exit(1);
  }
 
  printf( "Getting matching framebuffer configs\n" );
  int fbcount;
  GLXFBConfig* fbc = glXChooseFBConfig(display, DefaultScreen(display), visual_attribs, &fbcount);
  if (!fbc)
  {
    printf( "Failed to retrieve a framebuffer config\n" );
    exit(1);
  }
  printf( "Found %d matching FB configs.\n", fbcount );
 
  // Pick the FB config/visual with the most samples per pixel
  printf( "Getting XVisualInfos\n" );
  int best_fbc = -1, worst_fbc = -1, best_num_samp = -1, worst_num_samp = 999;
 
  int i;
  for (i=0; i<fbcount; ++i)
  {
    XVisualInfo *vi = glXGetVisualFromFBConfig( display, fbc[i] );
    if ( vi )
    {
      int samp_buf, samples;
      glXGetFBConfigAttrib( display, fbc[i], GLX_SAMPLE_BUFFERS, &samp_buf );
      glXGetFBConfigAttrib( display, fbc[i], GLX_SAMPLES       , &samples  );
 
      printf( "  Matching fbconfig %d, visual ID 0x%2x: SAMPLE_BUFFERS = %d,"
              " SAMPLES = %d\n",
              i, vi -> visualid, samp_buf, samples );
 
      if ( best_fbc < 0 || samp_buf && samples > best_num_samp )
        best_fbc = i, best_num_samp = samples;
      if ( worst_fbc < 0 || !samp_buf || samples < worst_num_samp )
        worst_fbc = i, worst_num_samp = samples;
    }
    XFree( vi );
  }
 
  GLXFBConfig bestFbc = fbc[ best_fbc ];
 
  // Be sure to free the FBConfig list allocated by glXChooseFBConfig()
  XFree( fbc );
 
  // Get a visual
  XVisualInfo *vi = glXGetVisualFromFBConfig( display, bestFbc );
  printf( "Chosen visual ID = 0x%x\n", vi->visualid );
 
  printf( "Creating colormap\n" );
  XSetWindowAttributes swa;
  Colormap cmap;
  swa.colormap = cmap = XCreateColormap( display,
                                         RootWindow( display, vi->screen ),
                                         vi->visual, AllocNone );
  swa.background_pixmap = None ;
  swa.border_pixel      = 0;
  swa.event_mask        = StructureNotifyMask;
 
  printf( "Creating window\n" );
  Window win = XCreateWindow( display, RootWindow( display, vi->screen ),
                              0, 0, 100, 100, 0, vi->depth, InputOutput,
                              vi->visual,
                              CWBorderPixel|CWColormap|CWEventMask, &swa );
  if ( !win )
  {
    printf( "Failed to create window.\n" );
    exit(1);
  }
 
  // Done with the visual info data
  XFree( vi );
 
  XStoreName( display, win, "GL 3.0 Window" );
 
  printf( "Mapping window\n" );
  XMapWindow( display, win );
 
  // Get the default screen's GLX extension list
  const char *glxExts = glXQueryExtensionsString( display,
                                                  DefaultScreen( display ) );
 
  // NOTE: It is not necessary to create or make current to a context before
  // calling glXGetProcAddressARB
  glXCreateContextAttribsARBProc glXCreateContextAttribsARB = 0;
  glXCreateContextAttribsARB = (glXCreateContextAttribsARBProc)
           glXGetProcAddressARB( (const GLubyte *) "glXCreateContextAttribsARB" );
 
  GLXContext ctx = 0;
 
  // Install an X error handler so the application won't exit if GL 3.0
  // context allocation fails.
  //
  // Note this error handler is global.  All display connections in all threads
  // of a process use the same error handler, so be sure to guard against other
  // threads issuing X commands while this code is running.
  ctxErrorOccurred = false;
  int (*oldHandler)(Display*, XErrorEvent*) =
      XSetErrorHandler(&ctxErrorHandler);
 
  // Check for the GLX_ARB_create_context extension string and the function.
  // If either is not present, use GLX 1.3 context creation method.
  if ( !isExtensionSupported( glxExts, "GLX_ARB_create_context" ) ||
       !glXCreateContextAttribsARB )
  {
    printf( "glXCreateContextAttribsARB() not found"
            " ... using old-style GLX context\n" );
    ctx = glXCreateNewContext( display, bestFbc, GLX_RGBA_TYPE, 0, True );
  }
 
  // If it does, try to get a GL 3.0 context!
  else
  {
    int context_attribs[] =
      {
        GLX_CONTEXT_MAJOR_VERSION_ARB, 3,
        GLX_CONTEXT_MINOR_VERSION_ARB, 0,
        //GLX_CONTEXT_FLAGS_ARB        , GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB,
        None
      };
 
    printf( "Creating context\n" );
    ctx = glXCreateContextAttribsARB( display, bestFbc, 0,
                                      True, context_attribs );
 
    // Sync to ensure any errors generated are processed.
    XSync( display, False );
    if ( !ctxErrorOccurred && ctx )
      printf( "Created GL 3.0 context\n" );
    else
    {
      // Couldn't create GL 3.0 context.  Fall back to old-style 2.x context.
      // When a context version below 3.0 is requested, implementations will
      // return the newest context version compatible with OpenGL versions less
      // than version 3.0.
      // GLX_CONTEXT_MAJOR_VERSION_ARB = 1
      context_attribs[1] = 1;
      // GLX_CONTEXT_MINOR_VERSION_ARB = 0
      context_attribs[3] = 0;
 
      ctxErrorOccurred = false;
 
      printf( "Failed to create GL 3.0 context"
              " ... using old-style GLX context\n" );
      ctx = glXCreateContextAttribsARB( display, bestFbc, 0,
                                        True, context_attribs );
    }
  }
 
  // Sync to ensure any errors generated are processed.
  XSync( display, False );
 
  // Restore the original error handler
  XSetErrorHandler( oldHandler );
 
  if ( ctxErrorOccurred || !ctx )
  {
    printf( "Failed to create an OpenGL context\n" );
    exit(1);
  }
 
  // Verifying that context is a direct context
  if ( ! glXIsDirect ( display, ctx ) )
  {
    printf( "Indirect GLX rendering context obtained\n" );
  }
  else
  {
    printf( "Direct GLX rendering context obtained\n" );
  }
 
  printf( "Making context current\n" );
  glXMakeCurrent( display, win, ctx );
 
  glClearColor( 0, 0.5, 1, 1 );
  glClear( GL_COLOR_BUFFER_BIT );
  glXSwapBuffers ( display, win );
 
  sleep( 1 );
 
  glClearColor ( 1, 0.5, 0, 1 );
  glClear ( GL_COLOR_BUFFER_BIT );
  glXSwapBuffers ( display, win );
 
  sleep( 30 );
 
  glXMakeCurrent( display, 0, 0 );
  glXDestroyContext( display, ctx );
 
  XDestroyWindow( display, win );
  XFreeColormap( display, cmap );
  XCloseDisplay( display );
 
  return 0;
To compile it you'll have to add -lX11 and drop -lglut from the compiler call.
In reply to Aldo von Wangenheim

Re: OpenGL in VPL 3.0?

by Aldo von Wangenheim -

Third Test: Running a very simple "old style" OpenGL code without GLUT

The test above was based upon code suggested here: https://www.opengl.org/wiki/Tutorial:_OpenGL_3.0_Context_Creation_%28GLX%29 .

For this third test here, we based our code upon the response given by Dark Photon  on in the forum thread https://www.opengl.org/discussion_boards/showthread.php/177999-GCC-OpenGL-without-glut

The code runs on a bare bones Ubuntu 12 Linux installation without problems, producing the application window shown below:

On the VPL it also compiles without problems. Same lib inclusions as for the example above: -lGL -lGLU -lX11.

It does not run on the VPL server. The execution window opens, says: "No connection." and stops, saying: "Connection closed.". 


In reply to Aldo von Wangenheim

Re: OpenGL in VPL 3.0?

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Aldo,
VPL provides a graphical execution environment by launching a vncserver (by default tightvnc) and a client at the browser side (noVNC). Currently neither the vncserver nor the client support OpenGL graphics. I have been searching for a solution to your problem, especially at server level, but I have not found any. The nearest solution is VirtualGL+turboVNC, but the problem here is the need for a specific client.

Sorry, but I think that OpenGL will not be available in VPL in a near future. If you want to try other server side solution and need help, feel free to ask me.

Yours faithfully

In reply to Juan Carlos Rodríguez-del-Pino

Re: OpenGL in VPL 3.0?

by Aldo von Wangenheim -

Dear Juan,


thank you very much for your answer. Now that we know which vncserver you are using in  VPL, we can take a look and see if there' some solution somewhere.


We'll maintain you informed.


Thanks!!

In reply to Juan Carlos Rodríguez-del-Pino

Re: OpenGL in VPL 3.0?

by Daniel Neis Araujo -
Picture of Core developers Picture of Plugin developers Picture of Translators

Hello,


what about let students use WebGL for the last module?

It may be easier to get things working since it only depends on an up-to-date browser.

From the project's wiki:

"WebGL is a cross-platform, royalty-free API used to create 3D graphics in a Web browser. Based on OpenGL ES 2.0, WebGL uses the OpenGL shading language, GLSL, and offers the familiarity of the standard OpenGL API. Because it runs in the HTML5 Canvas element, WebGL has full integration with all Document Object Model (DOM) interfaces.

WebGL is a DOM API, which means that it can be used from any DOM-compatible language: JavaScript, Java, or—if you embed WebKit into an application on a Mac—Objective C.

Major browser vendors Google (Chrome), Opera (Opera), Mozilla (Firefox), and Apple (Safari) are members of the Khronos consortium's WebGL Working Group, along with many other 3D graphics developers."

https://www.khronos.org/webgl/wiki/Getting_Started


Kind regards,

Daniel

In reply to Juan Carlos Rodríguez-del-Pino

Re: OpenGL in VPL 3.0?

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
I was wrong,
it is possible to get some level of OpenGL running in VPL.
The main problem here is that VPL is using tightvnc, one of the stock vncservers of Ubuntu 14 LTS. After testing other different solutions I get to use TigerVNC with OpenGL.
To use TigerVNC instead of TightVNC you must avoid to install TightVNC for the first time, it seem not enough uninstall TightVNC. You must modify the installer to remove the installation of TightVNC. To install TigerVNC go to its home page and download and install the appropriate Ubuntu binary
https://bintray.com/tigervnc/stable/tigervnc/1.4.3#files

I don't know if this solution will be used in the next release of VPL, but at first sight, works.

I add a screenshot of VPL+TigerVNC showing Firefox+webgl and your OpenGL program running.

Yours faithfully

Attachment Captura.JPG
In reply to Juan Carlos Rodríguez-del-Pino

Re: OpenGL in VPL 3.0?

by Aldo von Wangenheim -

Dear Juan,


thank you very much for this tests and help! We'll try to reproduce your results here. I'll let you know what we obtain.


Yours,

   Aldo


In reply to Juan Carlos Rodríguez-del-Pino

Re: OpenGL in VPL 3.0?

by Regis Smith -
Is graphical output supposed to work automatically, without any configuration?  I'm trying to get a basic "Hello World" with SFML displaying, but I get segfaults:

/home/p12506/.vpl_launcher.sh: line 9:  4554 Segmentation fault      ./vpl_execution                          
The only thing I have done was copy your vpl_run.sh from another post to include the SFML libraries.
In reply to Regis Smith

Re: OpenGL in VPL 3.0?

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Regis,

Please, post the code and the "vpl_run.sh" that are you using to reproduce the problem and try to spot a solution.

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: OpenGL in VPL 3.0?

by Regis Smith -
Hi!  Here is the program.
#include <SFML/Graphics.hpp>

int main()
{
    sf::RenderWindow window(sf::VideoMode(300, 200), "Hello World!");
    while(window.isOpen())
    {
        sf::Event event;
        while(window.pollEvent(event));
        {
            if (event.type == sf::Event::Closed) window.close();
        }

        window.clear();
        window.display();
    }

    return 0;
}

And here is my vpl_run.sh which is a slight edit from one of your earlier posts.

#!/bin/bash
#load common script and check programs
. common_script.sh
check_program g++
get_source_files cpp C
#compile
g++ -std=c++11 -o vpl_execution $SOURCE_FILES -lsfml-graphics -lsfml-window -lsfml-system

The jail server is on Ubuntu Trusty.  Sometimes the segfault does not occur, and I just get a terminal window.  Regardless, the tile bar of the terminal always says "Console: connection closed (Running)".


Thanks!




In reply to Regis Smith

Re: OpenGL in VPL 3.0?

by Regis Smith -

I switched the jail server to Fedora 22 (from Ubuntu Trusty) and I no longer get a segfault, so the issue may have been with my Ubuntu installation.  (As a bonus, this allows me to easily install TigerVNC instead of TightVNC.)  Finally, replacing "vpl_execution" with "vpl_wexecution" in vpl_run.sh, as described in one of your earlier posts, produces graphical output.

In reply to Regis Smith

MySQL in VPl

by deepa ganu -
Hi Juan ,
Is mysql supported in jail server ? When I tried using sql scripts it open ups sql lite prompt , I would prefer my sql .
Also are graphical results grad-able ?


In reply to deepa ganu

Re: MySQL in VPl

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Deepa Ganu,
Question 1) "Is mysql supported in jail server ? When I tried using sql scripts it open ups sql lite prompt , I would prefer my sql ."
Short answer 1)
No, VPL don't come with a script to use mysql with no configuration.
Long answer 1)
The philosophy of task execution in VPL is that each task must leave no trace on the server where it is running and must not interfere with other possible tasks running on the same or another server.
Most database servers are ready to run as a single instance on the machine where they are installed, assuming all its users interact with it. This configuration conflicts with the philosophy of ejecucuión task in VPL. If you can isolate the execution of each task using a single database server you have solved the problem.

Furthermore, although VPL don't come with a script to use mysql with no configuration, you can craft a MySQL version that runs in user space, staring and stoping a MySQL server for each user task.

Question 2) "are graphical results grad-able ?"
Answer 2) If you can test graphical results outside of VPL then it is very possible that you can make the same in VPL.
You only need to adapt the output to the way VPL gets comments and grades. I can help you adapting the output.

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: MySQL in VPl

by deepa ganu -

Does it mean for each execution of the program I have to launch an instance of mysql server or multiple client instances can get connected to one mysql server

In reply to deepa ganu

Re: MySQL in VPl

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

I think that two approach are possible (of course may be more).
1) Using one MySql server instance shared by all users.
- Benefits: Easy to install. You can use other server. Remember to set the firewall config properly.
- Disadvantage: you must manage that every user task do not interfere with the task of other users.

2)  Launching a MySql server  instance for every task.

- Benefits: Every MySql instance may be isolated from other users.

- Disadvantage:  You must manage to start and stop a MySql instance in user space mode. The start and stop process may be slow. Every MySql instance can waste resources, especially memory.

Really, at this moment, I don't see an good and easy solution.

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Keith C -
I'm wondering if someone can help me deciper what is going on with this plugin.  

I have upgraded my moodle to the most recent and just installed the vp lab module.

It seems to work.  I can go into the code window and type a simple hello world app in java and it shows up in a console window "hello world".  So I assume this part is working...even though the documentation is feeling very confusing.

SO now I think I found where to put a test case in...and I do evaluate but get "connection failed".

How do I troubleshoot these things?  I really like the idea of this module but the documentation seems like a lot is missing....ie it's all confusing.


In reply to Keith C

Re: New Virtual Programming Lab (VPL) module

by Keith C -
I seem to have this all working ... but I don't really know how it works because I never installed vpl jail server!
In reply to Juan Carlos Rodríguez-del-Pino

VPL Support of C++11/14

by Yana Konstantinovsky -

Hello Juan,

My name is Yana, and i provide moodle support at The Tel-Aviv Academic College.

I've been asked by a professor if the VPL plugin supports C++11/C++14.

I could not find any documentation or mention of this feature.

We've tried running such a code and it did not compile.



Is there anything you can suggest in this matter?


Thanks !


In reply to Yana Konstantinovsky

Re: VPL Support of C++11/14

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Yana,
First I must say that the compilation and execution of any code is carried out by the installed software in your jail server. You can configure (using a script) each activity to use the compiler/interpreter you want. If you use the feature "based on" you can use one configuration for many activities.
If you are using Ubuntu 14.04 LTS for your jail server then you may have g++ 4.8.2. This compiler support c++1y by using the option '-std=c++1y'. If you want to use c++14 then you need to install g++ 5 or other c++ compiler that support this standar.
To use '-std=c++1y' in your g++ you must write a script and add it the vpl_run.sh file of the "Execution files" of your activity. Next, I show you a modified version of the default VPL C++ script that uses this option.

#!/bin/bash
#load common script and check programs
. common_script.sh
check_program g++
get_source_files cpp C
#compile
g++ -std=c++1y -o vpl_execution $SOURCE_FILES -lm -lutil

Best regards

In reply to Juan Carlos Rodríguez-del-Pino

Re: VPL Support of C++11/14

by Ivica Matotek -
Picture of Testers

Hi!

I have installed jail server 2.2 but I don't see this vpl_run.sh skript. How can I add support for c++11 compiler?


Ivica

In reply to Ivica Matotek

Re: VPL Support of C++11/14

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

The default scripts are in the VPL server and are send to the jail server in each execution.
See the vpl/mod/jail/default_scripts/
or
https://github.com/jcrodriguez-dis/moodle-mod_vpl/tree/v3.2.4/jail/default_scripts

You can use the "execution files" and "based on" if you want to customize the execution process.
Best regards,
Juan Carlos


In reply to Juan Carlos Rodríguez-del-Pino

Re: VPL Support of C++11/14

by Ivica Matotek -
Picture of Testers

Hi!

I have created script named cpp_st1y.sh and put in on the Moodle server in default_scrips. But it is not complying with c++11 complier. Script is in attachment. Can you please help me what I’m doing wrong?

 

Ivica

In reply to Ivica Matotek

Re: VPL Support of C++11/14

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Ivica,

If you want that All the C++ code will be by default compiled with a custom script, you must replace the current default script cpp_run.sh.

Remember that you can do that at activity level setting the vpl_run.sh file at execution files. You also can share your script using the "based on" feature.

Best regards,

Juan Carlos


In reply to Ivica Matotek

Re: VPL Support of C++11/14

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Ivica,

If you want that All the C++ code will be by default compiled with a custom script, you must replace the current default script cpp_run.sh.

Remember that you can do that at activity level setting the vpl_run.sh file at execution files. You also can share your script using the "based on" feature.

Best regards,

Juan Carlos


In reply to Juan Carlos Rodríguez-del-Pino

Re: VPL Support of C++11/14

by Ivica Matotek -
Picture of Testers

Hi Juan.


If I understand correctly I can change last line in cpp_run.sh from:

g++ -fno-diagnostics-color -o vpl_execution $SOURCE_FILES -lm -lutil to

g++ -std=c++11 -o vpl_execution $SOURCE_FILES -lm -lutil?

But then everybody on Moodle will use c++11 compiler?


Instead of that I can advise teacher to go VPL administration -> Advanced -> Execution files -> In section vpl_run.sh teacher can write some code that can be executed on vpl server. What code should teacher write inside? This one:

#!/bin/bash
#load common script and check programs
. common_script.sh
check_program g++
get_source_files cpp C
#compile
g++ -std=c++11 -o vpl_execution $SOURCE_FILES -lm -lutil

Thank you.


Ivica

In reply to Ivica Matotek

Re: VPL Support of C++11/14

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Yes, it is.
But remember that using the "based on" feature can help in this process. Use a hidden VPL activity as base of others that will use this script and select this hidden activity as the "based on".
I have added to the TODO list add way to select diferent compilers.
Best regards,
Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by rohit katariya -

sir,

I am trying to uninstall vpl mfrom one of my moodle installations. but i get struck at this screen (site administration->plugins->plugins overview-> uninstall vpl->continue)


Attachment uni2.png
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Neider Vergara Humánez -

Hi.

I´m trying to get some clear data about VPL server, my question is:

Is there any way to consult what langueges and/or versions are actives in VPL?


Thnaks for your answer oand sorry if i cause discomfort.

In reply to Neider Vergara Humánez

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Neider,
If you're looking for the supported programming languages, I have written a page with the supported features for each programming language.
http://vpl.dis.ulpgc.es/index.php/support/2014-09-27-15-06-22/77-supported-programming-languages-vpl3-1
If this don't repond to your question, please try to repeat the question with more details.
Best regards.
Saludos cordiales.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by rohit katariya -

I am getting this problem that on my jail server machine,

I have 3 jail servers installed on ubuntu 14.04. I am unable to ping and networking is also not working on the machines when vpl-jail-service is running. but once I stop these, networking starts functioning and I can ping as well.


here is a screenshot of the problem.

ping not working with vpl service


Please tell how to resolve this.

localhost/OK is working when service it is started.

In reply to rohit katariya

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Rohit,
the symptoms you're describing are normal, this is a feature from the 2.1 version. The daemon is configuring the firewall of your system. See the details of how to tune this feature in the "Execution server configuration" page.
http://vpl.dis.ulpgc.es/index.php/support/2014-09-27-15-06-22/66-execution-server-configuration

Best regards.
Juan Carlos Rodríguez

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Neider Vergara Humánez -

Hi everybody.


I have some question about the appearance of VPL in my Moodle:

Is there any way to change the font in the text boxes?

When i'm editing a code in the text box, the cursor is out of phase, some like forward, is there any way to correct this?

Is there any doc about making changes in this themes?


Thank you all for you time.

In reply to Neider Vergara Humánez

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Neider,
we know that some non standard theme has problems with VPL, and we know that VPL don't work well with tablets and mobiles. Our next release will try to address this problems.
Best regards.
Juan Carlos


In reply to Neider Vergara Humánez

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello again,
if the problem you have is about the use of the Essential theme, I have good news. I have resolved this problem of compatibility. You can test the solution using the 3.1.4 branch in github. Other good news is that this version enable the edition of code from tablets and mobiles.
Reports of test before the official release will be appreciated.

https://github.com/jcrodriguez-dis/moodle-mod_vpl/tree/v3.1.4


Best regards.

P.D.: The main file of CSS used here is editor/VPLIDE.css but the appearance is also controlled programmatically.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Charlie Daly -

Hello Juan Carlos,

I have installed version 3.1.4 of vpl onto Ubuntu 4.0.4.3 LTS. I created a test C++ exercise and tested it.

It works if I use the demojail server. However, when I use my own server, then it fails with a "no connection" error message.

I am able to access the jail-server/OK page. (wget http://jail-server/OK gets the page from the moodle server)

Also, the jail server works with the version of vpl that I installed last year.

The jail server is version 2.0.1.

Thanks for any help.

By the way, I downloaded version 3.1.4 from github. I notice that it is now on Moodle. I am not sure if is exactly the same.

Charlie

In reply to Charlie Daly

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Charlie,
The version 3.1.4 at github is the same that the one on Moodle. The versions released at Moodle (except mistakes) are frozen in github. The version at github with higher numbers are unstable.
The last change of code about the the connections from VPL to the jail server was done in the 3.1.1 version:
--------------
Added a global configuration setting for the type of WebSocket connection (wss or ws) used from browser to the execution servers (contributed by José Norberto Luiz Fernandes Corrêa):
1) Use ws or wss when using http or https to access the moodle server
2) Use always wss
3) Use always ws"
---------------
This modification was done to resolve problems in some network configuration with proxy and/or perimeter firewalls that may interfere with the WebSocket protocol used to connect the browsers with the jail server.
I don't think that your problem is related with Ubuntu 14.0.4.3 LTS. if your VPL plugin can use the demojail then it seams related to the network architecture where your jail server is located.
To try to better spot your problem try:
1) Using a https conection with your Moodle
2) Change the global configuration setting to the option 2 or 3

You can also, if you trust me, let me test your jail server sending me, in a private message, the URL to acces your jail server. I will use it from a VPL activity on my test Moodle server.

Best regards
Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Neider Vergara Humánez -

Hi Juan.


Sorry if i cause discomfort. I have some teachers asking about using Pyomo in the VPL, is this possible? Do i need to configure the Jail server in any way to compile this codes? is there any doc about this topic?


Thanks for your time.

In reply to Neider Vergara Humánez

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Neider,
I don't know any doc about this topic. But like other software there is almost no limit to run in VPL. Install pyomo (as root) in your jail server and restart the service. If this don't work, let me know.
https://software.sandia.gov/downloads/pub/pyomo/PyomoInstallGuide.html

Best regards.
Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module - Safari

by Jody Paul -

I am having some problems when using the Safari browser (version 8.0.6) under OS X (10.10.3) when accessing VPL labs (version 3.1.3). Note that the problems do not show up when using FireFox and Chrome, both of which show VPL as working correctly.

From the "Edit" panel, when either "Run" or "Evaluate" is chosen, no console window appears and there is no observable effect on the displayed page. The initial status pop-up ("Run -- connecting") does appear briefly and then goes away. There is no console displayed for "Run" and no updated display for "Evaluate". The state of the display remains at whatever it was previously (e.g., if an evaluation had occurred when logged in using Chrome).

I have no blockers set or extensions running in Safari.

Any ideas? Any thoughts on how to pursue this further?

Thanks!

--Jody

In reply to Jody Paul

Re: New Virtual Programming Lab (VPL) module - Safari

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Jody,
It's a known problem with self-signed certificates and websocket in Safari. The behavior of Safari is different to the rest of browsers. If this is the problem that you have, you can try this:
1) Install the self-signed certificates of the jail server into the OS X.
2) Don't uses self-signed certificates, buy a verified certificate.
3) Don't use https (SSL) with Safari (not recommended)

I will study some better solution in future VPL versions.

Best regards.
Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module - Safari

by Jody Paul -
Thank you for this information and suggestions.

I very much appreciate your efforts overall as well.
I am looking forward to using VPL for this Fall semester.
--Jody

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module - Safari

by Ivica Matotek -
Picture of Testers

Hi!

I have a problem with installing chain certificate, can you help me with locating where to put chain certificate. We have certificate signed from CA. 

Thank you.

Ivica

In reply to Ivica Matotek

Re: New Virtual Programming Lab (VPL) module - Safari

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Ivica,
you must copy your certificate chain (in pem format) to the file /etc/vpl/cert.pem and your key (in pem format) to the /etc/vpl/key.pem.
This file must be "chmod" as read only for root.
Best regards.
Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module - Safari

by Ivica Matotek -
Picture of Testers

Hi!

I have done that: cert


But, if I remove Accept self signed certificates, I receive this error:

Error

So, I think that certificate is not working.


Ivica

In reply to Ivica Matotek

Re: New Virtual Programming Lab (VPL) module - Safari

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Ivica,
I apologize for the long delay answering your question, I did not see your post when you sent it.
I think you only have an installation problem. The "cert.pem" must be a certificate chain (certificates concatenated), but it seems that you only put your certificate. I think that you forgot to concatenate the "TERENA SSL CA 3" certificate to yours.
You can get the TERENA certificate (TCS SSL CA 3) at
https://www.terena.org/activities/tcs/repository-g3/
https://www.terena.org/activities/tcs/repository-g3/TERENA_SSL_CA_3.pem

Take the certificate and add it to yours:

sudo cat terenacert.pem >> /etc/vpl/cert.pem

Beware that the pem format is a text format.

Best regards.
Juan Carlos

Your cert.pem file must look like this:
-----BEGIN CERTIFICATE-----
MIIFSjCCBDKgAwIBAgIQCaKkX+emob/+FQL4nCUBhDANBgkqhkiG9w0BAQsFADBk
MQswCQYDVQQGEwJOTDEWMBQGA1UECBMNTm9vcmQtSG9sbGFuZDESMBAGA1UEBxMJ
QW1zdGVyZGFtMQ8wDQYDVQQKEwZURVJFTkExGDAWBgNVBAMTD1RFUkVOQSBTU0wg
Q0EgMzAeFw0xNTEyMDIwMDAwMDBaFw0xODEyMDYxMjAwMDBaMIGMMQswCQYDVQQG
EwJIUjEPMA0GA1UECBMGWmFncmViMQ8wDQYDVQQHEwZaYWdyZWIxPDA6BgNVBAoM
M0hydmF0c2thIGFrYWRlbXNrYSBpIGlzdHJhxb5pdmHEjWthIG1yZcW+YSAtIENB
Uk5ldDEdMBsGA1UEAxMUbW9vZGxlLXZwbC5jYXJuZXQuaHIwggEiMA0GCSqGSIb3
DQEBAQUAA4IBDwAwggEKAoIBAQC7IHXuoPXMS9puHe3Q3iXxAFQq6t+gC/wW4Nx5
vgOKKSKlsSPPLGWI06h+ovjJhUpXfpT1V/Vr5XTcndlXdOb7VpFUSuOdt3qn1szO
B3oXRF3xE+sPZGzM/2Pl3YJMCBOxrXF/4wa+u8WnRZLzPdDCXMG64q2Ta9zBfFRH
dwKG3gdiTrLVYhIhIE8M89YG4eMj/teGc+dq1CyojW/y+jwhLt7crEVl2j2GZQd6
WKv95HBmKjy5tXEP22l9GEtp+6HqbnL8I/XQxqsHge8Aatj4Yn4kuvJGkhb0fei0
LyDxsQI42WhzZGlOfJ9bZuWAROIxlaJQr8zt0GeAyan0IxPDAgMBAAGjggHNMIIB
yTAfBgNVHSMEGDAWgBRn/YggFCeYxwnSJRm76VERY3VQYjAdBgNVHQ4EFgQUzq2S
XASdDi1nP3EU5DBwJifKFXUwHwYDVR0RBBgwFoIUbW9vZGxlLXZwbC5jYXJuZXQu
aHIwDgYDVR0PAQH/BAQDAgWgMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcD
AjBrBgNVHR8EZDBiMC+gLaArhilodHRwOi8vY3JsMy5kaWdpY2VydC5jb20vVEVS
RU5BU1NMQ0EzLmNybDAvoC2gK4YpaHR0cDovL2NybDQuZGlnaWNlcnQuY29tL1RF
UkVOQVNTTENBMy5jcmwwTAYDVR0gBEUwQzA3BglghkgBhv1sAQEwKjAoBggrBgEF
BQcCARYcaHR0cHM6Ly93d3cuZGlnaWNlcnQuY29tL0NQUzAIBgZngQwBAgIwbgYI
KwYBBQUHAQEEYjBgMCQGCCsGAQUFBzABhhhodHRwOi8vb2NzcC5kaWdpY2VydC5j
b20wOAYIKwYBBQUHMAKGLGh0dHA6Ly9jYWNlcnRzLmRpZ2ljZXJ0LmNvbS9URVJF
TkFTU0xDQTMuY3J0MAwGA1UdEwEB/wQCMAAwDQYJKoZIhvcNAQELBQADggEBAIW4
WqIKLtXECV+joOSNZ7bfPjeJ5tTLMqIbvBoi3chcPE2l6dlrvhL1ovfyGkVv954W
ydiS+KQxGtaX2tmPAKnw52rtu0tenWY4jLv1mem6UjnsceseC7NjxFzB2KMFItFi
jy3wHN3cmKgZDB/OM/PtVfyuXjBazYKWa2a7AzOujqjhtz6cq8K6O2QZHJx0lPOc
cTuUcldv2oX0W/40UK8mmJqJo/kbFZmRmYcq1O4Zp8iY0Q+iGSYwOYWIsk8OCZK5
QukieHGwyW0w/Si/Duda+pHxf+aWjgoE8UQsx3iPPYwIk7KhBNlB6/L9JVqPM0e6
n4A9JUEdZI4xH/cSZXE=
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIE+zCCA+OgAwIBAgIQCHC8xa8/25Wakctq7u/kZTANBgkqhkiG9w0BAQsFADBl
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJv
b3QgQ0EwHhcNMTQxMTE4MTIwMDAwWhcNMjQxMTE4MTIwMDAwWjBkMQswCQYDVQQG
EwJOTDEWMBQGA1UECBMNTm9vcmQtSG9sbGFuZDESMBAGA1UEBxMJQW1zdGVyZGFt
MQ8wDQYDVQQKEwZURVJFTkExGDAWBgNVBAMTD1RFUkVOQSBTU0wgQ0EgMzCCASIw
DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMV2Dw/ZQyk7bG3RR63eEL8jwnio
Snc18SNb4EweQefCMQC9iDdFdd25AhCAHo/tZCMERaegOTuBTc9jP8JJ/yKeiLDS
lrlcinQfkioq8hLIt2hUtVhBgUBoBhpPhSn7tU08D08/QJYbzqjMXjX/ZJj1dd10
VAWgNhEEEiRVY++Udy538RV27tOkWUUhn6i+0SftCuirOMo/h9Ha8Y+5Cx9E5+Ct
85XCFk3shKM6ktTPxn3mvcsaQE+zVLHzj28NHuO+SaNW5Ae8jafOHbBbV1bRxBz8
mGXRzUYvkZS/RYVJ+G1ShxwCVgEnFqtyLvRx5GG1IKD6JmlqCvGrn223zyUCAwEA
AaOCAaYwggGiMBIGA1UdEwEB/wQIMAYBAf8CAQAwDgYDVR0PAQH/BAQDAgGGMHkG
CCsGAQUFBwEBBG0wazAkBggrBgEFBQcwAYYYaHR0cDovL29jc3AuZGlnaWNlcnQu
Y29tMEMGCCsGAQUFBzAChjdodHRwOi8vY2FjZXJ0cy5kaWdpY2VydC5jb20vRGln
aUNlcnRBc3N1cmVkSURSb290Q0EuY3J0MIGBBgNVHR8EejB4MDqgOKA2hjRodHRw
Oi8vY3JsMy5kaWdpY2VydC5jb20vRGlnaUNlcnRBc3N1cmVkSURSb290Q0EuY3Js
MDqgOKA2hjRodHRwOi8vY3JsNC5kaWdpY2VydC5jb20vRGlnaUNlcnRBc3N1cmVk
SURSb290Q0EuY3JsMD0GA1UdIAQ2MDQwMgYEVR0gADAqMCgGCCsGAQUFBwIBFhxo
dHRwczovL3d3dy5kaWdpY2VydC5jb20vQ1BTMB0GA1UdDgQWBBRn/YggFCeYxwnS
JRm76VERY3VQYjAfBgNVHSMEGDAWgBRF66Kv9JLLgjEtUYunpyGd823IDzANBgkq
hkiG9w0BAQsFAAOCAQEAqSg1esR71tonHqyYzyc2TxEydHTmQN0dzfJodzWvs4xd
xgS/FfQjZ4u5b5cE60adws3J0aSugS7JurHogNAcyTnBVnZZbJx946nw09E02DxJ
WYsamM6/xvLYMDX/6W9doK867mZTrqqMaci+mqege9iCSzMTyAfzd9fzZM2eY/lC
J1OuEDOJcjcV8b73HjWizsMt8tey5gvHacDlH198aZt+ziYaM0TDuncFO7pdP0GJ
+hY77gRuW6xWS++McPJKe1e9GW6LNgdUJi2GCZQfXzer8CM/jyxflp5HcahE3qm5
hS+1NGClXwmgmkMd1L8tRNaN2v11y18WoA5hwnA9Ng==
-----END CERTIFICATE-----

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by rohit katariya -

Sir,

While executing code, the files used are stored in a virtual root directory using chroot, which is deleted once the execution of code ends.

I would like to know, if there is a method by which, upon execution, I can create a persistent file that stores the outputs of the student?

eg, if a student generates a structure containing {a:int,b:char,d:int} can I store a csv or text file containing such values to the student's directory so that it can be used later on while cross checking?

Regards,

Rohit.

In reply to rohit katariya

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Rohit,
sorry, but this feature is not available (bring back to Moodle a file resulted of the student's code execution). The only data obtained from the student's code execution is the "evaluation". Beware that the evaluation can be controlled to output anything (generating a appropriate vpl_evaluate.sh).
I don't understand what do you want to say with "that it can be used later on while cross checking?"
Please, detail with an example to understand your needs.

Best regards.

Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by rohit katariya -

Hi,

I want to code an assignment in which a student code performs a set of computations and returns a c structure. I want that when the evaluation code runs, it runs the student code with 10 - 12 different inputs and I want to store these values of the 12 structures that were returned into a csv file and save this file so that I can use this file later.

Regards,

Rohit

In reply to rohit katariya

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Rohit,
The problem here may be "save this file so that I can use this file later".
As I have told the only returned information, and saved as text, is the evaluation. You can create your own "vpl_evaluate.sh" script and generate this file as result. This script must compile (if needed) the student's code and generate a script "vpl_execute" to be run. "vpl_execute" must run the student program with the apropiate input an output the result in csv format.

I hope that this answer helps you to create your activity.

Best regards.
Juan Carlos Rodriguez


In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by rohit katariya -

I think this will solve my problem. I'll try this out and report. Thanks smile

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by rohit katariya -

what is the correct way to access the vpl data directory?

currently I am using relative link "../../../moodledata/vpl_data/" which I think will fail based on configuration.

Is there a better way to access vpl_data directory like may be the vpl lib provides a function that returns a path to the directory.

In reply to rohit katariya

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Rohit,
the students' submissions and the evaluation results are saved at [...]/moodledata/vpl data, but for obvious security and consistency reason NO code executed via VPL can access this data.
To access this data you need to modify the VPL code.

I have modify VPL for you, replace the downloadallsubmissions.php file in your VPL installation and you will get for each submission with the compilation and execution (evaluation) result.

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by rohit katariya -

Thanks Juan it is just what I need.

But I am still trying to figure out that what structure you are using to save data of a new vpl activity.

I could find that every time a new vpl activity is created, a new directory is being created in /var/moodledata/vpl_data/ , every time a number incremented. I would like to know how can I get the number associated with a particular activity. Earlier I thought it was one less than the id passed in the url as a parameter, but it is the activity number given by moodle.

I would like to know the mapping of an activity to the directory its files are stored in vpl_data.

In reply to rohit katariya

Re: New Virtual Programming Lab (VPL) module

by rohit katariya -

Ok, I found it using $vpl->get_instance(); and then $instance->id .

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by rohit katariya -
Hi Juan,
  1. Is there any way I can access username and other user details from evaluate.sh file. i.e when I am evaluating student code, can I get what student's code is being evaluated?
  2. I am trying to ask my students to upload jar or zip files. but I am getting invalid jar or zip when I try to run it or unzip it. I think there is a problem while uploading non-text files like jar and zip. (Please answer this as soon as possible)
    I am getting following error:
    Error: Invalid or corrupt jarfile testing.jar
  3. Currently I am working on your vpl activity module and I can see a lot of interesting data like how much time each student has worked on an assignment and how much is he coding per sitting and time given in a sitting. I am able to get the files he has edited in a sitting as it is being stored in an incremental folders fashion. I would like to get where I can get the other data I mentioned. This will be used for analyzing student behavior and other such stuff.
Regards,
Rohit



In reply to rohit katariya

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Rohit,
1) Use VPL v3.1.5  from https://github.com/jcrodriguez-dis/moodle-mod_vpl/tree/v3.1.5
You will get two environment vars in the evaluation process MOODLE_USER_ID and MOOLDE_USER_NAME
2) Current VPL version does NOT support binary files. As a workaround you can use base64 files. From v3.1.4 if you submit (not editing) a .zip, .jar, .jpg or .gif file the system will convert it to base64 and adds ".b64" to the file name. Beware that if you are  trying to import binary files to the editor you will get this error.
3) I don't know what other data are you requesting, but you can get all you want by programming the appropriate code to interact with Moodle.

Best regards,
Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by rohit katariya -

Thank you Juan,

I am talking about this data(in the image) giving details of how many hours a student is working and in every session how much time he is giving. I would like to access this data. Not through your vpl_execute.sh or vpl_run.sh, but I want to access the database or  files in which you are storing this data or through which I can retrieve this data.

Correct me if I am wrong, but it is a feature of VPL i suppose not moodle.

Attachment Screenshot from 2015-08-18 000805.png
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by rohit katariya -

I am using vpl v 3.1.5 but the environment variables don't seem to be set.

I am using the following evaluation script in evaluate.sh:

#! /bin/bash
gcc -w assignment3.c evaluate.h evaluate.c 
rm evaluate.h evaluate.c
./a.out -e  -i "$MOODLE_USER_ID" -n "$MOODLE_USER_NAME" # here I am trying to pass user name and user id as arguments
#cat output.csv

Please point out the error.
I tried adding env command to the bash script but cant see these variables set.

I found these variables set in vpl_environment.sh file. but these are not visible in evaluate.sh.

In reply to rohit katariya

Re: New Virtual Programming Lab (VPL) module

by rohit katariya -

So,

I have edited the script as follows. It works but I am not sure it is the best way to achieve the result.

#! /bin/bash
cat > evalscript.sh << 'EOF'
gcc -w assignment3.c evaluate.h evaluate.c
rm evaluate.h evaluate.c
./a.out -e -i "$MOODLE_USER_ID" -n "$MOODLE_USER_NAME"
#cat output.csv
#cat vpl_environment.sh;
EOF
cat vpl_environment.sh evalscript.sh > combined.sh
chmod 777 combined.sh
./combined.sh

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by rohit katariya -

Sir,

I have a timing sensitive assignment in which student code needs to run for say 5 minutes and the process should not switch. Will VPL be able to provide an environment such that between execution, the code does not context switches and a student gets full 10 minutes of cpu time? Here I am assuming that when multiple student codes are running, vpl would be switching between different executions of student. We have 3 X 16 CPU systems dedicated to running vpl execution servers. And at a time, 70 students are expected to be submitting the assignment at the end moment.

Regards,

Rohit


In reply to rohit katariya

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Rohit,

If you are looking for a dedicated environment to execute student's task that cannot be disturbed by other student's task, I must say sorry, but VPL don't support this feature. You are not the first to request this behavior. To get this feature in VPL you must wait for a future release. I have added this request to the TODO list of VPL (I don't know how much of this request is feasible).

I must correct your post: VPL is not "switching between different executions of student", this is a task of the OS.

 

Best regards.

Juan Carlos

In reply to rohit katariya

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello again,
thinking about your need, may be a way to get it.

Assuming that you don't want an immediate result.
1) Don't activate the "evaluate" button for students in the activity. If you activate this option, beware that the initial results will not be accurate.
2) Create a dedicated execution server for this activity and assign it as the only execution server of the activity. (Go to the activity administration->Advanced settings->Local execution servers, see help to control the servers used)
3) Check the server with activity administration->Advanced settings->Check execution servers, check that only the dedicated server is used.
4) After the "timing sensitive assignment" ends, go to "submissions list" and select "evaluate"->"all"
5) The system will execute one by one all the submissions.

I hope this helps.
Best regards

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by rohit katariya -

Will this execution(evaluate all) be parallel among servers? i.e. If I have 3 servers will this execution take place one by one on a single server or 3 codes will be sent to 3 servers at a time?

In reply to rohit katariya

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Rohit,
VPL will use the available servers for the activity. But beware that VPL is very customizable. You can assign a dedicated server to one activity, this will be the only server that will be used in the execution of submissions in this activity. See the help page in the "local server setting" to avoid the use of the servers in the plugin global setting..
The "evaluate all" process is secuencial the system will evaluate one after one.

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by ashok bhansali -

Hi..

I want to have many short independent programs as part of one VPL assignment. Iam facing two issues:

1. I can submit/save many files in the editor . But how the test cases for the different files can be written/used?

2. I want students to evaluate and see the results. But if a student corrects the program again and reevaluate then his grade changes. i want his first evaluation grade to be the final grade.

Pls suggest

In reply to ashok bhansali

Re: New Virtual Programming Lab (VPL) module

by Jean Martina -

What we do in here to sort these problems out  is :

1) We write different tests and include on the test a specific filename for the student to hand in his work. We then rewrite the vpl_execution.sh so that we compile the files accordingly. At the end of the day we have a single file that is prepared for compilation which includes the necessary tests. As we do thing in C/C++ we  just check if the student handed in the file name X.cpp or X.h and write the includes on the one that ought to be compiled.

2) This second one is nice feature that we are also having a hard time to implement. We haven't done anything for real, but we played with the idea of setting some variables on and external server using wget. We have a script that checks a number of submissions by accessing a webpage from within vpl_evaluate.sh and we increment it using another script. We were trying to emulate what happens on the questionnaire module, but it is far too complicated to put in practice.

A nice feature request: To be able to demote the grade by x% per each submission.


Jean

In reply to Jean Martina

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Jean,
sorry, but I don't understand very well your first paragraph. Please explain what you need.
The second one is a request that we have planning to fulfil in the next major release v3.2.
Best regards.


In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Jean Martina -

What we are trying to do is modular testing. In fact it is not a problem of mine right now, but I am helping a colleague here at university to sort it out. He is using VPL with VHDL. He wants to build up designs on the top of other designs. And what he is doing to so test independently each of the sub-designs and then test them again together. For example to build an Arithmetic unit he needs an adder. He wants to test the adder on itself at first, and the put into the context of the Arithmetic unit and test again.

The solution we built here was to write all the tests (alone and together) and then to build the final test using the vpl_execution.sh. We check which files where handed in by the students and build on the fly the testing program by using includes. All the rest follows the usual flow from the VPL module.


Jean

In reply to Jean Martina

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

I am glad to see that you are a very skilled VPL user.
The customization of the vpl_evaluate.sh script is the way to automate complex evaluation processes.

Best regards.


In reply to Juan Carlos Rodríguez-del-Pino

Virtual Programming Lab: Can it use letter grades?

by Dominique Thiebaut -

Hello Juan Carlos and team,

Is it possible to have VPL record a grade in the form of a letter (A through F) rather than as a number between 100 and 0?

Thanks!


Dominique

In reply to Dominique Thiebaut

Re: Virtual Programming Lab: Can it use letter grades?

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Dominique,
No and yes, I explain my answer:
VPL always save a value from 0 to a max real number. But if you activate the use of letters see
https://docs.moodle.org/22/en/Grade_letters#Displaying_letter_grades
you will get and see the appropriate letter in the gradebook.

If you use a scale (list of text items) then you can select the text you wish but this text is kept and processed as an integer from 0 to the scale steps-1.
If you are using automatic evaluation you must generate the appropriate integer value (converted if real) to choose the text.

The only problem here is that if you select to show letters, the gradebook will show letters but VPL will show numbers. VPL need to update the code that show the grade, showing letters when needed.

Best regards.
Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: Virtual Programming Lab: Can it use letter grades?

by Dominique Thiebaut -

Sorry to bother you again with this, but I did set my course "Grade Display" to letter, category totals to letter as well, but the grade reported by VPL in the grade book is still 0.  I'm making VPL return a string  (e.g. "A-") instead of a number (90).  Could that be the problem?

Thanks, 

Dominique 

In reply to Dominique Thiebaut

Re: Virtual Programming Lab: Can it use letter grades?

by Dominique Thiebaut -

Ok, I figured it out.  VPL has to output a number as the grade.  It can't directly output a letter grade.  Then Moodle translates that into a letter.


In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Venkatesh S -

Hi Juan,

Sorry to trouble you and thanks for the immense help. I have found out only if i use scanf("%s",var) my test cases are getting valid and in case if i use gets function in the program, my test case is not getting evaluated and all the test cases fails. This is the root cause of the problem.

Now all the test cases are getting evaluated once if i use scanf.





In reply to Venkatesh S

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Thanks Venkatesh, for your reply.
But I am wondering why using scanf("%[^\n]",var) don't work for you. I am very interested in reproduce your initial problem. Please, send me the vpl_evaluate.cases and the code you was testing when the problem appeared.

Best regards.
Juan Carlos


In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Venkatesh S -

Hi Juan,

We ourselves found out what mistake we have did, It was in the test case that we have given, our old test case was like

case = T1

input =

Dealing

output=

Enter the string

Vowels present in the string are 3

Actually the compiler takes the empty line as an input and this is the problem with our program.

We have rectified it and now all the program works fine.Below is the new test case which is working perfectly.

case = T1

input =Dealing

output=

Enter the string

Vowels present in the string are 3


Juan we would like to be a part of vpl development community and we have customized the vpl entirely so that it works as separate system like moodle. I want you to visit dodo.adithyatech.edu.in to check the customizations what we have done. username is Test and password is Test. Please kindly check this and we are trying to implement this as an open source to all colleges in India without any charge for their academic curriculum. We want to your valuable feedback.

The system is very stable as of now and we also have moodle .Both are working fine.



In reply to Venkatesh S

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Venkatesh,
it is a good news to know that you managed to resolve the problem with your test case.
I am surprised by your customization of VPL. Thanks for your invitation to check it. I guess that you know that the username and password you send me has been read by every one that access this forum.
When I have time I will check your software in depth. I have accessed to take a glance and it seems good. One suggestion: I think that it will be easier for students if you use the feature of "required files" to set de name of the source files, removing the need to write them when accessing to the activity. One comment: For some reason, from the IDE I can't access to the "problem" tab.

Best wishes for this project.

Juan Carlos.



In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Venkatesh S -

All the errors are cleared and now Entire C Laboratory is being carried out with more than 100 programs. Thanks Juan for your help and support. Now we are adding further features like code fillups , code shuffle and Template for further enhancing students skills and evaluate their performance.

In reply to ashok bhansali

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Ashok,
Sorry, but my suggestion in both case y customize VPL by writing code.
- In the first case you need to learn, seeing the current code, how run the default evaluation program, for adapting it to your need.
- In the second you need to change the current VPL module behaviour.

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Perry Way -

Hello Juan, this is an exciting plugin and I'd like to install it but the problem is we are on a Windows system. I examined the c++ source code of the backend "Jail" system and see that you're implementing the execution of the code portion of this module through a virtual http server. I'm wondering, could we set up a small Ubuntu box to run only the backend system this plugin requires and modify settings to point to it instead of our public web server where Moodle is running on?

If there are any other options available, perhaps you could share some more information in general with regards to a mixed server topology.

Thanks in advance!

In reply to Perry Way

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Parry,

the "execution system" is compatible only with linux (recommended Ubuntu). If you are in windows you can use a virtualization technology for windows to install a linux box. VirtualBox may be a good solution.
Of course you must configure the system to let the execution server (by default http and https, ports 80 and 443) can be reachable from the clients (Moodle server and user browser).

Best regards
Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Nijesh W -

Hi Juan Carlos Rodríguez-del-Pino,

How to get an execution time of a program. Is it posible?

In reply to Nijesh W

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Nijesh W,
if you are asking about the default testing program I must say that the current version don't give that information. But the issue about how much CPU time a program uses in linux is not easy.
In any case, VPL allows a wide customization. For example, you can take the default testing program of VPL (written in C++) and add code to show the information you need.
https://github.com/jcrodriguez-dis/moodle-mod_vpl/blob/master/jail/default_scripts/vpl_evaluate.cpp
add the modification version to the execution files of an activity to use it.

Best regards
Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

VPL Test activity

by Jean Martina -

Hi,


I have been using VPL quite a lot here and actually started reusing my VPLs from semester to semester. I found an issue (at lest to me) that regards to the test activity. I built my automatic tests based on a test activity , but when I backup and restore  it is left behind. In fact, I want to move it to another course and I do not want to bring previous students assignments. This is the fact why it is not coming in the backup file. To me it is important to have the test activity since I am always improving the tests and the activity itself.

If fact I have been inspecting the VPL module code and I realised that the test activity is related to the user that created it, and as such is not backed up with the VPL when I ask not to bring user's data. I think that philosophically the test activity do not belong to a user but to the test activity. I also realised that it is reasonably easy to change that. So my questions to the developers:

Do you agree with that?  If so, l can this be changed ? Should I change and send you a patch?


Regards,


Jean


In reply to Jean Martina

Re: VPL Test activity

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Jean,
Thanks for your report but some of your comments are incorrect. The backup of the VPL activity is not related to any user, of course the submissions are associated to their submitter and the evaluator (if there is one).
The problem you report is related to the limitations of the Moodle backup. If you have an activity based on other into a backup you must restore both is you want to keep the relation. Beware that this relation is not keep based in the name of the activity it is based on the database row id.
This problem is shown not only if you restore an activity without its related ones. It can be seen if you import one activity from other course or if you duplicate an activity in the own course. The reason is that in all this action the restore process is taken and this process can only restore the data selected to be restore.
I don't know if try to connect the activity taken the name of the activity would be secure enough.
I am open to any improvement, if you solve this annoying behavior, I will accept it.

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: VPL Test activity

by Jean Martina -

Hi Juan,

I think I expressed myself in the wrong way. What I want to solve is the relation between the test activity and who create it. The way it is implemented the test activity is related to its creator an any other activity. Then, the way moodle's backup works, it will be left behind if I choose not to bring user data to the next activity (what I do is to migrate a full course from one semester to another and start fresh for the new students). I believe, that the test activity should be part of the VPL itself (like the personalised scripts I write for vpl_execution, or my test cases). In that sense it would be backed up and brought back with the VPL activity. I understand that if there is a relation between two VPLs they need to be backed up together and recovered together.

I already asked our local moodle development team to sort it out. As soon as we have a solution I will post it for your evaluation.


Regards,

Jean

In reply to Jean Martina

Re: VPL Test activity

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Jean,
now I understand your problem, but again I think is not an easy solution. The current behaviour is chosen by design, in a courses with only one teacher your proposal may be the ideal solution, but for courses with several teachers may be a problem. For example, we use the test activity environment as a workspace for each teacher. We can test the activity setting and to study the students submissions, we can change and correct the students' code, without modifying the real student's submission.

Your request is clear, but It seems dificult to get both things, I will have in mind your need.

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: VPL Test activity

by Antonio Carlos Mariani -

Hi Juan,

I took a look at the vpl code trying to find out a good way to solve this. It seems very useful keep the current behavior where each teacher has  his own space to make tests. At the same time, I think is possible to include a new test space (new "tab") shared by all enrolled teachers. The code of this space should always be included on the backup file. 

I made some changes in the vpl code using userid=0 as the user identification for this special space. Operations like edit, evaluate and save seemed to work normally. I don't know if this solution is acceptable. What do you think about?

Best regards.

In reply to Antonio Carlos Mariani

Re: VPL Test activity

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Antonio Carlos,
Your proposed method can resolve the problem of getting that common place to test he activity. Now it's needed to modify the backup and restore processes to keep this information always.

The solution that you comment seems to be adequate, but I'm very busy and I can't help you to code the solution for some weeks.

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Venkatesh S -

We are sending screen shots for your reference. Please help us out


In reply to Venkatesh S

Re: New Virtual Programming Lab (VPL) module

by Venkatesh S -
Hi Juan,
I have already sent you the problem which we are facing.. Need your expertise in this issue as students have started using it..
When we are running am getting the correct output but the test case fails.so please do give us some help regarding this
In reply to Venkatesh S

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Venkatesh,
I have not been able to reproduce your problem.

Please, tell me the version of VPL that are you using and send me the vpl_evaluate.cases and count.c files, to try to reproduce the problem.

Best regards.

In reply to Venkatesh S

Re: New Virtual Programming Lab (VPL) module

by Jhon Carlos -

Hello Juan & Venkatesh,

I need a small help in modification.. I went through your dodo site and found the result page like this :

Result

how to achieve this ? how can i implement this for my work place ?

could you please help me ?

In reply to Jhon Carlos

Re: New Virtual Programming Lab (VPL) module

by Venkatesh S -

Hi Jhon Carlos,

VPL was entirely customized by nijesh Technical Architect of my company as per the requirement of Indian Universities with the help of Juan. The screen shot page which you have sent is to check the status of the program whether it is accepted or not.

We have separated the login right as admin, teacher and student. The Test login is student login. You can only view the submission.

We can help you out entirely in this regard.

What are your requirements?

In reply to Venkatesh S

Re: New Virtual Programming Lab (VPL) module

by Jhon Carlos -

hi...

thanks a lot for the response ... how to achieve the screen in the screenshot , i.e accepted/rejected  and student details for very question , the normal submission view does not give this much details.. how to obtain such detailed submission view ?

In reply to Jhon Carlos

Re: New Virtual Programming Lab (VPL) module

by Venkatesh S -

Hi,

Let me explain you briefly the changes which we have done in VPL. Vpl is a plugin in moodle but we have changed it as an independent system. Dodo works independently with separate user management.

Once the student passes all test cases ,i.e on evaluation if he passes all the test cases   a grade of 100 is generated.This status we have changed as accepted state or rejected state.

We wanted to add multiple questions in VPL , So we customized those things in dodo to add as many questions based on our requirement.

Since it acts as an individual entity , We wanted to take reports on Individual's performance.

We shall soon upload the code in GIT and give you a link.

We are giving dodo as an open source to every university in India to conduct their academic lab.

We always look forward to help you.




In reply to Venkatesh S

Re: New Virtual Programming Lab (VPL) module

by deepa ganu -
Hi Venkatesh ,
WHat is this dodo
In reply to deepa ganu

Re: New Virtual Programming Lab (VPL) module

by Venkatesh S -

Hi Deepa,

Dodo is the customized version of moodle vpl. We wanted vpl to be an independent entity not as a plugin with separate user management system.So we made some code changes to it. Now moodle and dodo vpl are two independent systems.

We can group programming activities as per module basis. Instead of adding one program in an activity we can add a set of programs for the students to work.


Also we have added a question pool where every teacher can add questions to the pool and also view existing questions and add it to their course depending their needs.





In reply to Venkatesh S

Re: New Virtual Programming Lab (VPL) module

by deepa ganu -

So can I say dodo is a moodle sub system which concentrates more on the VPL than the entire LMS offerings ?

In reply to deepa ganu

Re: New Virtual Programming Lab (VPL) module

by Venkatesh S -

Yes Deepa you can consider dodo as a subsystem of moodle to suit Indian university needs.


We do have our own moodle with certain customizations as per our college needs.

Now dodo helps in enabling programming skills in students and moodle takes care of other aspect.

Finally students can generate their own record after getting all the test cases passed.



In reply to Venkatesh S

Re: New Virtual Programming Lab (VPL) module

by deepa ganu -

Can somebody point out the ideal options for vpl.conf file in moodle to support 300 users simultaneously. In the setting we have seen we can give any no of jail servers, vpl_servers so does load balancing happens automatically?

In reply to Venkatesh S

Re: New Virtual Programming Lab (VPL) module

by deepa ganu -
HI ,
We would be using this VPL module and JAIL server extensively in our university.
I need to know if you have any documentation of the system , apart from whats given on the site.
I would also like to know what configuration needs to be done for the system to achieve 5k users separately.
Are there any test cases ?
Deepa Ganu


In reply to deepa ganu

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Deepa,

I have not done a load testing on jail servers. But I share with you our experience. Our university (ULPGC) has 20,000 students and use Moodle for all courses. Our Moodle has installed VPL and the tool does not cause a significant burden on Moodle. In our case Moodle is supported with a cluster of servers with load balancing. We use five jail servers with 4Gb and execution 4CPUs each. The load on the jail servers is related to the number of users who perform execution actions simultaneously at VPL and the type of activity performed. Do not require the same resources a console program written in C that a GUI program written in Java.
Our experience is that it is possible to perform examinations of activities that required write, execute and evaluate programs in Java (without graphical interface) for 100 students simultaneously with only one server running with 4Gb and 4 CPUs. Note that the requirements of jail servers scale linearly. I think it is preferable to increase the number of jail servers that increase the power of one server. Remember that the system allows you to add and remove jail servers hot. Note that if you use 64-bit OS memory requirements will be much higher than the 32-bit OS to support the same load. In any case, if you reach the jail servers resource limits the only bad thing is that students must retry the action.

The last month has been posted a master's thesis (not related with me) that has studied the memory and CPU load on jail servers. Information on this topic is from page 76, but unfortunately it is in Spanish.

http://bibdigital.epn.edu.ec/bitstream/15000/11589/1/CD-6512.pdf

I hope this information helps.

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Charlie Daly -

Hello Juan Carlos,

I am using VPL on a Java programming course and  it works very well.


Now, however, I want to invoke a student class from my own main class. So, I will supply a class and and run that class. That means that I need to look at vpl_run.sh and vpl_evaluate.sh. I did this successfully with C/C++ last year.

For Java, I used the vpl_run.sh file that you supplied in your answer to Brandon in 2010 (see above dated Tuesday, 21 September 2010, 1:07 AM). I updated the path to work for java 1.7, though I don't think that is an issue because both java and javac are in /usr/bin on the jail server.

I decided to test it with a normal java program with a main method, that is, without using my main.java file.

However it doesn't work. When I click evaluate, it simply displays a popup which counts the number of seconds. If I delete this vpl_evaluate.sh file, then everything works as expected. The submitted program is compiled and run against all the test cases and a mark is supplied.


In order to debug the problem, I added a line to type out the vpl_execution.sh file which was created by vpl_evaluate.sh and then I executed that file on the jail server. The java program ran and was sitting waiting for input from the test cases. If I supplied input manually, then the program printed output as expected.

In short, when I create vpl_evaluate.sh, the java program is compiled and run but does not seem to be supplied with input from the test cases. Can you explain what I am doing wrong?

Thanks in advance,
Charlie

PS attached is the vpl_evaluate.sh file (slightly modified from your version)

Also I am using vpl plugin 3.1.2 and Moodle 2.9.1+ (Build: 20150828)
In reply to Charlie Daly

Re: New Virtual Programming Lab (VPL) module

by Charlie Daly -


Hello Juan Carlos,

I found a solution that works for me.

I could not make anything work with vpl_evaluate.sh, but if there was no vpl_evaluate.sh, then the following vpl_run.sh worked:


==============

#!/bin/bash

# compilation
NAME=DoubleX
javac -d . -encoding UTF-8 -cp . Main.java $NAME.java
if [ -f $NAME.class ] ; then

    printf '#!/bin/bash\n' > vpl_execution
    printf 'java Main\n' >> vpl_execution

    chmod +x vpl_execution
else
    echo "The program did not compile"
fi   
==================

Then evaluation will run as desired. My main program is compiled and run with the student's DoubleX.java file and so I can test it exactly as I would like. It uses the test cases in vpl_evaluate.cases and produces a mark for the students.

All the best,

Charlie

In reply to Charlie Daly

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Charlie,
vpl_evaluate.sh is the script to be run to prepare the evaluation of one student's code. If you set your own vpl_evaluate.sh you are replacing the default VPL code that use vpl_evaluate.cases to test the student's program. The default vpl_evaluate.sh use the current vpl_run.sh to generate the student's program. The current vpl_run.sh may be by default or customized, as you have done.

In this case, if you remove your own vpl_run.sh the default script will run your code. The only problem in the default script is that if the student creates its own main, the system will execute the student's main, and not the teacher's main.

Best regards.
Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Charlie Daly -

Thanks Juan Carlos


I didn't understand how vpl_run.sh and vpl_evaluate.sh interact. That makes it clearer,

Charlie

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Regis Smith -

Hi!  Thanks for creating this!  It saved my life!  One question: Is it possible to change the console background color?  The black background makes it impossible to see text on the old overhead projector I use in class.

In reply to Regis Smith

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Regis,
Your problem have no immediate solution (other TODO item)
I only can give you a small workaround. The terminal supports xterm escape sequence then you can use it to change the background and foreground color. For example, in C++ you can use reverse video:

#include <iostream>
int main(){
    std::cout << "\033[7m";
    std::cout << "Hello world!" << std::endl;
    return 0;
}

Best regards

Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Regis Smith -

Thanks!  I'll use that for now.


In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by rohit katariya -
Hi juan, we are using vpl for AI assignments.
In one of the assignments, we need to use LAMA(a planner) which will be used by each student. It needs to be compiled and then run on ubuntu systems when we are running it on systems. So what is the best way to use it with vpl?
Here's what I am thinking please tell if it is the best way or would you suggest some better way.

1. Compile LAMA on one of the jail servers(is it required to compile on jail server itself).
2. zip the compiled binaries(100 MB approx). convert to base 64 format.
3. add them to execution files.
4. unzip and use them.

Is there another way by which we can make it available at jail server itself so that we don't have to send the 100 MB file over network every time student calls run or execute?
In reply to rohit katariya

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Rohit,
Sending programs to the jail server in every execution has the advantage of the flexibility and not need to modify the jail server, but in this case it seems to be a very bad choice. I think that is better to install the software in the jail server that you need. Remember that you can use specific jail servers for different activities.

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by rohit katariya -
Actually it is not a software, it is more like libraries. I would like to place it in jail server so that they can be accessed while running the program. I'm a little confused, I can't get it were in jail server to put these files so that they can be accessed by student programs.
I am getting an error - connection failed when I try to upload the base 64 file of 85 MB may be there is a restriction on maximum size of file.

Actually students need to provide a file, this program that needs to be at jail server will parse it, produce a solution in a particular format, and then student will process it further to produce an output  that will be checked by the program.
In reply to rohit katariya

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Rohit,
I guess that LLAMA has a recommended installation place. Notice that the jail server exposes /bin and /usr directories, among others, to the executed code. You can access (read only) to these directories from your programs or scripts.

Best regards.

Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Anusha E -

Hi,Thanks for the  great plugin.Can you tell me how can we execute servelts and etc on VPL

In reply to Anusha E

Re: New Virtual Programming Lab (VPL) module

by deepa ganu -

Hello
I am trying to use this VPL module for more complex enviornments like j2ee , spring , hibernate , hadoop , etc. How do i add frameworks to VPL?

In reply to deepa ganu

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Deepa,
I haven't test to use an application server for Java in a jail server, but I think that it is possible to run it with some limitations. You must be aware that every execution start with the same data from the same point. If you manage to run a application server in user space then you 'll be able to run it in a jail server.
Note that
- You must choice a different port for every application server
- You can use firefox in the jail as browser
- The execution script must generate vpl_wexecution (not vpl_execution) to run in graphical mode

Best regards.
Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by deepa ganu -

How do we add third party jars and make jail aware of it ? eg: i need spring jars to be added so while compilation the code doesnt fail. Can you please tell me about that. I tried to set up my classpath in vpl_run.sh file to point to tomcat7 folder existing in /usr/share/tomcat7. but everytime i run the shell script it gives me /
/home/p16484/vpl_run.sh: line 6: cd: usr/share/tomcat7: No such file or directory
bin dev etc home lib proc tmp usr var
My script is

cd /
pwd

cd usr/share/tomcat7
ls


All i need is to set my classpath for compilation and want to deploy the *.war file in the tomcat7/webapps folder

In reply to deepa ganu

Re: New Virtual Programming Lab (VPL) module

by deepa ganu -

HI Juan ,

We need to extend the capabilities of jail so that it can support different environments along with its compilation and execution capabilities. We would like to use tomcat , zend , apache server along with the jail.

The first problem is I am not able to access these third party libraries within jail. Can you please help me out

In reply to deepa ganu

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Deepa,
I must say that the philosophy of the jail servers is that every execution task must run independently of others and modify the jail server.
I understand your needs, but if you want to succeed, you need to keep this philosophy in mind in any solution you give.
I think that running only one tomcat server to run .jsp or servlet would be a bad solution . You must give a solution that run independently of other tasks in the same server. I think that:
1) I think that to run servlets or JSP you need to start (and stop) a new instance of tomcat for every task, see
https://tomcat.apache.org/tomcat-7.0-doc/RUNNING.txt
Advanced Configuration - Multiple Tomcat Instances
2) To run PHP you can use the new PHP Built-in web server
http://php.net/manual/en/features.commandline.webserver.php
3) If you need to see static html files, you can use de default html script of VPL (do nothing)

Best regards.
Juan Carlos Rodríguez


In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by deepa ganu -

Hi Jaun ,

What about including third party jars , in order to compile some classes may refer to other libraries , how do we include support in jail server.

How can we install a new language in jail server ?

Do you have any documentation or architecture of jail server we need to refer to understand it better

In reply to deepa ganu

Re: New Virtual Programming Lab (VPL) module

by deepa ganu -

Hi Jaun,

By observing the way jail server works is ,

1. It sits on top of linux machine

2. It creates a mirror image (or a link) to the linux machine's /usr and /bin folders

3. Due to pt no 2. , what ever software we install on linux machine those software or libraries are available in the jail server

4. If I want to execute my app using the software which is not in the jail server , but available on linux . Can I do that ?

Currently my tomcat7 folder is available in /jail/usr/share/tomcat7. But in order to deploy the war file i need to paste it in tomacat7, since /jail/usr is read only , i am not able to paste . But if I need to paste the war file in /home/usr , within the jail server I cannot access /home.

How can I access /home within the jail ?

PLease help me

In reply to deepa ganu

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Deepa,
I will try to explain briefly what happen when a task is executed in a jail server.
1) The jail server receives a package of files, restrictions, type of execution (interactive or batch) and the script to start the task.
2) The system selects a new users that only exist in the jail. e.g. p10000
3) The system creates the user home directory /jail/home/p10000, inside the task it is see as /home/p10000
4) The system transfers the received files to the user home
5) The system launches the script as user p10000. The current directory is /home/p10000 and the environment vars are set properly. The user only has write access at /home/p10000, its home directory

The task executed in the jail server can't access the system /home folder. If you want to share files whit the jail, you must use other Linux directory as /usr, /var, /lib.

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by rohit katariya -

Hi again,

Needed your opinion on the following.
We are planning a coding assignment on a single instance of moodle running on a lab PC with 4 cores 8gb ram. It will be a 1 hour test, which 150 students will take up. Will this local instance of moodle be able to take up this load of 150 submissions simultaneously?

Jail server: we have 4 jail servers with 8 cores each, 8 gb ram each.


Regards,
Rohit Katariya

In reply to rohit katariya

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Rohit,
the number and power of jail servers are more than enough. If the Lab PC that are running the Moodle server uses Linux then it also will be enough. Beware that the Moodle server needs to be configured properly (PHP and DB connections).
Best regards.
Juan Carlos
P.D.: Please, report here your experience.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by rohit katariya -

Hi,

Is there a restriction that limits programs running in vpl jail servers to use only one processor?

I see MAXPROCESSORS variable in the vpl.conf file

#Maximum number of process
#MAXPROCESSES=500

These lines are commented out by default.

What is the default value set if we don't edit this?

my process need to access more than 1 processor.

In reply to rohit katariya

Re: New Virtual Programming Lab (VPL) module

by rohit katariya -

This is for processes. I want to change processors.

In reply to rohit katariya

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

The current version of the execution service does not support limiting the processor that is assigned to each task. It is only possible to limit the maximum number of simultaneous processes of a task.
The default value for MAXPROCESSES is 500. This is the max value that a task can request to the execution server.

The plugin sets by default the max number of processes value to 200.

The current version of the execution service can NOT restrict the number of processors that a task can use simultaneously.

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by rohit katariya -

Hi,

I installed vpl on a fedora system, I am able to run java program successfully, but I am getting the following error when I run c++ or c programs:


C++

g++: error trying to exec 'cc1plus': execvp: No such file or directory


c:
gcc: error trying to exec 'cc1': execvp: No such file or directory


I am able to run gcc and g++ commands from the terminal from the jail system but these commands are giving the above errors when run from run button on the editor.


Thanks.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by deepa ganu -

Has anyone tested VPL  with JMeter test plan. If yes can you share the test plans

In reply to deepa ganu

Re: New Virtual Programming Lab (VPL) module

by deepa ganu -

Can we use X-SendFile module for moodle so that all the files which go from the moodle server to execution server can pass through this module if yes , what path should we set in this array

$CFG->xsendfilealiases = array(
//         '/dataroot/' => $CFG->dataroot,
//         '/cachedir/' => '/var/www/moodle/cache',    // for custom $CFG->cachedir locations
//         '/localcachedir/' => '/var/local/cache',    // for custom $CFG->localcachedir locations
//         '/tempdir/'  => '/var/www/moodle/temp',     // for custom $CFG->tempdir locations
//         '/filedir'   => '/var/www/moodle/filedir',  // for custom $CFG->filedir locations
//     );

In reply to deepa ganu

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Deepa,

VPL has nothing related to x-sendfile. VPL uses XML-RPC protocol to send information to the execution server.
What problem are you trying to resolve with this configuration?

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by deepa ganu -

Can somebody point out the ideal options for vpl.conf file in moodle to support 300 users simultaneously. In the setting we have seen we can give any no of jail servers, vpl_servers so does load balancing happens automatically?

In reply to deepa ganu

Re: New Virtual Programming Lab (VPL) module

by rohit katariya -

Request is sent to server randomly. It is not sent to servers which were recently found unavailable or down.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by rohit katariya -

Hi juan,

I am running ./install-vpl-sh by sudo command or logged in as su, I am getting permission denied error while installation.

Please suggest why is this happening??


root@cerebrum:/home/others/jca142468/vpl-jail-system-2.1.1# ./install-vpl-sh 
INSTALLING VPL-JAIL-SYSTEM
==========================
./install-vpl-sh: line 9: installation.log: Permission denied
tee: installation.log: Permission denied
Detected Ubuntu or similar distribution (using update-rc.d)
Updating distribution software DB
./install-vpl-sh: line 27: installation.log: Permission denied
Installation log file => installation.log
Preparing the installation
Installing C++ compiler:
     make
./install-vpl-sh: line 29: installation.log: Permission denied
     g++
./install-vpl-sh: line 29: installation.log: Permission denied
Installing SSL library:
     openssl
./install-vpl-sh: line 29: installation.log: Permission denied
     libssl-dev
./install-vpl-sh: line 29: installation.log: Permission denied
Installing Firewall:
     iptables
./install-vpl-sh: line 29: installation.log: Permission denied
Installing X system:
     xorg
./install-vpl-sh: line 29: installation.log: Permission denied
Installing VNC server:
     tightvncserver
./install-vpl-sh: line 29: installation.log: Permission denied
Installing Window manager:
     xfonts-75dpi
./install-vpl-sh: line 29: installation.log: Permission denied
     xfonts-100dpi
./install-vpl-sh: line 29: installation.log: Permission denied
     openbox
./install-vpl-sh: line 29: installation.log: Permission denied
Installing Configuration DB system:
     gconf2
./install-vpl-sh: line 29: installation.log: Permission denied
Installing Web browser:
     firefox
./install-vpl-sh: line 29: installation.log: Permission denied
Checking installed software
./install-vpl-sh: line 107: installation.log: Permission denied
Compiling vpl-jail-server
./install-vpl-sh: line 109: installation.log: Permission denied
Updating installation => /etc/vpl
./install-vpl-sh: line 114: installation.log: Permission denied
cp: cannot stat 'src/vpl-jail-server': No such file or directory
cp: overwrite '/etc/vpl/vpl-jail-system.conf'? y
Found SSL certificate => Don't create new one
./install-vpl-sh: line 183: installation.log: Permission denied
./install-vpl-sh: line 184: installation.log: Permission denied
Do you want to install development software?
  (Ada, Assambler, C, C++, C#, DDD, Fortran, gdb, Haskell, Java, 
   JUnit, Node.js, Octave, Pascal, Perl, PHP, Python, Ruby, Scala,
   Scheme, TCL, valgrind)
(y/n)y
Do you want to install other development software?
  (Clisp, Clojure, Cobol, CoffeScript, D, Erlang, Go, Haxe, JQuery,
   Lua, R, Xquery, VHDL)
(y/n)n
This installation may take a long time
Installing Ada compiler (GNU):
     gnat
./install-vpl-sh: line 29: installation.log: Permission denied
Installing Assembler:
     nasm
./install-vpl-sh: line 29: installation.log: Permission denied
Installing C compiler (GNU):
     gcc
./install-vpl-sh: line 29: installation.log: Permission denied
Installing C# development framework (mono):
     mono-complete
./install-vpl-sh: line 29: installation.log: Permission denied
     monodevelop
./install-vpl-sh: line 29: installation.log: Permission denied
     monodevelop-debugger-gdb
./install-vpl-sh: line 29: installation.log: Permission denied
Installing DDD graphical front end debugger (GNU):
     ddd
./install-vpl-sh: line 29: installation.log: Permission denied
Installing Fortran compiler (GNU):
     gfortran
./install-vpl-sh: line 29: installation.log: Permission denied
Installing General purpose debugger (GNU):
     gdb
./install-vpl-sh: line 29: installation.log: Permission denied
Installing Haskell 98 interpreter:
     hugs
./install-vpl-sh: line 29: installation.log: Permission denied
Installing Java (OpenJDK7):
     openjdk-7-jdk
./install-vpl-sh: line 29: installation.log: Permission denied
     checkstyle
./install-vpl-sh: line 29: installation.log: Permission denied
Installing Junit framework:
     junit
./install-vpl-sh: line 29: installation.log: Permission denied
     junit4
./install-vpl-sh: line 29: installation.log: Permission denied
Installing JavaScript Node.js:
     nodejs
./install-vpl-sh: line 29: installation.log: Permission denied
Installing Octave (GNU):
     octave
./install-vpl-sh: line 29: installation.log: Permission denied
Installing Pascal compiler:
     fp-compiler
./install-vpl-sh: line 29: installation.log: Permission denied
Installing Perl interpreter:
     perl
./install-vpl-sh: line 29: installation.log: Permission denied
Installing PHP interpreter:
     php5-cli
./install-vpl-sh: line 29: installation.log: Permission denied
     php5-sqlite
./install-vpl-sh: line 29: installation.log: Permission denied
Installing Prolog:
     swi-prolog
./install-vpl-sh: line 29: installation.log: Permission denied
Installing Python interpreter:
     python
./install-vpl-sh: line 29: installation.log: Permission denied
     pydb
./install-vpl-sh: line 29: installation.log: Permission denied
     python-tk
./install-vpl-sh: line 29: installation.log: Permission denied
Installing Ruby interpreter:
     ruby
./install-vpl-sh: line 29: installation.log: Permission denied
Installing Scala programming language:
     scala
./install-vpl-sh: line 29: installation.log: Permission denied
Installing Scheme interpreter:
     plt-scheme
./install-vpl-sh: line 29: installation.log: Permission denied
Installing SQL interpreter:
     sqlite3
./install-vpl-sh: line 29: installation.log: Permission denied
Installing TCL interpreter:
     tcl
./install-vpl-sh: line 29: installation.log: Permission denied
Installing Valgrind tool:
     valgrind
./install-vpl-sh: line 29: installation.log: Permission denied
/sbin/start-stop-daemon: unable to stat /etc/vpl/vpl-jail-server (No such file or directory)
 * Daemon not started

In reply to rohit katariya

Re: New Virtual Programming Lab (VPL) module

by Srinivasa reddy konda -


We are trying to configure vpl-jail-server, we could successfully installed.

When we are trying to edit the file /etc/vpl/vpl-jail-system.conf.


we have set the URLPATH=http://123.176.38.3:8080/moodle

When we Start the service

  • sudo service vpl-jail-system start
we are facing the problem with following error message.

/sbin/start-stop-daemon: unable to stat /etc/vpl/vpl-jail-server (No such file or directory)
 * Daemon not started
Please guide us, in this regard.


In reply to Srinivasa reddy konda

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Srinivasa,
Beware that URLPATH is used to set the path of the jail server, but not the URL of the Moodle server. This var is used as a keyword for your jail server and it seems that you are misusing this feature.
For example if you set URLPATH=/Secret in a jail server named "myjailserver.in" then you must set at the VPL plugin setting in your moodle server (Dashboard>Site administration>PluginsActivity>modules>Virtual programming lab):
http://myjailserver.in/Secret

see screenshot.

then the VPL plugin at your moodle server will know how to contact with the jail server. The jail server does not will accept requests from server that does not use this URL (http://myjailserver.in/Secret).

The problem that you shown starting the service has nothing related with the previous one. It seems that you have lost the daemon of the service. Try reinstalling the jail system, you don't need to reinstall the OS.

Best regards.

Attachment Captura.JPG
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Nishant Agrawal -

Hi Juan,

There are some clarifications which I need, please reply if you can help. 

1) Does VPL work only through Jail Server ?

2) And does Jail Server is supported only for Ubuntu and CentOS ? 

   or Can we make VPL work on WINDOWS SERVER 2012R2? 

Thanks smile

In reply to Nishant Agrawal

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Nishant,
A1) Yes, VPL works only  through Jail Servers
A2) VPL is supported only for Ubuntu. The current versión has some problems with last versions of RedHat/CentOS (it will be resolved in the next jail server release). Notice that Moodle+VPL plugin can work on  WINDOWS SERVER 2012R2, but VPL needs jail servers in order to run programs.

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Nishant Agrawal -
Thanks for your reply Juan Carlos smile
In reply to Nishant Agrawal

Re: New Virtual Programming Lab (VPL) module

by deepa ganu -

Hi Jaun ,

Today we tried to launch the lab for 300 users but it was a big failure. All the students got a connection time out error. and when we checked it in the admin panel we got


Attachment gg.150_moodle_mod_vp.png
In reply to deepa ganu

Re: New Virtual Programming Lab (VPL) module

by deepa ganu -

please let us know why this error came ? Also can you point out the file which sends the XMLRPC request to jail server

Attachment dsdas.png
In reply to deepa ganu

Re: New Virtual Programming Lab (VPL) module

by Venkatesh S -

Deepa,

 There are lot of ways a connection time out error can happen. Can you explain how did you add the activity along with its settings.

Only two days back we had lab sessions for around 250 users simultaneously.

We have more than 1000 users as of now and we have not faced any problem . Even we have checked the server load. It has not even reached half the load so far.


regards,

Venkatesh

In reply to Venkatesh S

Re: New Virtual Programming Lab (VPL) module

by Jean Martina -

We sometimes get issues with the jail server when the VPL is misconfigured. Either giving the running job to few space or to few memory. As a default we try to give student a reasonable amount of memory and to avoid interactive sessions with the execution.


Jean

In reply to deepa ganu

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Deepa,
This is a bad news.
I see two things in your picture:
1) You are using a private IP for your jailserver.
2) Your Moodle server has no problem to access to your jail server.

Beware, if you use a private IP for your jail server, you will only can access to the server from clients in the same private net range.
It is very strange that all students got a "connection time out error". May be that your lab have no access to your jail server.


The XMLRPC request is done from this code

https://github.com/jcrodriguez-dis/moodle-mod_vpl/blob/master/vpl_submission_CE.class.php

But the jail server wait also for webSocket connections from the client's browser.


Best regards.

Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Nishant Agrawal -

Hi Juan ,

is this below URL  up  for  test use ? as I am not able to run program.
 http://demojail.dis.ulpgc.es

In reply to Nishant Agrawal

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Yes, this server is for test use.
If have some problem, please make a detailed report of your problem and conditions to reproduce it.

Best regard.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Nishant Agrawal -

Hi Juan ,

I am trying this URL (http://demojail.dis.ulpgc.es) for test use.

and I am following this hello world tutorial for VPL for test purpose.

http://cs.smith.edu/dftwiki/index.php/Tutorial:_Moodle_VPL_--_A_Java_Hello_World_Program

Its getting connected to Server its seems but I am not able to see output on console.

PFA screenshot.


Attachment vpl1.png
Attachment vpl2.png
In reply to Nishant Agrawal

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Nishant,
your configuration seems to be correct. Really you don't need "vpl_run.sh", VPL will add automatically the default "vpl_run.sh" for Java.

Please, show your code to try to reproduce your problem.

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by rohit katariya -

Hi,

I am using mpicc and trying to run using mpirun on jail server. I am able to run this independently on jail server without using moodle, but when I submit it through moodle I am getting the following error:

--------------------------------------------------------------------------
mpirun noticed that process rank 0 with PID 65655 on node cerebrum exited on signal 25 (File size limit exceeded).
--------------------------------------------------------------------------

This posts suggests that the error can be removed by changing the block size. But I can't find the /etc/security/limits.conf file. Please tell how to make it right.

Regards,

Rohit

In reply to rohit katariya

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Rohit,
I see that the error message is "File size limit exceeded".
It may be that you need to increase "Maximum execution file size" and "Maximum default execution file size" values in the plugin configuration and remove limits in the activity configuration.
(See plugin config picture)

Best regards.

Juan Carlos.

Attachment Captura.JPG
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by rohit katariya -

Thanks! Error removed by changing /etc vpl config file.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by rohit katariya -
I am getting following error when trying to run mpicc on vpl on fedora machine:
--------------------------------------------------------------------------
Open RTE was unable to open the hostfile:
    /etc/openmpi-ppc64/openmpi-default-hostfile
Check to make sure the path and filename are correct.
--------------------------------------------------------------------------
[mangal.cse.iitd.ac.in:21738] [[53897,0],0] ORTE_ERROR_LOG: Not found in file base/ras_base_allocate.c at line 248
[mangal.cse.iitd.ac.in:21738] [[53897,0],0] ORTE_ERROR_LOG: Not found in file base/plm_base_launch_support.c at line 99
[mangal.cse.iitd.ac.in:21738] [[53897,0],0] ORTE_ERROR_LOG: Not found in file plm_rsh_module.c at line 1173
Please tell me how to resolve this.
In reply to rohit katariya

Re: New Virtual Programming Lab (VPL) module

by rohit katariya -
this is my execution file.

#! /bin/bash
#export PATH="$PATH:/usr/lib64/openmpi/bin/"

headtext=$(<assignment6.c.head)
maintext=$(<assignment6.c)
if "$maintext" != "$headtext"* ; then
    echo "Change only the parts of the code you are supposed to edit. Code won't be evaluated if changes are done elsewhere. To reset the file go to options->reset files."
else
cat > vpl_execution << 'EOF'
#! /bin/bash
export PATH=/usr/bin:/usr/local/bin:/bin
#ls /usr/local/sbin

export LD_LIBRARY_PATH=/usr/lib64/openmpi/lib/:$LD_LIBRARY_PATH
/usr/lib64/openmpi/bin/mpicc assignment6.c evaluate.c evaluate.h -o assignment -w -lm
/usr/lib64/openmpi/bin/mpirun -np 4 ./assignment 16384 inputFFT.txt outputFFTWN.txt 1

#rm evaluate.h evaluate.c
#echo "run complete"
EOF
 
chmod +x vpl_execution
fi
In reply to rohit katariya

Re: New Virtual Programming Lab (VPL) module

by rohit katariya -

This library folder is not being copied to the jail server.

/etc/openmpi-ppc64/

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by deepa ganu -
HI Juan,
We have successfully launched the lab for around 200 students, it worked fine, except  for the problem described below :
About 50 students were having android tablets. These students could  edit and save the program , however when they tried to execute the console window appeared but keyboard was not visible. We are currently using VPL version 3.1.4

 Apparently version updates page lists this issue as given below :

"In tablets and mobiles, although editing and execution of textual and graphical programs are possible, text input during execution is unavailable because the keyboard is not displayed."

This issue is listed as known issue for in the release notes for 3.0 and as per the release notes of 3.1.4 it appears to have been fixed. However we are still facing this issue.

VPL 3.1.4

Changes from VPL 3.1.3

  • Fixes incompatibility problems with Essential theme
  • Fixes problem editing in tablets and mobiles
  • Fixes error uninstalling the plugin
  • Converts submitted files of type jar, zip, jpg and gif to base64 format



In reply to deepa ganu

beginners help ...

by Sonja Sperber -

Hi,

lately we switched back to VPL.

We set up our own VPL - Server on our root server.

Unfortunately, if  I file a program via the web interface in moodle

and click „execute“ the Console is shown via Javascript-Overlay

with following error message:


/home/p14022/.vpl_launcher: line 9: ./vpl_execution: Permission denied


When click the Console away there is another error message on the 

right hand of the program code saying:

collect2: error: ld terminated with signal 25 [File size limit exceeded], core dumped


I can imagine I have to change the limits in the 


/etc/vpl/vpl-jail-system.conf …?


Can someone of you get me started to get the VPL (Server)

running ?

Thanks a lot!

Cheers

Sonja

In reply to deepa ganu

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hello Deepa,

the problem solved in 3.1.4 was "editing source code", but not, input text in the console.

Sorry for the inconveniences.

We will try to resolve in the next release.

Best regards.
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by deepa ganu -

Hi Jaun,

Can you please let us know that when is the next release.I would like to resolve it with your help of course. Can we have a Skype call ? My Skype username is deepa.ganu

In reply to deepa ganu

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello deepa,
the next release is scheduled for January.
Due to your urgent needs I will try to resolve this problem first and backport it to the 3.1 serie and release a fix version.

Of course if you find the solution first, it will be wellcome.

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by deepa ganu -

Hi Juan.
We have found the fix and tested it. It is working on Android devices. All I did was replaced the term.js in vpl module with the fixed version for this problem of term.js.
Please incorporate the changes mentioned in
https://github.com/chjj/term.js/commit/0b10f6c55d5113d50d0ff94b6c38a46375a5f9a5
And console editor would work.
Please let me know if u run into issues.

In reply to deepa ganu

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Deepa,
Thanks for your suggestion, I tested the new "term.js" and I have found problems on Android and IPad, but I have proposed modifications to this software that I think resolve the problem, see
https://github.com/jcrodriguez-dis/term.js

Best regards.
Warning: this software and the Ace editor, don't works with Firefox in Android.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by deepa ganu -

While testing even we found issues , like it doesn't work for a word , but a character , so we disabled the auto correction in android devices ,and it works like a charm for us

In reply to deepa ganu

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Deepa,

Have you tested the https://github.com/jcrodriguez-dis/term.js version without disabling autocompletion on Android and IPads?

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by deepa ganu -

Yes , I have , it doesnt take anything , you have to click outside the console , so that the keyboard disappears , get the keyboard back again , hit "enter" and then the auto completed word would appear.

I guess there is some problem with flusing the output from the android devices. For iPad , I havent done the testing

In reply to deepa ganu

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
I want to reproduce this behaviour. Please, let me know your test conditions: Android version and browser you used.

Best regards.
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Neider Vergara Humánez -

Hi Juan.

I'm using Google chrome in my pc, with progress bar version 2.0, VPL 3.1.1, Moodle 2.7.3


Thanks.

In reply to deepa ganu

Re: New Virtual Programming Lab (VPL) module

by deepa ganu -

Hi Juan,

In our lab most of the students have Android tab, so we would need to edit the current code for the console to accept the input.We are even thinking of another option which is as follows:I think fix should do something like this

a)Add an input and output button after run.

b) when the input button is selected a panel must open and accept the input.

c)when run is selected an input file should be created on the jail server.This file must contain the text accepted in the previous step and also should be 

named carefully based on the sessiom and user.

d)the run script should be more like the current evaluate script .the output of the new run script will be in file which will then be displayed in the output box.Can you please point out which code files need to be modified.

Which option is the best? Fixing the current code or modifying as mentioned above

In reply to Juan Carlos Rodríguez-del-Pino

Bash/Shell Script in VPL/Moodle

by Alisson Souza -

I am trying to organize some questions in Moodle/VPL for tests, homeworks etc. I got to run and evaluate some question with successful. But, some doubts arose...

Before proceeding, I put the files that worked (the only one form that I found that worked):

teste.sh #student's  file
#!/bin/bash
output="test"
-----------------------------------------------------------------------------------------------
vpl_run.sh #professor's file
#!/bin/bash
./teste.sh
-----------------------------------------------------------------------------------------------
vpl_evaluate.sh #professor's file
#!/bin/bash
. ./teste.sh
cat >vpl_execution <<END_SCRIPT
#!/bin/bash
if [ $output = "teste" ]
then
    echo "Grade :=>>100"
else
    echo "Grade :=>>0"
fi
END_SCRIPT
chmod +x vpl_execution
-----------------------------------------------------------------------------------------------------
Doubt 1: How do I, for the student in teste.sh, not give a cat or modify the vpl_evaluate.sh file?

Doubt 2: How do I to give a mkdir or touch, by click on Run, so that the directories or files created stay visible by click on Evaluate (or the opposite: click on Evaluate and after Run)? The files don't stay recorded...
In reply to Alisson Souza

Re: Bash/Shell Script in VPL/Moodle

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Alisson,

Answer 1)  First, you must move running teste.sh to the vpl_execution file. Of course you can redirect the standard output and standard error of teste.sh to any file. If teste.sh modify "vpl_evalaute.sh" (after the move vpl_execute) it will not have effect in the current execution.

Answer 2) Every run, debug, evaluate are independent and all files created in the jail servers are removed.

Your modified vpl_evaluate.sh would look like this

#!/bin/bash
cat >vpl_execution <<END_SCRIPT
#!/bin/bash
. ./teste.sh  1>/dev/null 2>/dev/null
if [ $output = "teste" ]
then
    echo "Grade :=>>100"
else
    echo "Grade :=>>0"
fi
END_SCRIPT
chmod +x vpl_execution
Best regards.
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Garth Brady -

I'm a huge fan of this plugin and am just getting my feat wet with it now...

I teach an introduction to web programming course for high school students.  I plan to use VPL with php and have a few questions:

I would like VPL to auto evaluate a student program according to certain parameters which I delineate in a customEval.php file similar to customEval.py as outlined in your

.  

1.  Can I write this customEval.php in php or does it need to be in python?
2.  Is there any easier way?

Many thanks!

In reply to Garth Brady

Re: New Virtual Programming Lab (VPL) module

by deepa ganu -

Hi would you be deploying this module in an http server how did u set up apache with jail


In reply to deepa ganu

Re: New Virtual Programming Lab (VPL) module

by deepa ganu -

Hi Juan , is there a way where the code i have given in the requested file should stay , the student should not be able to edit it

In reply to deepa ganu

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Deepa,
if you want to keep part of a file read-only , at this moment there is no way to get it. But if you want to show a file in the requested files that the student can change we use this workaround:
1) We add the file (e.g. Tools.java) to the requested files, and add a comment that say something like "the modifications in this file will not have effect". Notice that the students can modify this file
2) We add the same file (Tools.java) to the execution files.

When the system prepares an execution the last files taken are the execution files, replacing any file with the same name, then it will always uses the one in the execution files.

Best regards.

In reply to deepa ganu

Re: New Virtual Programming Lab (VPL) module

by Garth Brady -

Yes, moodle is installed on a ubuntu-based server,  but VPL is not configured to make use of  an Apache jail.  Is this necessary?  Would this require an Admin user to configure this?

In reply to deepa ganu

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Deepa,
I guess you are trying to use a jail service in a server that also have an Apache web service. First I must say that I think that this is a very bad idea, because the jail service may reduce the performance of the web server y add security risks. But if you want that an Apache service cohabit with the jail server it is easy, select a different network port(s) for every service.

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Garth Brady -

Hi Juan,

Are you speaking to me?  I'm really quite confused...

In reply to Garth Brady

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hi Garth,
sorry, but I was answering to Deepa Jaanu. I thought that your question was to Dominique Thiebaut the author of the video you shown.

Trying to answer your question:
A1) There is no need to be in a concrete programming language. Just one that runs in VPL and that can do what you need.
A2) I don't know if the default VPL method that uses I/O test cases is easy for you. If you are trying to test web programs written in php this method may be very bad for you, I think that there is no easy solution to your needs.

I am going to give you a good present for your needs. Use the attached "php_run.sh" file as execution file "vpl_run.php" and you will get an environment to run php web programs inside VPL. Use index.php as start page.

Best regards.
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Garth Brady -

"I am going to give you a good present for your needs. Use the attached "php_run.sh" file as execution file "vpl_run.php" and you will get an environment to run php web programs inside VPL. Use index.php as start page."

Thanks so much for this custom vpl_run.php file!  You are very kind!  I have a few more questions, so let me explain what I have done:

Under Advanced Settings -> Execution files, vpl_run.sh, vpl_debug.sh, vpl_evaluate.sh, vpl_evaluate.cases are all empty.  I made a new file here called vpl_run.php which contains the code you wrote in php_run.sh above. 

  1. Is this correct?  Is this what you intended for me to do?
  2. I don't currently see any difference when using this file...  I'm sure there are differences, but I don't understand the benefit.  Can you please tell me why this file is helpful?
  3. What do you mean by, "Use index.php as start page."  Where should this be?

Many thanks again!

In reply to Garth Brady

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Oops!
I wrote a typo, the name of the file must be "vpl_run.sh" and not "vpl_run.php",

If you are writing a web application, then you must write a start page. Using this script your start page must be "index.php".

This script launches the built-in web server of PHP and the web browser on the jail server to execute your web application.

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Garth Brady -

I thought that was a typo, but just wanted to double-check.  So, I made this change and am attempting to run a Hello World! program named "index.php", but now when I "run" it, a blue window pops up and gives an error (out of Memory 64Mib).  If I click evaluate, I get the error: 

<|-- -The compilation or preparation of execution has failed ====================== It seems you are trying to test a program with a graphic user interface --|> Grade :=>>0.00000


In reply to Garth Brady

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Garth,
To remove the problem of 64MB you need to increase the memory limit of your activity going to "Advanced setting -> Maximum execution resources limits"
The script lets you run web application written in php, but I don't say nothing about automatic evaluation, this is a more complex problem that I have not try to resolve yet. VPL don't gives you more tools that the available outside of VPL. The question here is, how you test a web application outside of VPL?  then try to reproduce the task in VPL.

Best regards.

Attachment Captura.JPG
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Garth Brady -

Many thanks, once again, Juan!

I did not initially understand what the php variation on vpl_run.sh was intended to do, but now I understand what you're talking about and I see how it would be rather difficult to evaluate this automatically...  In an ideal world, the php script would be able to interact with a MySQL db and VPL could evaluate these scripts as well.

For others interested in seeing how things turned out, please see the screenshot below.  Essentially, Juan's script initializes Firefox on the VPL server and renders a preview of it inside the client's VPL window.  Very impressive.


In reply to Garth Brady

Re: New Virtual Programming Lab (VPL) module

by deepa ganu -
Hi Jaun ,
Just like how you created the php_run.sh , for php web programs , can we do it for java ? Can you please help me understand how should it be done for java web programs ? I would be highly obliged.
In reply to Garth Brady

Re: New Virtual Programming Lab (VPL) module

by Reza Ervani -

Hi Garth,

Where is this "index.php" (with text "test" in your screenshot) location exactly in VPL server ?

Is this index.php file is in /jail/var/www/html ?

Thank you,

In reply to Reza Ervani

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hello Reza,
the default script for PHP of VPL uses built-in server of PHP. The files served are in the home directory of the temporal user.

Best regards,
Juan Carlos


In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Reza Ervani -

Thank you Mr. Juan

And where this home directory of temporal user ? Is it at /jail/home ? Is it permanent or also temporary folder and automatically deleted after execution in Moodle ?

Where should I put default script of PHP in VPL server ?

Thank you very much for assistance Sir,

Best Regards,

Reza


 

In reply to Reza Ervani

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

- The temporary home directory is "/jail/home/[username]"
- The directory is deleted after the execution
- The default script of PHP is in your moodlen server at "/mod/vpl/jail/default_scripts/[language scripts]". But notice that you don't need to change the default script, you only need to set the script "vpl_run.sh" in the "execution files" of your activity. Also you can use "based on" feature to replicate easily your scripts.

best regards,
Juan Carlos


In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by deepa ganu -
Hi Juan,
1 My simple question is how do I teach students web programming using servlets and jsps through your module ? Is it possible in the current release?
2.How do introduce third party libs so that jail can compile my programs without a compilation error
3. /\d*[02468]$/ this reqular expression is in POSIX format , still it doesnt work in VPL. It to test that an output would always be an even no.
In reply to deepa ganu

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Deepa,
Answer 1) I don't know if it's possible to run JSP and servlets in VPL, I never have tried it, but  I suppose that it is possible.
Answer 2) I don't know your problem, please give the details to try to solve it.
Answer 3) Using $ seems the problem, it forces to don't output a new line. To optionally accept new lines, you must uses /\d*[02468]\n*/ or more strict /\d*[02468]\n?/

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by deepa ganu -

How can I introduce third party library files in VPL , eg :  i have created a lib with name deepa.jar , it contains user defined functionality.

I need this jar to be available in jail server. How do I put it in jail server ?

In reply to deepa ganu

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Deepa,

The easy way to add third party library files in a VPL activity is add this lib to the execution files (if the lib need to be at the execution stage, remember to mark it as "Files to keep when running"). Currently the system don't support binary files then you must convert it to base64 and add ".b64" extension to the file. The default script will decode the base64. Eg: deepa.jar must be encoded to base64 and renamed to deepa.jar.b64


Best regards.

P.D.: The 3.2 version will remove this problem.


In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by deepa ganu -

Jaun ,

I need help for web application in VPL , Ihave posted several question can you please answer them . It would be quite useful

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Neider Vergara Humánez -

Hi every one.

Some teachers of my site asked to me about installing a progress bar plugin to follow activities, but my VPL activities are not available to appear in the prograess bar, somebody have info about this subject? 


My Moodle version is 2.7 and i'm usin VPL 3.1.1


Thanks for your attention.

In reply to Neider Vergara Humánez

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Neider,

the "Progress Bar" block needs to know (programmatically) about every type of resource or activity that use. I have forked the block in github and I have added support for VPL.

https://github.com/jcrodriguez-dis/Moodle-block_progress

I have requested to the developer to accept these changes. I think that it will be better to wait for the answer from the developer than using the forked version.

Best regards.


In reply to Neider Vergara Humánez

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hi Neider,

Progress Bar block has just release a new version that adds support for VPL.
https://github.com/deraadt/Moodle-block_progress

Get the new version from
https://moodle.org/plugins/pluginversions.php?plugin=block_progress

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Alexey Onishenko -

Hello!


is it possible to use any MATLAB toolbox function, available on the execution server with matlab installed with corresponding toolboxes?


As I understood VPL, It's possible to output any graphic data from script execution, because VPL uses interactive pipe between virtual X window and compiler\executor output. 


Is it to hard to integrate matlab support to VPL?

Many thanks for your answers. 

In reply to Alexey Onishenko

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Alexey,
VPL may run any application that run on the execution server as non privileged user. The use of graphical applications are limited to the execution on X-Windows VNC server. By default on Ubuntu VPL use tightvnc, if you need 3D technology (OpenGL, etc) you must use tigervnc or other 3d capable vnc server.
If you have special needs to run Matlab you may change the default matlab script
https://github.com/jcrodriguez-dis/moodle-mod_vpl/blob/master/jail/default_scripts/matlab_run.sh

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Alexey Onishenko -

Thank you very much for your great project and detailed answer!


Wish you the best!

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Asier Sampietro Alberdi -

Buenas Juan Carlos,

I am having some troubles in order to upload a code file to the demo site. Do I have to install some plugings in my browser to do so? I tryed different browsers with the same result. I put behind a capture of what it shows. Also in the edit part of the exercise, neither edit or console seems to work.

I am really interested in this plugin, but I need a bit of help.

Attachment Captura.PNG
In reply to Asier Sampietro Alberdi

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Buenas Asier,

Oops!, I have configured the demo site more restricted than needed. The configuration problem has been resolved.

Thanks for your bug report.

You don't need any plugin, you only need an updated browser.

You also say that "the edit part of the exercise, neither edit or console seems to work", please tell your OS and browser to replay the problem.

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Asier Sampietro Alberdi -

Well now I can upload the files and it works perfect.

I use a Win7 x64 and I have tryed in many browsers like Firefox, Chrome, IE7 or Opera, always with the same problem.

Gracias por la respuesta!

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Jhon Carlos -

Hi ..

I found an option " this activity act as an example" ..

What is its uses and how to use it ?
When i click it , students are not getting "run" option .

In reply to Jhon Carlos

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello John Carlos,
This feature is to show programs ready to run to the students. The students can't not modify the code. The code must be supplied by the teacher as required files.

Best regards.
Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Jhon Carlos -

but students are not getting an option to run in their windows..

In reply to Jhon Carlos

Re: New Virtual Programming Lab (VPL) module

by deepa ganu -

For that activity you need to go to execution options and select run as yes

In reply to Jhon Carlos

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hello John Calors,
It seem that you have found a big bug that has not been detected for a long time.

Sorry for the problems that this bug can be causing.
This problem will be resolved in next release.

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Jhon Carlos -

but students are not getting an option to run in their windows..

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Nijesh W -

Hi Juan.

There is any possibility to run shell commands using VPL?

In reply to Nijesh W

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Nijesh,
Yes, it's possible.
But current default script to run shell script has a bug.
Replace your ../vpl/jail/default_scripts/shell_run.sh with the file attached or uses it's content as vpl_run.sh in the activity that run a shell script.

Best regards.

#!/bin/bash
# Default script to run Shell scripts
# Copyright Juan Carlos Rodríguez-del-Pino
# License http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
# Author Juan Carlos Rodríguez-del-Pino 

#load common script and check programs
. common_script.sh
cat common_script.sh > vpl_execution
cat $VPL_SUBFILE0 >> vpl_execution
chmod +x vpl_execution
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Rajesh Kedia -

Hi,

I am trying to setup an execution server to use VPL with Moodle. I followed the instructions and the execution server is ready and working when I check for the OK page. Even in moodle, the check execution server reports success.

But when I upload an assignment and then evaluate, the window saying Connection Fail shows up. Surprisingly, when I check the /jail/home folder in my execution server machine, I see that the required files were copied and executed successfully. But still Moodle showed connection fail message.


Could you please help on what could be going wrong?


--rajesh

In reply to Rajesh Kedia

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hello Rajesh,
This problem can arise if you are using a jail server into a private network (IP not reachable from internet). You must use a jail server with a public IP.
Other possibility is the presence of some type of proxy in your network. Some proxies cannot manage websocket connections breaking the connection from the browser to the jail server. In the last case you can bypass the proxy using a cipher connection (https and wss). You can force the use of wss selecting it in the VPL plugin general setting.

Best regards.
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Rajesh Kedia -

Hello Juan,

To give you some more details, I am not the moodle site administrator, but have the Teacher privileges for a particular course. I am setting up a local execution server since I need some additional softwares which are not present on the site-wide default execution servers.

Now the problem is that there is proper communication for VPL when I use the site-wide exec. servers, but the problem is the missing software. But when I use only the local exec. server, I end up in the problem that I mentioned (the files are copied and executed, but the status shows connection fail). With this, I believe that the settings in Moodle may be correct and there may be something that is going wrong in my local exec. server setting. I am using firewall=0.

To give some details of the network, the local exec. server and the site-wide exec. server are both on private IP addresses and I am accessing moodle also from the same IP address. We have a proxy server to access the internet if needed.


--rajesh

In reply to Rajesh Kedia

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hello Rajesh,
I think that your problem is related with your network configuration. Try configuring your browser to avoid the use of your proxy to access your local network (private IP). Try using https to access your moodle server to switch to wss without changing the plugin setting.

Best regards.
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Rajesh Kedia -

I setup the browser with No proxy, but the problem persists.

Our moodle uses https for authentication but beyond that it is http only. I tried using https also, but no difference in this behavior.

In reply to Rajesh Kedia

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Rajesh,
with the information I have about your problem, I can't give you new advice to try to resolve your problems. I think that you must contact with your network managers and you must search for network configuration differences of the common jail server and your own  jail server.

Best regards.
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Rajesh Kedia -

Dear Juan,

I will work with the administrators here. As of now, I think the quickest solution is to install the required software on the working server and get ahead.

I will post if I find the actual cause of the issue.

Thanks for your help.

--rajesh

In reply to Rajesh Kedia

Re: New Virtual Programming Lab (VPL) module

by Rajesh Kedia -

Hi Juan,


Finally I got it working.

I was using the IP address as it is. But when I prepend it with http, it works. e.g. If IP is 10.X.Y.Z, I was using it as 10.X.Y.Z/urlpath in execution server list in moodle. When I add http to it (http://10.X.Y.Z/urlpath), it worked.


It was a simple stuff, but took a lots of time unfortunately.


Thanks for your time.


--rajesh

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Jhon Carlos -

we are trying it to use for our students . so can we add a print option to it ?

like the students type the program and evaluate it .. the print option could print or download the students program along with output !!


Possible ? Please help.

In reply to Jhon Carlos

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Jhon Carlos,
currently there is no print option, but you can go to "Submission view" and print the page. You also can download the submitted files (but not the evaluation result)

Best regards.

Attachment Captura.JPG
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Nived Narayanan -

okie juan...

Can we modify the contents that's being added in the submission file. Currently only the program is being download/ added right , can we also include the description of the vpl activity to it ? 
by modifying the downloadsubmission.php ?

In reply to Nived Narayanan

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Nived,
VPL is released under GNU GPL v3. You can customize it under its licence conditions. To get the activity description as a file in the download zip file, you must modify or replace the use of file_group_process::download_files at filegroup.class.php.

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Jhon Carlos -
oh that's a great idea to impliment .


Juan , kindly guide me please..

In our college we would required to add these :

Aim : <the name of vpl module>
Program : <the program>

 in the downloaded file , everything is displayed in one line . please help me change it , we really require this support from you Juan !!

In reply to Jhon Carlos

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello John,
please, give me more detail about your request.
I don't have enough information to understand the context of "in the downloaded file , everything is displayed in one line".
have you modified the VPL code and you have a problem ?
Beware that all source code submitted/edited in VPL is encoded in UTF-8 and line terminated in UNIX/linux format.

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Nived Narayanan -

okie jaun...

Can we modify the contents that's being added in the submission file. Currently only the program is being download/ added right , can we also include the description of the vpl activity to it ? 
by modifying the downloadsubmission.php ?

In reply to Juan Carlos Rodríguez-del-Pino

MYSQL

by deepa ganu -

Hi I have installed mysql server on the jail server . I want to launch the mysql client via our script .

Currently my script is as follows 

#!/bin/bash

# $Id: sql_run.sh,v 1.4 2012-09-24 15:13:22 juanca Exp $

# Default SQL language run script for VPL

# Copyright (C) 2012 Juan Carlos Rodríguez-del-Pino

# License http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

# Author Juan Carlos Rodríguez-del-Pino <jcrodriguez@dis.ulpgc.es>


#load common script and check programs

. common_script.sh

#check_program mysql

#Generate execution script


cat common_script.sh > vpl_execution

#search and add .sql files not from submission


#save submission files

for FILENAME in $VPL_SUBFILES

do

mv $FILENAME $FILENAME.vpl_save

#security check

if [ -f $FILENAME ] ; then

rm $FILENAME

echo "removed $FILENAME"

fi

done

for FILENAME in *

do

NAME=$(basename $FILENAME .sql)

if [ "$FILENAME" != "$NAME" ] ; then

echo "mysql --host=172.20.36.151 --user=monty  --password=some_pass < $FILENAME" >> vpl_execution

fi

done

#restore submission files

for FILENAME in *.vpl_save

do

NAME=$(basename $FILENAME .vpl_save)

mv $FILENAME $NAME

done


#search and add .sql files from submission

for FILENAME in $VPL_SUBFILES

do

NAME=$(basename $FILENAME .sql)

if [ "$FILENAME" != "$NAME" ] ; then

echo "mysql --host=172.20.36.151 --user=monty --password=some_pass  < $FILENAME" >> vpl_execution

fi

done

#interactive console

#echo "mysql --host=172.20.36.151  --user=monty  --password=some_pass" >> vpl_execution

chmod +x vpl_execution


It allows me to run , but sometimes I get the error 

./vpl_execution : mysql :command not found

I get this error once in a while , like 5 times if I run I will get it once, even if I have set the PATH 

export PATH = /usr/bin/mysql:${PATH}

In reply to deepa ganu

Re: MYSQL

by Prakash Raju -

hi deepa ganu,

I am pretty much sailing in the same boat like you were a year ago. I am also trying to add mysql into VPL. Can you help me out with all your experience please??

  1. How did you manage to install MYSQL into Jail server?
  2. I can also replace the default sql.sh with yours. But were you manged to solve your "mysql command not found" issue? If yes, just share your experience.
  3. Also can we bring auto evaluation for MYSQL. if yes, kindly share me a small example.

Thanks

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Sonja Sperber -

Hi all,

we made good experience with VPL....

For some reason we want to build up a new system
and therefore want to de-install the VPL…

In order to install it used this:
http://vpl.dis.ulpgc.es/index.php/support/2014-09-27-15-06-22/40-how-to-install-vpl-jail-system

which worked fine.

Somebody move the jail-directory from / to another folder:
"/data„.

In „/data“ another partition is mounted.
It’s not possible to delete the directory „/data/jail" 
because it include itself tons of other partitions which
are mounted read only.

# rm -rf /data/jail
...

cannot remove »jail/usr/share/racket/collects/teachpack/htdp/scribblings/hangman.scrbl“
file system ro mounted
...


all the partitions under /data/jail/ are
include in the "/etc/mtab“ and can be shown with "mount"
command.

# mount



/bin on /data/jail/bin type none (ro,nosuid,bind)
/usr on /data/jail/usr type none (ro,nosuid,bind)
/lib on /data/jail/lib type none (ro,nosuid,bind)
...


Even if I remount it read/write I can’t delete the directories.
The reason I think is because system folders are linked here.

Of course it is possible to simply umount
/data/jail/bin
/data/jail/usr

I don’t know wether that is dangerous … and besides it is
a lot of  manual work.

Can you get me started how to delete the „jail“ ? In order to re -install it later on ...


Thanks!

Sonja

In reply to Sonja Sperber

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Sonja,
The correct way to uninstall the jail service or change the jail directory is stopping the service first. In case that you are changing (or moving) the jail directory, do not change the config file before stopping the service. If you do a hot change of the JAILPATH, the stop process will not do correctly its work.
If you want to change the path of the jail directory, follow this steps:
1) Stop the service (if it is running) sudo service vpl-jail-system stop
2) Edit the file /etc/vpl/vpl-jailsyste.conf changing JAILPATH var to your new directory (the directory must exist)
3) Restart the service with sudo service vpl-jail-system start

If you miss the first step then you can go back going to step 2), set the old JAILPATH and restart the service, now you can replay the change process (steps 1, 2 and 3)

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Jhon Carlos -
Hi juan ,

how to change the default execution options values ?

The default values are :

run : no

evaluate : no


i want to change these default values to yes !

In reply to Jhon Carlos

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hello Jhon,

The default value is set at DB level. If you want to change the default value you also can change the code at "/mod/vpl/lib.php", you must go to the function "vpl_add_instance" and add this lines before the one that contents "... $DB->insert_record ..."
--------------
$instance->run = true;
$instance->evaluate  = true;
--------------

Best regards.

Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Android Lab

by deepa ganu -

Hi Jaun,

We have been using VPL lab at our college. We are keen to use it for teaching Android programming also, is that possible?

In reply to deepa ganu

Re: Android Lab

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

HI Deepa,
Sorry I am not a Android developer and I don't know about Android emulators or requisites to be run in Linux. I can help you in this question.

Best regards.
Juan Carlos

In reply to deepa ganu

Re: Android Lab

by Vikram Jain -

hi Deepa,

Do you have any success to run Android programs using VPL ?


In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by deepa ganu -

Hi Jaun , 

Another request !!! 

I have a R script 

 x <-1:10

 plot( x )

My run.sh looks like 

#!/bin/bash

# $Id: c_run.sh,v 1.3 2012-07-25 19:02:20 juanca Exp $

# Default C language run script for VPL

# Copyright (C) 2012 Juan Carlos Rodríguez-del-Pino

# License http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

# Author Juan Carlos Rodríguez-del-Pino <jcrodriguez@dis.ulpgc.es>


#load common script and check programs

. common_script.sh

check_program Rscript

get_source_files r R

#Select first file

for FILENAME in $SOURCE_FILES

do

SOURCE_FILE=$FILENAME

break

done

#compile

cat common_script.sh > vpl_wexecution


echo "Rscript --default-packages=utils $SOURCE_FILE" >>vpl_wexecution

echo "xterm -e R --vanilla --interactive > $SOURCE_FILE" >>vpl_wexecution

cat vpl_wexecution

chmod +x vpl_wexecution


But when it launches the graphical output, I get an R shell . If I enter source(program.r) on the R shell it gives me the graphical plot.

But I want to change my run.sh such that it launches the R shell in such a manner that I dont need to enter source(<name of the source file>)

In reply to deepa ganu

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Deepa,
After internet search, reading R documentation and testing multiple ways to launch R and Rscript, I don't find (or not exist) a way to run interactively R source file without typing "source()" in R console.
If you (or other person in that read this) find the solution please let us know.

Best regards

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by deepa ganu -

Hi Jaun, 

Here is the solution: 

R produces two kinds of output 

i. Text 

ii. Graphical

We can get the output both text and graphical and even evaluate the R textual output by using the following r_run.sh 

The only disturbing factor is if the graphical console is launched , you have to click on it to see your graph. 

The sample r program is as follows 

x <- 1:10

plot(x)

locator(1)

q()

============

if the program produces textual output 

x <- 1:10

x

you can even attach the test cases to it 

case = 1

output = / [1-10] /

Jaun , you have created a wonderful piece for education. Thanks a lot

Further more we have changed the sql_run.sh to launch the mysql client for every user. Though they cannot create tables but can learn fairly good amount of sql using selects.


In reply to deepa ganu

Re: New Virtual Programming Lab (VPL) module

by deepa ganu -

Hi Jaun ,

Can we add linux users as to jail server apart from the root user. The thing is I want to use hadoop cluster in VPL , hadoop cluster needs its own user "hduser" doesnt work with root. So I cant access the hdfs folder as it is not in root

In reply to deepa ganu

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello  Deepa,
Get vpl-jail-system software and before install it, adapt the file "vpl-jail-system.initd" to your need. This file is the script ro start and stop the service. Go to the function "set_etc" and add the user and grup needed. Important: be carefull with the security implicactions.

https://github.com/jcrodriguez-dis/vpl-xmlrpc-jail/blob/master/vpl-jail-system.initd#L85

Best regards.
Juan Carlos.

In reply to deepa ganu

Re: New Virtual Programming Lab (VPL) module

by Prakash Raju -

Hi deepa,

can you share your modified sql_run.sh that you wrote to launch separate mysql client for each user? It is very similar to my requirement now. 

Thanks


In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Nijesh W -

Hai Juan,

Any possibility to run graphic program in VPL.

I have installed graphic lib from here http://computersolutions03.blogspot.in/2013/10/run-graphicsh-in-ubuntu.html, in my program I'm using graphic functions such as "settextstyle(2,0,4), settextjustify(1,1) and setfillstyle(1,MAGENTA)" 

I got an error "undefined reference to `initgraph' ". Please help to solve this issue. I have attached my sample code 

In reply to Nijesh W

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Nijesh,
Based on your report, I guess that you have installed the required packages in your Ubuntu jail server.
The question here is if you also have used a customized vpl_run.sh script to add the "-lgraph" option to the compiler.

Best regards

Juan Carlos

Example of customized vpl_run.sh with -lgraph


#!/bin/bash
# This file is part of VPL for Moodle - http://vpl.dis.ulpgc.es/
# Script for running C language 
# Copyright (C) 2014 Juan Carlos Rodríguez-del-Pino
# License http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
# Author Juan Carlos Rodríguez-del-Pino 
#load common script and check programs
. common_script.sh
check_program gcc
if [ "$1" == "version" ] ; then
	echo "#!/bin/bash" > vpl_execution
	echo "gcc --version | head -n2" >> vpl_execution
	chmod +x vpl_execution
	exit
fi 
get_source_files c
#compile
gcc -o vpl_execution -std=c99 $SOURCE_FILES -lm -lutil  -lgraph
In reply to Juan Carlos Rodríguez-del-Pino

Ynt: New Virtual Programming Lab (VPL) module

by Muhammet Yorulmaz -

Hi Juan,

Thank you very much for VPL plugin. I am going to use next semestre my C programming Course. 

I try to explore the plugin. I prepared sample question and evaluate criteria. 

Question : 

Write a C program to print the series generated from a given number according to Collatz conjecture (also known as the 3N+1 conjecture) and  pieces count in the series. (30 points)

Sample Run:

---Input---

16

---Output---

16 8 4 2 1

5

------------------------------------------------

vpl_evaluate.cases

Case= Try 1

input = 3

output = 

3 10 5 16 8 4 2  1

grade reduction=30


Case= Try 2

input = 16

output = 

16 8 4 2  1

5

grade reduction= 30

-------------------------------------------

1- Is vpl_evaluate.cases file correct?

2- For example, I want to reduce 5 points, if pieces count are missing. How can I do?

2-What should I write to the vpl_evaluate.sh file .


In reply to Muhammet Yorulmaz

Re: Ynt: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Muhammet,
A1) I think that your vpl evaluate.cases is correct. Beware that if you use numbers as output, it is accepted any text between the numbers in the program output.
A2) At this moment the default test program can't do this. Notice that you also can use regular expression, but wath you want is dificult to achive.
A3) vpl_evaluate.sh is intended to replace the current default evaluation processes. If you use vpl_evaluate.sh, you must do all yourself see "Execution files" help for details.

Best regards.
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Jim Burton -

Hi Juan Carlos, first of all, thanks very much for your work on VPL. I have been experimenting with the demo site and it seems to be just what we need in the CS Dept at the University of Brighton, UK.

I want to use VPL to evaluate Java programming assignments but I'm new to moodle as well as to VPL. Using the documentation on your site [1] I've installed the latest moodle, VPL and Jail server, and I'm able to create a VPL activity. Student users can upload files, and Teacher users can see what's been uploaded. Can you point me to a step-by-step explanation of how to set up a VPL Java-based activity, such that I can define some tests for the uploaded files and assign marks automatically?


[EDIT] Reading another reply of yours in the forum helped a bit, and I found the Execution Options menu item that looks promising! The "Based On" drop down is empty however -- is there where I would specify that this is a Java assignment?


[1] http://vpl.dis.ulpgc.es/index.php/support 

In reply to Jim Burton

Re: New Virtual Programming Lab (VPL) module

by Jim Burton -

Please ignore my last question -- I've found through experimenting that uploading a Java file results in its execution, so I suppose the programming language is guessed from the extension...

I now need to write some tests...I wanted to create a test assignment to write a Java program to add 2 integers but can't seem to get access to the args...that is, if I have a test such as 


Case = TC1

    Input = 2 2

    Output = 4


And a submission:


class Test {

  public static void main(String[] args) {

    //System.out.println(args.length); //prints 0
    System.out.println(args[0]+args[1]);

  }

}

it fails, so I am obviously misunderstanding how to define tests. What am I doing wrong? Thanks in advance,

Jim

In reply to Jim Burton

Re: New Virtual Programming Lab (VPL) module

by Jim Burton -

Now I realise that the input to a test is supplied interactively, so needs to be read in from stdin.

Sorry to keep asking questions then answering them myself smile It would be great if there were better documentation for VPL but I understand that I should write it myself if I feel so strongly about that...

In reply to Jim Burton

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Jim,
The program of automatic evaluation, at this moment, only manages tests of "input/output". I add as request the possibility of doing tests of "command args/output".
As a work around to your needs you can use the files below.
You must go to "Advanced settings>Execution files", modify  vpl_run.sh and add CommandArgs.java. The first file "vpl_run.sh" changes the default behavior of running the first main procedure found, to running CommandArgs.main. The CommandArgs does the interface from the test framework with the student's program. CommandArgs reads the numbers from the standard input and calls the student's Test.main procedure with the numbers as args.

Notice that the code needs that the student's class be called "Test". I recomend go to "Resquested files" and set there a blank file called "Test.java". This prevent that the students write the file name.

Best regards.

FIle: vpl_run.sh

#!/bin/bash
#load common script and check programs
. common_script.sh

check_program javac
check_program java
get_source_files java
#compile all .java files

javac -J-Xmx16m -Xlint:deprecation Test.java
if [ "$?" -ne "0" ] ; then
	echo "Not compiled"
 	exit 0
fi
javac -J-Xmx16m -Xlint:deprecation CommandArgs.java &>/dev/null
if [ "$?" -ne "0" ] ; then
	echo "Not compiled or incorrect interface"
 	exit 0
fi

cat common_script.sh > vpl_execution
echo "java -enableassertions CommandArgs" >> vpl_execution
chmod +x vpl_execution

File: CommandArgs.java

import java.util.Scanner;
public class CommandArgs {
    static public void main(String[] Args){
        Scanner s = new Scanner(System.in);
        int a = s.nextInt();
        int b = s.nextInt();
        //Call student's main
        String[] args={""+a,""+b};
        Test.main(args);
    }
}
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Neider Vergara Humánez -

Hi Juan.

Thanks for all.

This time i want to consult about evaluating a program, some students in some courses use to RUN their codes but they don´t click de evaluate button so they don´t receive a grade for their code, the question is: 


Can i make something like schedulled task to evaluate codes and grading them?

Or

Can i force evluate when running the code or something like that?


Thanks for your good work and sorry if i cause bother.


Neider.

In reply to Neider Vergara Humánez

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Neider,
- Answering to your firs question, I must say that there is no an easy solution to add this feature because the current evaluation process was build to be used on line and no in batch mode.
- The second way that you propose to solve your problem may be to do an evaluation every time the student saves the code or the first time (after be saved) that try to run the code. I guess that after each save may be the "secure" solution. I think that this approach can be easily implemented but I don't know if may be uncomfortable for common students.
- Of course, you also can go to "Submissions list" and select "Evaluate -> Not graded" the system will evaluate all unevaluated submissions (online).

Don't worry, the questions or requests don't bother me smile smile.

Best regards.


Attachment Captura.JPG
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Neider Vergara Humánez -

Hi Juan.

About your good amswer:

- The second way that you propose to solve your problem may be to do an evaluation every time the student saves the code or the first time (after be saved) that try to run the code. I guess that after each save may be the "secure" solution. I think that this approach can be easily implemented but I don't know if may be uncomfortable for common students.


Is there any doc about making this proccess?

Can you give some instructions to make automatic evaluation when the stundent's code is saved?


Thank you.

In reply to Neider Vergara Humánez

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hi Neider,
No, there is no specific docs. This new feaure must be done at the VPL programming level. Notice that VPL is open source.
A work around may start by going to the line 1262 of /editor/VPLIDE.js and adding a new line with the code "if(isOptionAllowed('evaluate')) {menuActions['evaluate']();}"

https://github.com/jcrodriguez-dis/moodle-mod_vpl/blob/master/editor/VPLIDE.js#L1262

But this solution will evaluate all the "saved code".


Best wishes,


In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Jim Burton -

Hi Juan, what exactly do the figures in the similarity analysis mean? When two files are identical (modulo renaming variables) it shows in red and says 100%, which is brilliant, but when I make a small change to one of those files I get something like 

90|96|78***

Can you break that down for me please?

The similarity analysis is a really powerful feature by the way. We had been looking into trying to get Sherlock [1] working in blackboard but dealing with BB is a dauntingly horrible task.

[1] https://www2.warwick.ac.uk/fac/sci/dcs/research/ias/software/sherlock/

In reply to Jim Burton

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hi Jim,
To explain better what these figures means I refer you to the paper
"Fighting plagiarism: metrics and methods to measure and find similarities among source code of computer programs in VPL".

This paper is slightly outdated but explains how these figures are calculated and what they say.

Best regards,
Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Garth Brady -

Wow, this plugin is revolutionizing how my students are learning to code.  Rather than using it to purely summatively assess my students, VPL is giving my students an opportunity to work through problems and receive instant feedback - they love it and so do I!

My question:

I teach in a computer lab of 30 identical lenovo i5s.  I have on computer that, regardless of who is logged into it returns a 'server execution error' when we run any code (even a simple 'hello world' script).  Any idea what this might be?  I've even tried re-installing the OS and this PC continues to return this error :/

In reply to Garth Brady

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

According to your description of the situation, it seems that  the problem is not the computer but the network connection of the this computer.
Try checking the differences of the network configuration of this computer and the others. If you are using a wired connection try swapping this computer by some other.
In any case, the problem  does not appear to be related with Moodle or VPL.

Best regards,
Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Jim Burton -

Hi, is it possible to use junit tests for the evaluation and grading? I have an Java assignment where a class containing unit tests is one of the execution files, and I can evaluate the activity with the script below as vpl_evaluate.sh but the grade isn't affected. If that isn't possible it will be OK for us to have the junit tests in vpl_run.sh (so the students can run them and get feedback) and try to write equivalent cases in the standard format for vpl_evaluate.cases, but it would be nice to use unit tests for the marking.


    #!/bin/bash

    #load common script and check programs

    . common_script.sh

    check_program javac

    check_program java

    get_source_files java

    #compile all .java files

    export CLASSPATH=$CLASSPATH:/usr/share/java/junit4.jar

    javac -J-Xmx16m -Xlint:deprecation *.java

    if [ "$?" -ne "0" ] ; then

      echo "Not compiled"

      exit 0

    fi

    cat common_script.sh > vpl_execution

    echo "java -enableassertions -cp $CLASSPATH:/usr/share/java/junit4.jar org.junit.runner.JUnitCore TestFATFS" >> vpl_execution

    chmod +x vpl_execution


TIA.

In reply to Jim Burton

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Jim,

VPL uses a particular format to instruct to the evaluation postprocess what are comment and what is the grade resulted. You can find this format at
http://vpl.dis.ulpgc.es/index.php/support
"Automatic evaluation" section
-----------------------
When an automatic evaluation is done, the output (standard output) of the execution is processed to obtain the comments and proposed grade.

The comment format is as follows:

A comment line would be a line starting with ' Comment: = >>' . A block comment would be contained between a line containing only '< | -' and other with '- | >' . The proposed grade is taken from the last line that begins with ' Grade: = >>' .

If the automatic assessment is set then the proposed grade becomes the final.
-----------------------
You must postprocess the Junit output to adapt the results to this format. To get this, you must add code to your "vpl_execution". The output of this code could look like this:
-----------------------
<|-
-Junit result
Sumary
-|>

Grade: = >> 7.3

-----------------------
This approach, of postprocessing the test output, is generic, with JUnit you also can write your own Report and replace the standard one.

Best wishes,

Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Jim Burton -

Thanks for the explanation Juan -- I'll experiment and report back in case it's useful to others.


Best,


Jim

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Jim Burton -

Hi Juan, I have processed the junit output so that when the assignment is evaluated, vpl_execution prints out something like this:

Case = Test One Comment: = >> Test One: success Grade: = >> 50 Case = Test Two Comment: = >> Test Two: failure < | - Summary of what went wrong - | > Grade: = >> 0


Automatic grade is set to yes, but this output from vpl_execution doesn't result in a grade being recorded -- do I need to format the output differently? An example would be very helpful. This is after defining two test cases, something which I wasn't sure whether I needed to do (as there is no input or output expected):

Case = Test One 

  Grade reduction = 50 

Case = Test Two 

  Grade reduction = 50


Thanks,

Jim

In reply to Jim Burton

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Jim,
the postprocessor is case sensitibe and aware of spaces.
The correct output must be:

Case = Test One (IGNORED, NOT A COMMENT)
Comment:=>> Test One: success
Grade:=>> 50 (IGNORED DUE TO THE NEXT Grade:=>>) 
Case = Test Two (IGNORED, NOT A COMMENT)
Comment:=>> Test Two: failure
<|-
- Summary of what went wrong
-|>
Grade:=>> 0

Notice that
1) Only the last "Grade:=>>" is considered.
2) All text outside comments and grade are ignored.
3) The block comments require that start and end marks are in a dedicated line.
4) This format of output is not related with the file vpl_evaluate.cases (You don't need this file)
 
Best wishes,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Jim Burton -

OK, so I've altered the output as per your instructions (see below). But the grade is still not entered....when the student account clicks Evaluate the text below appears in a pane on the right titled "Execution", but a grade of zero is recorded and the pane on the right doesn't have the same elements as when evaluating a "regular" assignment, which is what I was hoping for (or at least for the mark of 50 to be recorded):   

Comment:=>> Test One: success. 50 marks Comment:=>> Test Two: failure. 0 marks <|- This went wrong -|> Grade:=>> 50

Any ideas where I'm going wrong? Thanks,


Jim

In reply to Jim Burton

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

I'm sorry Jim,
it's my fault sad . I said you "it is case sensitive and aware of spaces", but I didn't do it.
I try again:

Comment :=>> Test One: success. 50 marks
Comment :=>> Test Two: failure. 0 marks
<|--
- Lines starting with "-" are titles
This went wrong --|> Grade :=>> 50

Notice the spaces and that the start and end block marks use 2 "-"
Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

A call for feedback: writing in a lab setting...

by Garth Brady -

I've started using this with my Advanced grade 12 Computer Science class and it's absolutely revolutionizing my classroom.  On behalf of my students, thanks so much for your efforts here!

Question:
How are teachers handling its use in a lab setting?  In my case, I have 30 computers side-by-side wrapped around the perimeter of my room.  Students, when writing a test, could easily take a look at one another's code and cheat.  To combat this, we're turning our monitors in different directions, though I feel there must be a better answer.

In reply to Garth Brady

Re: A call for feedback: writing in a lab setting...

by Jim Burton -

It's a very difficult problem. I think most would agree that programming is (at least part of the time and for many programmers) a social activity and the better learners get at sharing code, talking about ideas and approaches (i.e. the better they get at plagiarism!), the faster they will learn. The ones who "cheat" by teaching their fellows learn especially quickly. But if you set an individual assignment you need to know who did the work...

Something that has helped us is an oral test to make sure students can explain their own work. You need to follow through on it and flunk anyone who can't explain what they did...If they know this is coming they make sure they understand what they're doing. 

In reply to Juan Carlos Rodríguez-del-Pino

Re: Evaluation without a Grade

by Garth Brady -

So, I think I must be missing something...  I would also like to use VPL for student practice.  So, I want VPL to Run & Evaluate student code and give them feedback (as it does now) without scoring it in the Gradebook.  My only solution till now is to create a Gradebook category that is hidden and locked and set each VPL activity's Grade category to this gradebook category.

Is there a better solution?

In reply to Garth Brady

Re: Evaluation without a Grade

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Garth,
VPL can has different evaluation behaviour, based on three activity elements: "Grade type", "Evaluate" and "Automatic grade" switch.

1) If you select "Grade type" to "None" and "Evaluate" to "Yes" VPL does not generate a Grade book item but still can Evaluate generating comments. The evaluate process will not generate a grade due to the lack of "Maximum points" field.
2) If you select "Grade type" to "Point", "Evaluate" to "Yes" and "Automatic grade" to "No" VPL will generate a Grade book item and the Evaluate process will propose a grade that will not be moved automatically to the grade book.

Best regards,
Juan carlos

Attachment s1.jpg
Attachment s2.jpg
In reply to Juan Carlos Rodríguez-del-Pino

Re: Evaluation without a Grade

by Garth Brady -

Thanks so much for this tip!  I should have tried that drop-down before bugging you!

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Garth Brady -

I apologize for all the posts lately...  I'm just getting a tad excited.

Is there documentation on how to use VPL with SQL queries?  My students are learning table joins such as this 3-way join below, and I'd like to be able to test them on their ability to code solid queries using VPL.  

SELECT merchandise.name, merchandise.stock, users.email
FROM `orders`
LEFT JOIN `users` ON `orders`.`user_id` = `users`.`id`
INNER JOIN `merchandise` ON `orders`.`merch_id` = `merchandise`.`id`  WHERE `users`.`status` =1
ORDER BY`merchandise`.`name` ASC

I was thinking I could write a query to build an SQL database that they could then attempt to query and return results that VPL would then read and evaluate.  Is this doable?


SELECT merchandise.name, merchandise.stock, users.email 
FROM `orders` 
LEFT JOIN `users` ON `orders`.`user_id` = `users`.`id` 
INNER JOIN `merchandise` ON `orders`.`merch_id` = `merchandise`.`id` WHERE `users`.`status` =1 
ORDER BY`merchandise`.`name` ASC

 


In reply to Garth Brady

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Garth,
see the following post, it may help you
https://moodle.org/mod/forum/discuss.php?d=154988#p1275315

If still you have questions, don't hesitate asking.
Best regards,
Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Garth Brady -

Hi Juan,

Yes, thanks, I saw this post and read through it previously.  I must admit, I'm a noob.  

  1. So, at this point, I created an new execution file (which I assume will run automatically simply by the fact that it exists adjacent the other empty execution files) and filled it with an SQL command that creates a DB, table and columns of data.  Is this correct?
  2. Can I use mysqli_query to query the database?  If yes, what do I put in for the $conn parameter?
In reply to Garth Brady

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Garth,
A1. You must also mark the file as "Files to keep when running".
A2. By default VPL supports SQLite but not MySQL. MySQL is complex to use due to the need of a proper authentication that let the students access or modify the shared DB.

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Garth Brady -

Thanks, Juan.  Things are progressing, but I'm still having a bit of an issue (I'm sorry!).  The problem at the moment is that SQLite does not seem to see my database.  To test, here's what I've done:

  1. Created createDB.db that has only this text:
    CREATE DATABASE IF NOT EXISTS `rentamovie` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
    CREATE TABLE `customers` (
    `customer_id` int(11) NOT NULL,
      `fname` varchar(33) NOT NULL,
      `sname` varchar(33) NOT NULL,
      `email` varchar(33) NOT NULL,
      `phone` char(10) NOT NULL,
      `dob` date NOT NULL)
     ENGINE=InnoDB DEFAULT CHARSET=utf8;
  2. I checked on createDB.db in "Files to keep when running"
  3. I named the test file testMe.sql and inserted a simple command: SELECT * FROM `rentamovie`.`customers`;

When I click run, the cmd window opens and returns the error 'no such table: customers'.  In this same cmd window, when I type '.databases', the only database in the list is the default VLP.db.  My createDB.db does not appear.  Any idea why this is?

In reply to Garth Brady

Re: VPL with SQLITE3

by Garth Brady -
Right, so I've done much more reading and see that SQLite queries are formed slightly differently from MySQL queries.  To this end, I've changed things up but still have the same problem: I can't seem to create a database.  Here's what I have now:


  1. Created createDB.db that has only this text: 
    CREATE TABLE COMPANY(
    ID INT PRIMARY KEY     NOT NULL,
    NAME           TEXT    NOT NULL,
    AGE            INT     NOT NULL,
    ADDRESS        CHAR(50),
    SALARY         REAL);
  2. I checked on createDB.db in "Files to keep when running"
  3. I named the test file testMe.sql and inserted a simple command: SELECT * FROM company;

The problem remains the same as I wrote in my previous post: When I click run, the cmd window opens and returns the error 'no such table: customers'.  In this same cmd window, when I type '.databases', the only database in the list is the default VLP.db.  My createDB.db does not appear.  Any idea why this is?


In reply to Garth Brady

Re: VPL with SQLITE3

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Notice that VPL.db is an arbitrary name and the ".db" extensión is has not an special meaning here. VPL.db is the file that use SQLite to save de Data Base in VPL.
You must use files with ".sql" extension if you want that VPL will execute it as SQLite code.
If you want to use other extensions or other SQLite data files, you must change the default script by filling vpl_run.sh and others.

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: VPL with SQLITE3

by Garth Brady -

Thanks for these pointers, Juan!  All is working great now!  For others wishing to do the same, here's my setup:

Under Execution Files, I have a createDB.sql file with the code below in it.  It is checked on in 'Files to Keep when Running'.  In my Test Activity file (named testMe.sql) I have this simple script to test:  select * from company;

That's it!

createDB.sql:

CREATE TABLE COMPANY(

   ID INT PRIMARY KEY     NOT NULL,

   NAME           TEXT    NOT NULL,

   AGE            INT     NOT NULL,

   ADDRESS        CHAR(50),

   SALARY         REAL

);

INSERT INTO COMPANY (ID,NAME,AGE,ADDRESS,SALARY)

VALUES (1, 'Paul', 32, 'California', 20000.00 );

INSERT INTO COMPANY (ID,NAME,AGE,ADDRESS,SALARY)

VALUES (2, 'Allen', 25, 'Texas', 15000.00 );

INSERT INTO COMPANY (ID,NAME,AGE,ADDRESS,SALARY)

VALUES (3, 'Teddy', 23, 'Norway', 20000.00 );

INSERT INTO COMPANY (ID,NAME,AGE,ADDRESS,SALARY)

VALUES (4, 'Mark', 25, 'Rich-Mond ', 65000.00 );

INSERT INTO COMPANY (ID,NAME,AGE,ADDRESS,SALARY)

VALUES (5, 'David', 27, 'Texas', 85000.00 );

INSERT INTO COMPANY (ID,NAME,AGE,ADDRESS,SALARY)

VALUES (6, 'Kim', 22, 'South-Hall', 45000.00 );

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module (problems with space in file's name)

by Leônidas Brandão -
Dear Juan Carlos,
First of all, congratulation for your work on VPL, it is great! The current HTML5 editor in VPL is much better than Java version, HTML5 avoids the annoying difficulties with Java!
I am using VPL versions 2.0.3 and 3.1.4, and this year I realized an small error (from one student experience).
The problem appears whenever the student try to use space in his file's name, e.g., naming a file as "even or odd.c". To help you to debug the problem, I copy the messages from both versions (file's name "even or odd.c" and click on button "Evaluate"):
 2.0.9.: Java editor
  "Compilation vpl_environment.sh: line 11: export: odd.c': not a valid identifier Error need file 'vpl_evaluate.cases' to make an evaluation"

 3.1.4: HTML5 editor
  even or odd.c
  "gcc: error: even: No such file or directory
   gcc: error: or: No such file or directory
   gcc: error: odd.c: No such file or directory"
Probably, the error occurs at the "Jail server", since in Linux it is necessary "\" in command line (or "even\ or\ odd.c"). So, perhaps a simple solution is to use a filter to avoid special characters (when communicating with the Jail server).

Best regards,
Leônidas
http://www.matematica.br
http://www.usp.br/line
Attachment small_bug_vpl_filename_html5.png
Attachment small_bug_vpl_filename_java.png
In reply to Leônidas Brandão

Re: New Virtual Programming Lab (VPL) module (problems with space in file's name)

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Dear Leônidas,
I am proud knowing that the version 2.X of VPL still is in uses and does its job.
About the problem you report, I must say that I know this problem. The problem are at the scripts that handle the compilation and execution of the program in the execution servers. These bash scripts processes lists of files and the problem is that they use spaces as separators. Other scripts, like the one that compile C, use this list of files as argument to the compiler. The error that you have found is of the second type.
To resolve this type of error, I have rewritten the function get_source_files in the  file vpl/jail/default_scripts/common_script.sh.
This change solves the second problem, but I still need time to give a complete solution.
function get_source_files {
  SOURCE_FILES=""
  for ext in "$@"
  do
    source_files_ext="$(find . -name "*.$ext" -printf "%f?" | sed 's/^.\///g' | sed 's/ /\\ /g' | sed 's/\?/ /g')"
    SOURCE_FILES="$SOURCE_FILES $source_files_ext"
  done
}
Note this change is valid for both versions of VPL.

Best regards, Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module (problems with space in file's name)

by Leônidas Brandão -

Hi Juan-Carlos

That's right! Your repair at line "source_files_ext" works fine!

Thank you very much for your prompt answer.

Leônidas

In reply to Juan Carlos Rodríguez-del-Pino

VPL + Octave Graphics Stopped Working

by Philip Robinson -

Good day,

I have been using VPL to support a course using the Octave language and when I first set the VPL system up (VPL 3.1.2 and Jail server 2.1.2 both running on Ubuntu 14.04.3) I had no problem using the plot and other graphics function in Octave activities. 

Recently however if I run a graphical octave script (Something simple like plot(1:10)) using the stock vpl_run.sh for Octave/MATLAB the terminal launches but doesn't show the graphical environment and the title states "Console: Connection closed (Timeout)"

I am not sure how to debug the issue further?  Any advice on debugging the issue would be greatly appreciated.

Thanks,

Philip Robinson

University of Johannesburg

P.S. I have really enjoyed using VPL to teach my course, it has opened up so many new way to teach programming.


In reply to Philip Robinson

Re: VPL + Octave Graphics Stopped Working

by Philip Robinson -

I have since tried using a completely freshly installed Ubuntu jail instance with no change so the problem seems to lie on the Moodle side of the equation.

In reply to Philip Robinson

Re: VPL + Octave Graphics Stopped Working

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Philip,

Some similar symptoms were resolved in version 3.1 of VPL. The problem was generated by the change of behavior in the 3.X series of Octave. The default script had to be changed to establish 'gnuplot' as the graphic_toolkit and prevent to use the default one that needs GL.

I can't reproduce your problem, but you can try this:
1) Try removing all the vpl_run.sh file content, to grant using the stock vpl_run.sh for Octave/MATLAB.
2) Change the content of vpl_run.sh by this
https://github.com/jcrodriguez-dis/moodle-mod_vpl/blob/master/jail/default_scripts/matlab_run.sh
3) You also can send me the activity with the problem (all the execution files, or better an activity backup ) to try to reproduce the problem.

Best regards,
Juan Carlos
P.D.: Knowing that VPL is useful and help to teach programming is great for me.

In reply to Juan Carlos Rodríguez-del-Pino

Re: VPL + Octave Graphics Stopped Working

by Philip Robinson -

Thanks for the quick response.

So I think I have found the problem. Our university is using the Squid proxy which doesn't support the WebSocket protocol very well. I got around the problem by forcing VPL to use the WSS protocol always but it seems when I try run a Graphical script VPL goes back to using the WS protocol which is blocked by Squid. Could it be that when vpl_wexecution is used that VPL isn't honouring the selected Websocket_protocol value (in my case always using WSS)?

Best Regards,

Philip

In reply to Philip Robinson

Re: VPL + Octave Graphics Stopped Working

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
The code of VPL 3.1.2 has a bug when forcing ws: or wss: protocol. This problem was resolved in VPL 3.1.4.
See
https://github.com/jcrodriguez-dis/moodle-mod_vpl/commit/583c87d50571056709f24339d446c67ff6fc0f84
You can update your installation to 3.1.4 or fix manually the bug in the code of 3.1.2.

But I don't know if the problem you describe, match with the one above.
Best regards.
Juan Carlos


In reply to Juan Carlos Rodríguez-del-Pino

Re: VPL + Octave Graphics Stopped Working

by Philip Robinson -
I am actually using VPL 3.1.5 currently as I needed the feature where you made the student username available via a variable in common_script.sh so that doesn't seem to be the bug.


I have selected always use WSS in the VPL settings menu and with all the non graphical activities it honours that setting but just not when I use the stock Octave script with a graphical command.

Sincerely,

Philip

In reply to Philip Robinson

Re: VPL + Octave Graphics Stopped Working

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

You are right, the problem was in the plugin of VPL. I have fixed the bug and pushed the solution to the current 3.1.5 version in GitHub.
https://github.com/jcrodriguez-dis/moodle-mod_vpl/blob/v3.1.5/vpl_submission_CE.class.php

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: VPL + Octave Graphics Stopped Working

by Philip Robinson -
That fixed it! Thanks for the quick support, we are back in business!
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Andreas Knaup -

Hi there,

i have apache running on port 80 and vpl-jail-system running on port 8888.
When i start the vpl-jail service i can not access to apache server??

Vpl-Jail system is running on Debian 8.

Any suggestions?

In reply to Andreas Knaup

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Andreas,
if you need to open other ports (e.g apache needs to open port 80)  that the ones needed by vpl-jail-service then you must indicate to vpl-jail-service to do not use firewall. You must modify /etc/vpl/vpl-jail-system.conf file setting FIREWALL=0, all other levels of firewall prevent to acces to other ports from outside.

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Andreas Knaup -

Thank you very much! Problem solved!

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Neider Vergara Humánez -
Hi everyone.


First i want to thnk for the great help i've got in this forum, Thanks to Juan.

Second, i have a new question:

Some tachers in my Moodle are trying to use Numpy and Pandas with Python in VPL, i have installed the needed packages and i've ran example codes in the server´s console, a this point everything was OK, but when tried to run codes in Moodle VPL we got some warnings that i could not solve.

I wold like to know if you have some solution or advices about this issue.

Screen with the issue:


In reply to Neider Vergara Humánez

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
I have been working on your issue (and others) and it has been resolved in the next release of the jail(execution) server. We are testing the new version and we hope to release it in the next week. Stay tuned.

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Jean Martina -

Guys,

     It is with great pleasure that I am posting here ate the VPL forum our book about the VPL plugin. It became available on amazon kindle just now:

https://www.amazon.com/Developing-Programming-Courses-Moodle-VPL-ebook/dp/B01FE2A9U4?ie=UTF8&keywords=vpl&qid=1462815982&ref_=sr_1_4&s=books&sr=1-4

     The book was written by myself and another 3 colleagues showing how we put VPL in practice the VPL here at UFSC/Brazil. The book is a snapshot as we were working last September. It shows some very different classes being taught using the tool for support. It is indicated for those who are starting with the tool now, as well as those who want to understand a bit more about the inner of the tool.

      We are already grabbing material for a second version of the book. We already have working examples of how to grade code documentation, to penalize memory leaks, etc. We want feedback and suggestions to see what more can be brought to future versions of the book.

Best Regards,

Jean Martina

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by rohit katariya -

There is one parameter "Maximum output by similarity" which we do not understand. Can you please explain that. and i cannot download your paper https://library.iated.org/view/RODRIGUEZ2011FIG , i don't have an account on that website. Can you please make it available to me some other way?

In reply to rohit katariya

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Rohit,
VPL uses three metrics of similarity that are joined to generate the final report. The "Maximum output by similarity" set the number of "most similar pairs" of each metric are taken to generate the report.  For example: if you select 5 as "Maximum output by similarity", you can get reports that has between 5 and fifteen pairs. Depending of the number of metrics in which each pair appears.
In the report the number of "*" in a pair, tells us in how many metric  were selected.

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Alex . -

Hi Juan,


one question about the specs of the server. We want to install it on a dedicated cloud server. What specs would you recommend to start with? It's not being heavily used right now though. We can upgrade if necessary...


Regards,

Alex

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by deepa ganu -

Hi Jaun , 

I am trying to implement plagiarism using VPL , I could not under stand which three metrics do you keep refering too. Also I am unable to download your paper https://library.iated.org/view/RODRIGUEZ2011FIG to understand plagiarism implementation. Can you please let me know which metrics are being used.  I also didnt understand the meaning of "Maximum output by similarity" even after reading your reply to Rohit. Can u please explain once more

In reply to deepa ganu

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Deepa,

If you are going to use VPL to detect plagiarism you must notice some facts:

1) The VPL plagiarism detection tool gives you a report with pairs of files ordered from more to less similarity.

2) The similarity used in VPL is a mix of three different metrics.

3) The metrics used can give results known as "false positives". Then

      -The report is information for teachers but never must be used as a verdict.

      - ALWAYS must be one or more teachers whom judge the case.

      - The teacher must have proofs based mainly on the code and not on VPL report.

 

The parameter "Maximum output by similarity" is used to optimize (mem and CPU) the search. It sets a cut point for the report and haves no other influence. If I set "Maximum output by similarity" to 40 and then I set it to 45 the new report must be the same but with 5-15 new pairs with less similarity. Notice that if we have pair with identical similarity the output may vary.

 

Best regards,

Juan Carlos


In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by rohit katariya -

Hi Juan,

We are using VPL locally in our college on the college local network with 10.10.x.x ip.

Now we want to make it accessible from outside our college so that it can work from outside college network. We have a machine which has got a public ip adress using natting. Can we use jail servers with local ips? We have jail servers running with local ip address how can use these togeter to run vpl without assigning public ip to these?


In reply to rohit katariya

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Rohit,
if you want to use full features of VPL from any machine in internet you must provide access to the jail servers from internet.

From your post I guess that you have a public IP and you have access to your Moodle server from internet using nat to your local machine. The same way that you have gave access to your moodle server you can give access to your jail servers. You can use the same public IP for your jail servers.
The easy way is to setting a different pair of port number to each jail server.
Example:
Suppose that you have:
1) The have public IP: 193.145.147.130 name mymoodle.site
2) The private moodle server at 10.10.10.10
3) The private jailserver1 at 10.10.11.100 and jailserver2 at 10.10.11.101

Configuration
I guess that you have added port forwarding from 193.145.147.130: ports 80 and 443 to 10.10.10.10 ports 80 and 443 then your moodle server is reachable from internet as "mymoodle.site" (Configure your Moodle server to use this name)

You must configure your jail server to use other ports (e.g.)
10.10.11.100 ports 1000 and 1001
10.10.11.101 ports 1002 and 1003
see PORT and SECUREPORT at http://vpl.dis.ulpgc.es/index.php/support/2014-09-27-15-06-22/66-execution-server-configuration

Add port forwarding from 193.145.147.130: ports 1000 and 1001 to 10.10.10.100 ports 1000 and 1001 and ports 1002 and 1003 to 10.10.10.101 ports 1002 and 1003 then your jail servers will be reachable from internet as "mymoodle.site:1000" and "mymoodle.site:1002"

Now, you must configure your vpl plugin (at the moodle server) to use the jail servers
http://mymoodle.site:1000
http://mymoodle.site:1002

It may seems complex to do, but it should work.

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Konrad Lorinczi -

How it is possible to install Perl modules into VPL? 

In reply to Konrad Lorinczi

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Konrad,
You must install the Perls modules that you need into your jail-servers as normal and then restart the jail service.

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Konrad Lorinczi -

But is using a Live CD ISO file, which is read only, right? 


Then how do I change the Perl modules on Live CD? 

In reply to Konrad Lorinczi

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

If you are using a live-CD then  I guess that you are using a version 2.X of VPL. I highly recommend you to upgrade your system to the 3.X series. If you can not, then you might follow the old instructions (are outdated) of how to create a live-CD for the jail server.
http://vpl.dis.ulpgc.es/index.php/support/2014-09-27-15-07-38/58-how-to-install-jailer-deamon
You must install the Perl's  modules that you need before creating the live-CD
Best regards.
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Lloyd D -

Hi there, I'm not sure if I've posted this question in the right place (apologies if not!). I'm trying to install this plugin but not having any luck doing so as I keep getting errors that other plugins have missing files. Therefore the plugin cannot install due to the errors of other plugins! :/ the weird thing is..I'm running a new fresh copy of Moodle on my computer so technically there shouldn't be any errors?  I've attached a screenshot on this post of the errors I get. No matter if I 'Check for available updates', go through to 'Upgrade Moodle database now' or click the 'Upload ZIP files' buttons - nothing works and the problem persists! Pressing any of these buttons just keeps me on this plugins check page loop!

Any help would be greatly appreciated

Attachment plugins check errors.PNG
In reply to Lloyd D

Re: New Virtual Programming Lab (VPL) module

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

It looks like you have somehow deleted or renamed the mod/assign directory on your server.

I suggest you grab a clean copy of the Moodle code, replace the code you have currently got (after making a copy of config.php - you'll have to put that back once you've replaced the code), then make sure everything is working properly.

Once you've done that, have another go at installing the vpl plugin, the code for which should go in mod/vpl on your server.

In reply to Davo Smith

Re: New Virtual Programming Lab (VPL) module

by Lloyd D -

I used a clean copy of Moodle and even re-installed a fresh copy of XAMPP - the problem still remained sad do you have any other suggestions on what I could do to resolve this? I just don't get it.. really weird :S just to add, I'm using the latest version of Moodle (Version 3.1)

In reply to Davo Smith

Re: New Virtual Programming Lab (VPL) module

by Lloyd D -

I feel like I've tried everything to solve this issue... I've changed from XAMPP to WampServer and the problem still persists.. could you explain the steps to me of how to actually add this plugin? Does this look about right:

->Site Administration

-> Plugins

->Install Plugins

-> Drag and drop the zip folder for VPL into the upload box

->Then just click continue etc.....

I'm out of ideas at the moment... :/ 

In reply to Davo Smith

Re: New Virtual Programming Lab (VPL) module

by Lloyd D -

just wanted to add... when I try and install this plugin it seems to remove the assignment features of Moodle as when I try and add an activity the 'Assignment' option has gone!

In reply to Lloyd D

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Lloyd D,
I haven't succeeded trying to reproduce your problem.
1) I have download the latest Moodle packages for Windows (3.1+)
https://download.moodle.org/windows/
https://download.moodle.org/download.php/windows/MoodleWindowsInstaller-latest-31.zip
2)  I have done a fresh installation of this package.
3) I have download the latest VPL module version (3.1.4)
https://moodle.org/plugins/download.php/9144/mod_vpl_moodle30_2015080600.zip
4) I have gone to "Site administration => Plugins => Install Plugins"
5) I have gone to "Install plugin from ZIP file", dropped the VPL.zip file and press the button "Install plugin from ZIP file".

I think that you are doing something wrong. Some questions: before installing VPL, can you use normally your new site? Can you install other plugins?

From the screenshots, it seems that some directory has been moved/deleted from its correct place and this affects to the core Assignment plugin.

Best regards.
Juan Carlos.

Attachment Captura1.JPG
Attachment Captura2.JPG
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Alessandro Silva -

First , congrats to you and all ULPGC/CIEI staff.


What class do you suggest to modify to translate a submission prior to sending to our jail server/similarity check  ?


I have a hypothetical language that i teach in my algorithm class. My idea is to translate to cpp prior to sending to jail server/similarity check.  I actually made  a  translator using flex/bison, but i want a php only solution.

In reply to Alessandro Silva

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Alessandro,
the similarity check is done by the Moodle server and not by the jail server.
I suppose that you are asking me about what code of the VPL plugin that you must change to add a new language to the similarity check.

To add you new language, by translating your language to one already implemented, you must:
1) Add a new file type/class to the class vpl_filetype in similarity_factory.class.php. Example: 'mylang' filename extension to type 'mylang'
2) Add a new file class called "similarity_mylang.class.php" with a class called "vpl_similarity_mylang" derive this new class from e.g. vpl_similarity_cpp and replace the init method to translate the $data param, in 'mylang' to C++, and call the replaced method with the new $data.

Best regards.
Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Bavani Govender -

Hello Juan Carlos

I want to extend VPL to grade students Python code based on the number of lines of their code (using software metrics ) along with the input/output tests that are already defined. Would this be done in the vpl_evaluate.cpp file?

Also I want the teacher to be able to enter the maximum number of lines a student can have before marks will be reduced. Should this be entered under test cases ?

Thanks . Any help will be really appreciated.

In reply to Bavani Govender

Re: New Virtual Programming Lab (VPL) module

by Philip Robinson -

You should rather use a custom python script to do the grading. With a custom script you can use the file functions in python to analyze the students source code file how ever you like.

Have a look at Example 10 on the following page for an example of how to do this:

http://cs.smith.edu/dftwiki/index.php/Moodle_VPL_Tutorials

Regards,

Philip



In reply to Philip Robinson

Re: New Virtual Programming Lab (VPL) module

by Bavani Govender -

Hi Philip 

Thank you for your help. I will give that a go.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Charlie Daly -

Hello Juan Carlos,

I have been using vpl for a while and am very impressed. Now I have a problem though. I am updating all my courses for the next academic year. I have hundreds of vpl exercises and updating each due date is very tedious.

I was hoping to change the duedate directly using the interactive mysql shell.

Each week, students are paired together in a grouping for that week and the duedate is the same for each grouping. So, the process would be quite trivial if I could find how to associate a particular vpl with a particular grouping. Unfortunately, the only thing I have been able to find is that when a vpl exercise is in group mode, then the worktype field of mdl_vpl is changed.

I have looked through the code but cannot spot where grouping is been associated with the vpl event. The thought occurred to me that you might know it off the top of your head and I am hoping you could tell me.

Details: Moodle 3.1+ (Build: 20160701)

    VPL: 3.1.4

Thank you,

Charlie

In reply to Charlie Daly

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hello Charlie,
Your question is related with how the information about instances of activities are organized in Moodle.
Every instance of activity save their definition in a record in their own table (mdl_vpl for VPL) but common information (managed by Moodle) about activities are save in the table mdl_course_modules. This table has a record associate to each activity instance. Fields of this table are:
module: Id of the type of activity (associate to mdl_modules.id)
instance: Id of the activity instance (associate to mdl_vpl.id for VPL)
groupingid: Id of the grouping associate with the activity,
Supposed that you only want to assign a grouping to a VPL instance, then you must change the field "groupingid" at the record of the table mdl_course_modules associate to the VPL activity that you want to change. The selection of the row to change must be aware of the fields "module" and "instance" (may be rows with the same value in the instance field).
Moodle database schema
I hope that this helps.
Best regards.
Juan Carlos.
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Charlie Daly -

Thank you very much. That is very clear and helpful,

Charlie

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Ernesto Perez -

Hi Juan Carlos

Im looking to pass parameters to a shell script, something like:


suma.sh 10 20

The shell script should accept 10 and 20 into $1 and $2.


How to invoke a program from within VPL and pass parameters to it?

In reply to Ernesto Perez

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Ernesto,
the current version of VPL does not allow to pass command line parameters to the execution program.But VPL es flexible enough to give a work around. For example: using a custom vp_run.sh script you can create a program that read the standard input and call the student's program passing it as its command line.
To see how the defaut scripts works read the files in the jail/default_scripts folder.

Best regards,
Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

How to log evaluations?

by Aivar Annamaa -
Hi Juan Carlos!

I'm trying to make an experiment where different students have different restrictions on automatic feedback. People in one group can only request feedback 3 times, others can't get feedback more frequently than once per minute etc.

For this I need to log the feedback requests.

If I understand correctly, testing script can't normally change anything permanently, because test user's environment will be discarded after completing the evaluation process.

Can you recommend how to overcome this limitation? Should I try to execute the logging part of the testing script as different user? Any other options?

(I'd like to keep the solution in testing server, because moodle server is not under my control)


In reply to Aivar Annamaa

Re: How to log evaluations?

by Jean Martina -
I would log this externally using wget for example to post and to read information out. This could be done in the execution script. You can do that using a moodle wiki as your persistence. I done this in the past. it is not the best solution works.


Jean

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Garth Brady -

Greetings again Juan!  We are expanding our use of VPL a the High School level - many thanks to you!

1.  We have an interest in limit student attempts on submissions.  Is this doable?  For example, a student can only hit 'Evaluate' once...

2.  We plan on having our students work in an external IDE and pasting their code into VPL for assessment.  I would like to hide the 'Evaluate', 'Run' and 'Debug' commands so that students don't see them when submitting their code, but can see the result of their submission later on.  Is this doable?

In reply to Garth Brady

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Garth,
apology for the long delay answering your questions.
A1) No. At this moment its not possible. But many people are requesting this feature. I can not say when it'll be developed, but I consider it as "High priority".
A2) Yes. You can follow this steps for every VPL activity:
       1. Before students submission period. Go to "Execution options" and select No at each option (Run, Debug, Evaluate, Evaluate just on submission, Automatic grade). The students can save its source files.
        2. After the submission period. Go to "Edit settings" and select the appropriate "Grade->  Maximum grade". E.g. to 10
        3. Optionally if you want that the evaluation result will be the final grade (without teacher intervention) you can go to "Execution options" and select "Automatic grade" ->Yes.
        4. Go to to "Submissions list" and select "Evaluate -> All"

Notice that you can change the tests and rerun the evaluation as many times as you wish. If you wish to change a particular automatic grade, go to the submission view (click on submission date) and then on "grade".
If you wish to test the evaluation before show the report to the student set the activity as hidden.

I hope that this helps

Best regards.

Attachment Captura.JPG
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Bavani Govender -

Hi Everyone

I am having a problem with using regular expressions in the test cases. I can't seem to figure out how to check if a word is not in the output. The following does not work:

output = /(?!word)/i

I do not thing it supports look ahead and look behind. Any help will be appreciated.


Thanks

Bavani

In reply to Bavani Govender

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hi Bavani,

I don't know if the program that test the cases support this expression. The program uses regcomp
See http://pubs.opengroup.org/onlinepubs/009695399/functions/regcomp.html
See also "extended regular expressions"
http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap09.html

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Garth Brady -

Hello all, when evaluating some student work, we are seeing this error show up:

"Server execution error request failed: Empty reply from server"

We are using the default settings for VPL.

In reply to Garth Brady

Re: New Virtual Programming Lab (VPL) module

by Garth Brady -

As with my post above, we're also seeing this message:

"No execution server available: demojail.dis.ulpgc.es request failed: Empty reply from server"

In reply to Garth Brady

Re: New Virtual Programming Lab (VPL) module

by Garth Brady -

My apologies for these posts: it seems our Firewall received an 'upgrade' which is causing intermittent package drops.  The problems I reported have nothing to do with VPL and are purely an internal matter.

In reply to Garth Brady

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hello Garth,

sorry but demojail.dis.ulpgc.es is "a demo server", it is not recomended to use it on a production server.
Please, tell us your version of Moodle and VPL to try reproduce the problem.
Best regards.
Juan Carlos.


In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Garth Brady -

A request:

Can VPL be upgraded to make use of PHP7.  At the moment, with VPL installed in our jail server running php7, VPL reports:

"The execution server needs to install "php5" to run this type of program"

despite the fact that Php7 is installed.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Andrea Pruccoli -

Hi Juan,


this week I re-started work on VPL after a long, long time. I was simply trying to write a dumb c++ program.

When I execute the program, the console outputs me an error about the command system("pause"), saying sh: 1: pause: not found.


I can't really understand why it doesn't work. Could it be because everything is running over an Ubuntu machine?

In reply to Andrea Pruccoli

Re: New Virtual Programming Lab (VPL) module

by Andrea Pruccoli -

Moreover, I'm facing another problem.


I've set a requested file, but when I go to the "Edit" section, I can't see the file requested. Going back to "Requested Files" section, the file I previously set was missing.


I'm using VPL v3.2 (I didn't install the plugin, it was installed by the one who hosts the Moodle installation).

In reply to Andrea Pruccoli

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Andrea,
The execution of code under VPL has been always based on Linux. I don't know about the use of system("pause") on C Linux but you can try using something like system("read a"), I think that you will get a similar effect.

Best regards.
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Andrea Pruccoli -

Hi Juan,


thanks for the fast reply. What about the problem with the "Requested files"?

In the meanwhile I've found another odd behaviour. When I import a file in the "Edit" section, at first I can't see the file imported, but it is listed in the "File list" menù, and if I click on it I can see it. Is this behaviour intentional?


Best regards,

Andrea.

In reply to Andrea Pruccoli

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hello Andrea,

this "behaviour" has been improved in the 3.2beta1, now if some added file is not open then the file list is shown. Thanks for your comment.


Best regards.
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Andrea Pruccoli -

Hi Juan,


good to hear!


I tried to follow the link (at the page: http://vpl.dis.ulpgc.es/index.php/support/translations ) to contact you to submit the Italian translation of the plugin, but the link is broken. How can I give you the file?


Regards.

Andrea

In reply to Andrea Pruccoli

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Thanks, Andrea for your collaboration.
You can send me the Italian translation file by email. I will send you my email.
Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Amit Awasthi -
Please give hint for test case:

Simple octave function is 

function res=addme(a,b)

res=a+b;


In test case how to provide input: following gives error:

input=1,2

output=3

In reply to Amit Awasthi

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hello Amit,
the default VPL test program knows nothing about your programming language or your code. The test program injects the input text to your program and takes the output resulted and checks if match the expected. Then, in this case, you must write code to read the input values, call the function and output the resulted value.

Best regards.
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: Gradebook Feature Request

by Garth Brady -

Hi Juan,

What a fabulous plugin this is, and as I've mentioned, it's transformed my approach to teaching students how to code.

One challenge we face is the results as displayed in gradebook.  Gradebook itself now has the 'Moodle Scroll of Death' because of all the output from VPL (which is very, very useful, but adversely affects the students' view of their grades since it creates this lengthy, almost endless webpage of gradebook feedback).

Similar to how quizzes display feedback in gradebook, would it be possible to display the overall mark from a VPL activity and accompanying comments from teachers in the main gradebook view.  The title of the VPL assignment could then hyperlink to a page that contains the feedback from VPL (expected input/output, etc.) and the specific results of running their code.

How does this sound to you?

In reply to Garth Brady

Re: Gradebook Feature Request

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Garth,
yes, I think that the verbosity of evaluation may be a problem if you use a large number of VPL activityes. This problem can be resolved in at less two ways:
1) The plugin don't save feedback in the gradebook. I think that this feature must be controled by a switch at course level.
2) Limiting the size of feedback that the plugin saves in the gradebook.

I think that the first option is the best but requires more development effort that the second one.

I have added this request to the VPL TODO list.
Thanks for your colaboration,
Best regards.
Juan Carlos.


In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by joyce vogel -

We have been using VPL for many years now - to automatically grade C++ programs.  It has been a very useful tool and we much appreciate it!

We are now interested into moving into C++ 11, however the current compiler seems unable to compile these programs.  From what we understand the programs are being compiled by gnu c - which is stored on the server.  What can be done to compile the C++ 11 programs?


Thanks!


In reply to joyce vogel

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Joyce,
for using C++11 you need to install in your "execution server" a appropriate compiler and add a compiler switch.
For example: Ubuntu 16.04LTS (xenial) came with GNU C++ 5.4.0 that can compile standard C++11, but you need to add "std=c++11" to the compiler command line.
If you install in Ubuntu g++ 6.2 you will get gnu++11 by default that is almost C++ ansi 11.

Best regards.
Juan Carlos.

Commands to install g++ 6.2 in Ubuntu 16
======================================

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-6.2 g++-6.2
======================================

Script vpl_run.sh to be used in VPL activities that want to compile C++ ANSI 11. This code is valid with g++ 5 or higher.
To reuse this code easyly use the based on feature of VPL.
======================================
#!/bin/bash
# This file is part of VPL for Moodle - http://vpl.dis.ulpgc.es/
# Script for running C++ language
# License http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
# Author Juan Carlos Rodríguez-del-Pino <jcrodriguez@dis.ulpgc.es>

#load common script and check programs
. common_script.sh
check_program g++

get_source_files cpp C
#compile
g++ -std=c++11 -o vpl_execution $SOURCE_FILES -lm -lutil
======================================
In reply to Juan Carlos Rodríguez-del-Pino

This forum post has been removed

The content of this forum post has been removed and can no longer be accessed.
In reply to Deleted user

Re: Java GUI with VPL

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Stephan,
Many type of linux GUI-based programs can be run in VPL. The limitations of this execution environment are imposed by the VNC server that allow this feature.
The Java example that you say was anonymously added and it works.
You can run it by using the account teacher1/teacher.
I show you a screenshot just taken.

Best regards.
Juan carlos.

Attachment Captura.jpg
In reply to Juan Carlos Rodríguez-del-Pino

Different Jail Server for Different Programming Language

by Reza Ervani -

First of All, We want to say thank you, VPL is great Module.

Can we run different jail server for different programming language ? Like jail server A for python activities, jail server B for java activities, and so on.

Thank you,

Regard,

Reza Ervani

http://sekolah.rumahilmu.or.id

In reply to Reza Ervani

Re: Different Jail Server for Different Programming Language

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Reza,
VPL allows to configure what execution servesr must use any activity. You set it, for an activity, at "VPL administration"=>"Advanced settings"=>"Local execution servers". Beware to add "end_of_jails" at the last line to avoid the use of the common execution servers.
If you want an easy and better control then use the "based on" feature. Create a new VPL hidden activity as base for other activities (not for use really as an activity) e.g. "Base for python activities". Set in this activity the "local execution servers" and then select this activity as "based on" for all activities that use these execution servers.

Best regards.
Juan Carlos.


Attachment Captura.PNG
Attachment Captura1.PNG
In reply to Juan Carlos Rodríguez-del-Pino

Re: Auto-grading output does not match expected output

by Garth Brady -
I am finding that the auto-grader does not always look for exact matches with regard to Expected Output and the user's submission.  In the example below, the question calls for students to change the delimeter of the list from a ',' to whatever character is at the end of the list. Why is the auto-grader returning a pass when the output does not match?


Case=1
input=72,40,11,81,15,28,54,27,51,77,78,23,56,63,57,43,3,61,66,63,68,46,81,*
output=3*11*15*23*27*28*40*43*46*51*54*56*57*61*63*63*66*68*72*77*78*81*81*

Code:

$input = trim(fgets(STDIN));
$array = explode(",", $input);
$d = array_pop($array);
sort($array);

//output
foreach($array as $number) {
echo $number . '|';
}

Result:

3|11|15|23|27|28|40|43|46|51|54|56|57|61|63|63|66|68|72|77|78|81|81|

Note how the Result and the expected output are quite different.  Why does VPL return a pass here?

In reply to Garth Brady

Re: Auto-grading output does not match expected output

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

I'm not personally familiar with the VPL or its autograder, but just posing a suggestion...

Could the output be treating the '*' as a regex wildcard and therefore accepting any character?

In reply to Garth Brady

Re: Auto-grading output does not match expected output

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Garth,
as you can read in part "Creating automated tests" at "http://vpl.dis.ulpgc.es/index.php/support" there are four types of output matches: only numbers, text , exact text, and regular expressions.
How the system choose a type of matching ?
- If the output definition is enclosed in double quotes then it is an exact match.
- If the output definition start with a slash and has another slash then it is a regular expression.
- If the output definition, after ignoring all posible separator (all char except numbers [0-9], dots and alphas [a-z] and [A-Z]), is a list of number then the type "only numbers" are used. Notice that the matching is done ignoring the same chars in the program output.
- If the output definition does not match with the cases above, then the type "text" is used. Notice that the match is done ignoring not alpha and number chars.

In the case that you shown, the matching selected is "only numbers" and the separators ",", "*", and "|" are ignored. I think that type of matching your are looking for is "exact text".

Best regards.
Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: Auto-grading output does not match expected output

by Garth Brady -

Thanks Juan,

Your documentation is quite clear - sorry I missed this!  And, yes, exact text is what I'm looking for.  Thanks again!

In reply to Juan Carlos Rodríguez-del-Pino

Re: Possible bug

by Garth Brady -

Greetings,

When using php and 'exact text', if the program contains an empty line 1 (for example, <?php starts on line 2) then the output, even though identical, returns an error.  Example error:

--- Program output ---

Player 1 wins in round 5

--- Expected output (exact text)---
Player 1 wins in round 5

In this case, the outputs are identical, but the problem was that the starting php tag (<?php) was on line 2 and line 1 was empty.
In reply to Garth Brady

Re: Possible bug

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Garth,

thanks for your bug report. The test program works well; the problem you see is related to the way we show the student's program output. You can see a correct output in the submission view. The problem is that we used the <pre> tag to show the output, and it seems that if a newline follows the tag then the newline is rnot shown by the browser.

This issue is resolved in VPL 3.2.

If you want accept both answers notice that you can set two or more output for every case.

 

Best regards,

Juan Carlos.


In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Garth Brady -

I am seeing some students try to cheat VPL by writing very little code and the clicking 'Evaluate' only to then take the expected output and write very simple programs in an attempt to fool the auto-grader such as:

if($expectedOutput == caseOneExpectedOuput) {

echo 'case1 expected output';

} elseif ($expectedOutput == caseTwoExpectedOutput) {
}

echo 'case 2 expected output';

}

I'm sure there's a way to combat this... does anyone have any suggestions?

In reply to Garth Brady

Re: New Virtual Programming Lab (VPL) module

by Aivar Annamaa -

I've combated test-based cheating by adding more tests or changing tests after submission deadlines.

I usually set up mu tests so that in order to gain one point, the submission must pass couple of tests and there are several of such groups of tests. After submission deadline, I add one or two tests to each group and run the grading process again.

In reply to Aivar Annamaa

Re: New Virtual Programming Lab (VPL) module

by Garth Brady -

Is there a way to dynamically change the Input for each case?  

For example, I'd like to generate random email addresses to help teach my students the use of regular expressions through validation.  This makes a lot of sense to me since if the email address is randomly generated, my students can't "cheat the system".

In reply to Aivar Annamaa

Re: New Virtual Programming Lab (VPL) module

by Garth Brady -

This is an interesting approach, Aivar.

If we could dynamically populate the Test Cases file using a script that randomly populated the input data and matched the expected output data, this would solve our problems nicely.  For example, if there were a script such as this that created the Test Case file:

//generate Test Case File
$numberOfCases = 10;
for($x=1;$x <= $numberOfCases;$x++) {
     $num = rand(0,20);
     if($num < 9) {
          $output = "The number " . $num . " is less than 9.";
     } else {
          $output = "The number " . $num . " is greater than 9.";
     }
     echo "Case=" . $x . "\r";
     echo "Input=" . $input . "\r";
     echo "Output=" . $output . "\r";
}
In reply to Garth Brady

Re: New Virtual Programming Lab (VPL) module

by Aivar Annamaa -

You can do dynamic testing if you give up the high-level interface (vpl_evaluate.cases) and use lower level vpl_evaluate.sh instead.

vpl_evaluate.sh should be a Bash script which creates the actual testing script (named vpl_execution, can be written in any programming language).

Here's a sample vpl_evaluate.sh for tests written in Python:

#!/bin/bash
printf '#!/bin/bash\n' > vpl_execution
printf 'PATH=$PATH:/usr/local/bin\n' >> vpl_execution
printf 'export PYTHONIOENCODING=utf-8\n' >> vpl_execution
printf 'source vpl_environment.sh\n' >> vpl_execution
printf 'python3 tester.py\n' >> vpl_execution
chmod +x vpl_execution

vpl_execution can read the names of the submitted files from environment variable VPL_SUBFILES (this comes from vpl_environment.sh).  It should output test results between <|-- and --|> and grade after Grade :=>>.

For more details see the help link on "Execution Files" page or http://cs.smith.edu/dftwiki/index.php/Moodle_VPL_Tutorials, or https://www.amazon.com/Developing-Programming-Courses-Moodle-VPL-ebook/dp/B01FE2A9U4



In reply to Aivar Annamaa

Re: New Virtual Programming Lab (VPL) module

by Garth Brady -

Aivar, thank you so much for sharing your knowledge here.  I am certainly a rookie at this point (and am learning bash scripting online)...  I have a copy of Aldo's book (which you appropriately recommend above) but I'm having difficulty relating his examples to our circumstance.  In our case, we're teaching students php and we'd like to dynamically produce the test cases file (vpl_evaluate.cases) and then use vpl to auto-grade.  Do you have any thoughts on how we'd write the bash scripts?

In reply to Garth Brady

Re: New Virtual Programming Lab (VPL) module

by Aivar Annamaa -

Garth, if you gave me a sample task that you give to your students, then I might be able to provide you the necessary script templates.

In reply to Aivar Annamaa

Re: New Virtual Programming Lab (VPL) module

by Garth Brady -

Hi Aivar,

Thanks so much!  Let's say I want to generate a series of test cases where they look something like this:

Case = Test 1
Input=3
4
+
Output = 3 + 4 = 7

How would you go about generating the linux scripts?  Thanks again!

In reply to Garth Brady

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Garth,
I will try to help you on how to populate vpl_evaluate.cases programmatically.

1) First you need to reproduce what is happend by default
    a) Take default_evaluate.sh(*) file and save it as vpl_evaluate.sh in "execution files"
    b) Take vpl_evaluate.cpp(*) and save it as vpl_evaluate.cpp in "execution files" (new file)
2) Add code to vpl_evaluate.sh in "execution files" to generate programmatically your "vpl_evaluate.cases".

(*) This files are part of VPL and you can take it from vpl/jail/default_scripts/ VPL source directory.
Also from github

moodle-mod_vpl/jail/default_scripts/default_evaluate.sh

To avoid replicate this process for every activity, it is recommend to use the "based on" feature in "execution options".

I have add to the TODO list for the VPL 3.3 add a feature to facilitate this procedure.

Best regards,

Juan Carlos


In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Garth Brady -

Hello Aivar and Juan,

Thanks so much for your guidance!  I have made the changes Juan recommends above, but am still uncertain as to how to use vpl_evaluate.sh to populate the vpl_evaluate.cases file.  Given my example above with simple addition, would you be able to provide a sample vpl_evaluate.sh?

In reply to Garth Brady

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Add this code to vpl_evaluate.sh

php << "END_OF_PHP" > vpl_evaluate.cases
<?php
//generate Test Case File
$numberOfCases = 10;
for($x=1;$x <= $numberOfCases;$x++) {
$num = rand(0,20);
if($num < 9) {
$output = "The number " . $num . " is less than 9.";
} else {
$output = "The number " . $num . " is greater than 9.";
}
echo "Case= test" . $x . "\n";
echo "Input=" . $num. "\n";
echo "Output=\"" . $output . "\"\n";
}
END_OF_PHP

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Garth Brady -

Hi Juan,

I tried adding appending your script to vpl_evaluate.sh and when I click 'Evaluate'  in 'Test Activity' the comment is "No test case found".  I apologize for not being able to troubleshoot this myself...  I am trying all sorts of variations but am coming up short.

In reply to Garth Brady

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Apologise for my short explanation, appending the code to the end, you need to rename vpl_evaluate.cases by evaluate.cases.

The code is correct if you add it before  "#exist run script?"

In your case, it is preferable to add it to the end. If you are going to use "based on" then you need to add only the generating code to vpl_evaluate.sh.

Notice that "based on" append the diferents "vpl_evaluate.sh".

To avoid more issues with the code I have attached the tested files.

best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Garth Brady -

Hi Juan,

Thanks so much for this explanation!  I placed the generating code before "#exist run script?" as you suggest and it works just fine - no problems.  

However, when I append it as you do in the zip file to vpl_evaluate.sh,  clicking on 'Evaluate' still returns the error 'No test case found".  Note: I was not able to rename vpl_evaluate.cases (as I'm guessing this is a core file for vpl) so I created a new empty evaluate.cases as you recommend above.

UPDATE:  Oops - My mistake.  All is working well now.  I forgot to keep evaluate.cases when running.

Thanks so much, Juan!

In reply to Garth Brady

Re: New Virtual Programming Lab (VPL) module

by Garth Brady -

This is really excellent - many thanks again, Juan.

I feel a little stupid that we went through all this and I've only now discovered a problem I should have foreseen:  Because the results are randomized, the evaluation varies.  In my example above:

  • we test a number between 0-20, and if it's greater than 10 the program outputs, "$num is greater than 10", 
  • if we omit the other 1/2 of the program which says "$num is less than 10"  (meaning it should only give a mark of 50% each time it's run), the rand function is inconsistent
  • in my experience, the evaluation of the student's program varies wildly up to 25% (marks between 36% & 66%/100) even when I generate 100 test cases
  • I imagine students simply re-submitting their code many times and, even though they can't figure out how to get 100%, just submitting their code over and over again till they get the best mark that the rand() function will allow...

Any thoughts on my predicament here?  I'm too tired to think more...

In reply to Garth Brady

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hello Garth,

I think that you must use random numbers to generate different cases inside every "equivalence class partition" but not to select the "equivalence class partition" used. Of course, you must always cover all the "equivalence class partitions"

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Garth Brady -

Hi Juan,

Yes, you are correct.  I realize this is a very, very basic example of methodology, but I was trying to wrap my head around how I would grow this process for more complex algorithmic analysis.  I've realize that I don't want to randomize the data as a whole, but randomize the data according to specific cases.  Don't know why I couldn't realize this last night at midnight!  So, this code makes much more sense and satisfies my need for randomization of data:

//generate Test Case File
$numA = rand(0,499);
$numB = rand(501,1000);
//build Case 1
echo "Case= test 1" ."\n";
echo "Input=" . $numA. "\n";
echo "Output= The number " . $numA . " is less than 500.\n";

//build Case 2
echo "Case= test 2" ."\n";
echo "Input=" . $numB. "\n";
echo "Output= The number " . $numB . " is greater than 500.\n";
In reply to Garth Brady

Re: New Virtual Programming Lab (VPL) module

by Khadija EL KHARKI -

 

Hi,

I tried adding appending my script below to vpl_evaluate.sh before #exist run script?  and when I click 'Evaluate'  in 'Test Activity' the comment is

 

"«/home/p14500/vpl_evaluate.sh: line 17: syntax error near unexpected token `(' /home/p14500/vpl_evaluate.sh: line 17: `int main() {'".  

 

And also, when I click on Run I have this error

 

"/tmp/ccH1rY2Y.o: In function `main': vpl_evaluate.cppsad.text+0x702a): multiple definition of `main' /tmp/ccOARpbM.o:bienvenue.cppsad.text+0x0): first defined here collect2: error: ld returned 1 exit status".

 

 

#include <stdio.h>

int main() {

    int A=0;

    int B=0;

    int Somme;

    printf("Entrez le premier nombre : \n");

    scanf("%d", &A);

    printf("Entrez le deuxième nombre : \n");

    scanf("%d", &B);

    Somme=A+B;

    printf("La Somme de %d et %d est : %d ",A,B,Somme);

    return 0;

}

 


In reply to Khadija EL KHARKI

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Ms. Khadija,
VPL can test the output of C programs by filling the vpl_evaluate.cases file. You don't need other customization. If you want that your students use only C language you can add a file name, e.g. "sum.c", to the "requiered files".
The problem here may be the configuration of vpl_evaluate.cases, notice that you can use different types of output test, see "Creating automated tests" at http://vpl.dis.ulpgc.es/index.php/support
For example, if you use numbers only type your test can be flexibles, your students can introduce free text around the numbers. If you want a fixed test you can used exact text using "exact text" or *"exact text". You also can use a flexible test using regular expresions with /regexp/.

You can see an example of your test, login as teacher1 pass teacher at
http://demovpl.dis.ulpgc.es/moodle/mod/vpl/view.php?id=426

Best regards,
Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Garth Brady -

Thanks again so much for the example above.  I've been using this method successfully for a long time now.  My colleagues would like to use this same method for creating test cases in compiled languages such as C#, cpp, java...  but the method used for interpreted languages (i.e. php above) don't work here.  For example, this does not work as the command 'java' requires more arguments that I can't figure out:


java << "END_OF_JAVA" > vpl_evaluate.cases


java << "END_OF_JAVA" > vpl_evaluate.cases
//this would be java code
//generate Test Case File
$numberOfCases = 10;
for($x=1;$x <= $numberOfCases;$x++) {
$num = rand(0,20);
if($num < 9) {
$output = "The number " . $num . " is less than 9.";
} else {
$output = "The number " . $num . " is greater than 9.";
}
echo "Case= test" . $x . "\n";
echo "Input=" . $num. "\n";
echo "Output=\"" . $output . "\"\n";
}
END_OF_JAVA

Since many of us don't know bash very well, it is ideal if we can write these random test case files in our native languages (as I can above in php).

In reply to Garth Brady

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Garth,
The bash script for PHP is a special case. For compiled languages the equivalent procces may have following steps:
1. Save the source code of the generator program. This step can be skipped if you write the file at "execution files"
2. Compile the generator
3. Run the generator redirecting the output to vpl_evaluation.case
Example for c language:
#step 1

cat << ENDOFFILE > generator.c
// Write here the source of the c generator

ENDOFFILE
#step 2
gcc -ogenerator generator.c
#step 3
./generator > vpl_evaluate.cases

#... other commands


Best regard,
Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Garth Brady -

Many thanks, Juan.  This runs well and generates 'Expected Output' perfectly when executed.  However, when we Evaluate the following student 'testing.c' program, the student code is not compiled.  It is output as plain text instead.  This is the code in testing.c:

#include <stdio.h>
int main()
{
   // printf() displays the string inside quotation
   printf("Hello, World!");
   return 0;
}

And this code outputs as plain text in --Program Output-- exactly as it is above.

In reply to Garth Brady

Re: New Virtual Programming Lab (VPL) module

by Garth Brady -

Sorry for the trouble - my issue was in my vpl_run.sh script.  I changed it to the following, and now code is being correctly compiled:


#!/bin/bash
# Default C language run script for VPL
# Copyright (C) 2014 Juan Carlos Rodríguez-del-Pino
# License http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
# Author Juan Carlos Rodríguez-del-Pino 

#load common script and check programs
. common_script.sh
check_program gcc
get_source_files c
#compile
gcc -o vpl_execution -std=c99 $SOURCE_FILES -lm -lutil 
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Patrick Marshall -

We have been making good use of VPL at Maynooth University. Thank you for this well received module.

I'm just wondering is it possible to expose the moodle userid to use in the vpl_execution files.

Thanks,

Patrick


In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Jonghwa Park -

Dear Juan Carlos Rodríguez-del-Pino

I have installed your vpl plugin for moodle which is vpl3.1.5 and vpl jail execution system 2.2.1.

But I read your advice not install same machine running apache and jail system.

So I want to uninstall jail system safe. What is best way uninstall jail system?

rm -rf /jail not work read only permission.

Thanks.

p.s I'm using Ubuntu 14.0.4

In reply to Jonghwa Park

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello  Jonghwa Park,

You can use the script "uninstall-sh" that came with the source code. If you want to do it by hand you can use this commands.
sudo service vpl-jail-system stop
sudo update-rc.d -f vpl-jail-system remove
sudo rm -Rf /etc/vpl


Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Jonghwa Park -

Thanks your fast reply.

I have another question using your vpl plugin.

Our system is only have one machine which is running moodle server using apache2.

I want using vpl plugin. What is best way one machine system using vpl?


I have read other people using virtualbox and so on.

Our system have only one public ip and only open two port 80, 443 and I'm using 80 port for moodle hosting.


Thanks a lot.


In reply to Jonghwa Park

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Jonghwa Park,
if you server lets you install virtualbox you can share better your machine. The use of virtualbox help you to isolate the resource used by the students programs and the LAMP that serves Moodle. You must:
1) Configure your jail server to use 443 as port for the http protocol
in vpl-jail-system.conf write
PORT=443
SECURE_PORT=444
URLPATH=/YOURKEY
2) Configure your virtualbox network as bridge or set port forwarding of 443 to internal 443
3) Set, in the Moodle VPL plugin setting, as execution server:
http://yourserver:443/YOURKEY
4) Remove the use of https in your apache(or other server) configuration.
5) Restart all services.

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

This forum post has been removed

The content of this forum post has been removed and can no longer be accessed.
In reply to Deleted user

Re: Test Cases for specific functions

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Stephan Lehmler,
You must notice that your question is not related to any particular programming language and the short answer is: there is not option to acomplish this particular request.
But I can sugest you a solution used by some mates here. They write an simple program as interface with the default test system. This program reads a value to select the function/method to test. Then read the parms to call function/method and then show the results. The test cases they write take this process into account. Notice that you must write the interface program into the execution files.

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

This forum post has been removed

The content of this forum post has been removed and can no longer be accessed.
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Gayashan Amarasinghe -

Hi,

We are planning to use the VPL plugin for auto grading at University of Moratuwa, Sri Lanka. I have few questions regarding the plugin.

  1. What are the exact meanings of each execution options (Based on, Run, Debug, Evaluate, Evaluate just on submission, Automatic grade)?
  2. Can we limit the number of test cases displayed to students? (I read that you can display a certain set of test cases to students and later change them and re-evaluate. It is actually fine for our requirement. I just want to know if this is possible.)
  3. Do you have some documentation for extending the languages used? (For an example using MySQL instead of SQLite.)

Thank you very much for creating such a comprehensive plugin. It saves lots of time for many people.


In reply to Gayashan Amarasinghe

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Gayashan Amarasinghe,

I will try to answer your questions:

A1- First I must say that you can click on the "?" question mark near the title e.g. "Execution options... (?)" and see a help text. I know that this helps may be some times may need updates or are not clear enough.

Based on: Here you select other VPL instance to be the base of this one. Then some features are taken "dynamically" from this other instance:
        Take all the execution files. If you write new ones with the same name, the last are taken, except for the predefined scripting files (vpl_run.sh, ...) in this case the new are concatenated.
        Take the description, but if you write new description then they are concatenated.
        Take the limits for the execution resources and the file size.

        Run, Debug and Evaluate: these switches allow that this options be available in the editor to the students.

    Evaluate just on submission: the submission is evaluated (run the script that evaluate) when it is uploaded. This action only happens when you upload files in "submission" option but not in the editor.

    Automatic grading: This switch does that the information taken from the evaluation will be takes as "grade" and not as "proposed grade". The grade is done without teacher review.

A2- No. This is not possible at this moment. But this feature is at first position in the TODO list. This will be a feature in the next VPL release.

A3- No. Notice that the limit is the environment of execution and the politic of "execution without leaving a trace in the jail server". In the case of MySQL you need to install a server with user authentication or a server for every run.

Best Regards,
Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

VPL - Where are submitted files stored?

by Aivar Annamaa -

Hi!

I'd like to analyze my students' VPL usage. I found the tables with mdl_vpl_ prefix in Moodle database, but I didn't find the place where the submitted files are stored. Can you please tell me, which are the other tables related to VPL?

Other question -- As I don't have access to my university's Moodle database directly, I backed up the course and restored to my own Moodle installation. Unfortunately, in the restored course I saw only single submission per student per assignment. Is it intentional? Is there a way to access all submissions via backup and restore?

In reply to Aivar Annamaa

Re: VPL - Where are submitted files stored?

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
HI Aivar,

As Moodle does VPL save the files outside the DB, These files are saved into the moodledata/vpl_data.
The VPL backup intentionally save only the last submission. The reason is that the size of the backup file may be huge. It is easy to modify the code to backup all submissions, but this change must be done in the server.
https://github.com/jcrodriguez-dis/moodle-mod_vpl/blob/v3.2/backup/moodle2/backup_vpl_stepslib.php#L206

Other users has requiere the possibily of download all submissions, and it is already in the TODO list in a good possition, ready for the next release.

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

disable copy in in new editor

by deepa ganu -
Hi Jaun , 

Greetings ! The feature  

Allows setting editing restrictions and avoiding external text pasting

does seem to be working for me. These are my settings a


And when I try to paste in ww

I am easily able to paste in.

In reply to deepa ganu

Re: disable copy in in new editor

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hello Deepa,
your bug report and others has lead to a bug fix release.
The problem has been resolved in the v3.2.1.
But notice that the paste action is only limited to students.

Best regards,
Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

Coding to delete user from execution serve

by Prakash Raju -

Hi juan, 

When we create any program, after the execution is over, the user directory created inside jail server is automatically deleted. Can you point me to the file that has the coding to delete this directory? 

Also it would greatly help if you could give me a short explanation of exactly when this file is triggered and the logic behind it.


Thanks,

Praveen Kumar


In reply to Prakash Raju

Re: Coding to delete user from execution serve

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hi Praveen,

the process of removing the user's directory is made by the vpl-jail-server daemon.
If you want to modify this behaviour you can go to
https://github.com/jcrodriguez-dis/vpl-xmlrpc-jail/blob/master/src/processMonitor.cpp#L457
and change the code.

The daemon cleans this directory after the user's code execution has stopped (for interactive execution) or after the evaluation results has been retrieved (or after a timeout)

Best regards,
Juan Carlos
P.D.: the daemon supposes that the users' home directories are removed after a while. If you keep the directories for ever after enough executions the system will stop to function properly.

In reply to Juan Carlos Rodríguez-del-Pino

Re: Coding to delete user from execution serve

by Prakash Raju -

Hi juan,

That should help. Actually i am planning to bring mysql into jail and have the script working to acheive it. I want to delete the tables created by user after his execution is over or evaluation results are retreived. When exactly to trigger this script to delete the tables is what i need to know.


Also, if i want to check for keywords in user programs before the code is submitted in jail, where iniside the vpl directory should should i add my piece of code to have an additional input box asking keywords from questions setter. Also how would i make the checking and stop the program from exexuting if the keywords are not found?

I think this feature is necessary for VPL itself because I've seen students solving C++ and php programs in the procedural approach rather than solving the same using the OO Approach eventhough its meantioned in the question. This feature can solve that problem.


Regards,

Praveen Kumar

In reply to Prakash Raju

Re: Coding to delete user from execution serve

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Praveen,
we are working to improve default evaluation program, this will include:
Global level
* Set a grade reduction by evaluation
* Set a number of evaluation without grade reduction
Case level
* Set the text to show (instead of default) when the case fail
* Set the program to run instead of student program. This allow to run other tests, e.g. check if OOP is used.
* Test based on program exit code

These features will be incuded in the v3.3 and we think will fullfit many of the request seen in the forum.

Best regard,
Juan carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Robert Harle -

Hi Juan et al,


Has anyone succeeded in getting a Java swing app running over the VNC link when clicking Run?  I have a default VPL activity set to allow Run.  I enter  simple Swing app and click Run but all I ever see is a blue VNC screen.  Looking on the server, I can see the java app is running (and he VNC window keeps the connection open).  I'm probably missing something obvious - I'd be grateful for any ideas.  Here's my test class:

i mport javax.swing.JFrame;


public class GUITest extends JFrame {

public GUITest() {

super("Test");

setDefaultCloseOperation(EXIT_ON_CLOSE);

setSize(500,400);

}


public static void main(String[] args) {

GUITest gui = new GUITest();

gui.setVisible(true);


}

}

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Garth Brady -

Greetings,

I am attempting to use VPL to connect to the sqlite server running on a jailserver.  I am seeing this problem, even on the demo server:

PHP Fatal error: Uncaught Error: Class 'SQLite3' not found

I believe that the install script for the jailserver needs to be updated to include:

sudo apt-get install php7.0-sqlite3

Does this seem correct?

In reply to Garth Brady

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Garth,
the script that install the jail server 2.2.1 includes the installation of the package php-sqlite3. In Ubuntu 16.04 this package includes php7.0-sqlite3.

See
https://github.com/jcrodriguez-dis/vpl-xmlrpc-jail/blob/2.2.1/install-vpl-sh#L245

Best regards,
Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Garth Brady -

Sorry Juan,

You are correct, and I should have looked there first.  Why is it then that your demo server is returning this error?  I assume your demo server is running this php module, right?

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Prakash Raju -

Hi juan,

Can we replace the default IDE of vpl to something like http://codiad.com/. If yes, what are the files I need to replace to achieve this?


Thannks,

Praveen Kumar

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by vishal kamble -

Hi

I am very glad to use this VPL Activity in moodle. I have installed vpl-jail-system-2.2.1 and VPL 3.2 moodle plugin

I have tried  all programming languages . i found two problem while using this

1. Error while running SQL program like

"The execution server needs to install "sqlite3" to run this type of program"

can you tell me what wrong & how i can install sqlite3 in execution server

2. While running java applet program it will run but output console / screen not showing anything ?

In reply to Juan Carlos Rodríguez-del-Pino

Finding the User name of VPL user from script

by Prakash Raju -

How can i find the username of the user who is currently executing the program from within jail by use of Script. Executing whoami or $USER only tells the username of the OS and not jail

Also, it would be handy if you have any documentation of how jail server works to make any modifications with their working

In reply to Prakash Raju

Re: Finding the User name of VPL user from script

by Aivar Annamaa -

There should be environment variable MOODLE_USER_NAME.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Neider Vergara Humánez -

Hi Juan, Happy New year.


I have just updated my Moodle site, i used to have a correct configuration of my moodle connecting with my VPL-Jail-system, but nowadays i´m havings troubles with the connection to the server, when i try to check using http://server_name[:port ]/OK i get the answer "OK" but when using it from Moodle i get de message: "Conection fail".

Please, if there is any documentation about this trouble let me know about it.

Thanks for your attention.


Neider. 

In reply to Neider Vergara Humánez

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Neider, happy new year
Please detail the version of Moodle, VPL, jail server and jail server OS. Please also detail the activity and action that replay to the error.

Best regards,
Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Neider Vergara Humánez -

Hi Juan.

Thanks for your answer.

I´m using Moodle 3.2+ with VPL 3.1.4 and 2 servers with vpl-jail-system 2.2.1.

I even tried with the test server http://demojail.dis.ulpgc.es.

In Check execution servers i got Current status: Ready and 0 Errors, but when trying to make a simple test with "hello world" and click Run i got the message "Conection Fail".


Thanks for your attention.


Neider.

In reply to Neider Vergara Humánez

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

If the description of your VPL version is not a typing error, then you must update VPL to the latest version (currently 3.2.4).
If you are already using VPL 3.2.4 please, read this issue similar in symptom to yours.
https://github.com/jcrodriguez-dis/moodle-mod_vpl/issues/42

I guess that it is not the same, but the information I need to try to spot the problem is similar.

Best regards,
Juan Carlos


In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Neider Vergara Humánez -

Thanks for your answer Juan.

Maybe this image can clear a little this issue.


Issue_VPL_ConnectionFail

I've updated my VPL version for Moodle like you recommended.


Thanks for your time and attention.


In reply to Neider Vergara Humánez

Re: New Virtual Programming Lab (VPL) module

by Neider Vergara Humánez -

Hi Juan.

Thanks for your time.

I haved solved my issue, it was a thing with Proxy configuration.

Sorry for the wasted time.


Thanks for yor attention.


Neider.

In reply to Neider Vergara Humánez

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Neider,
I am happy knowing that you have solved your problem.
I know that the message from VPL is not detailed, but notice that for security reasons the browser does not give information programatically of the fail reason, the browser only give detailed information to the user of the browser as you see in your screenshot.

Best regards,
Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

sqlplus Command not found error

by Prakash Raju -

Hi Juan,

Sorry to bother you so many times. But I've been trying to solve this problem for more than 3 days now and still, Couldn't figure out the solution. The problem is this.

I installed jail server, MySQL and oracle 11g  onto ubuntu 15.04LTS. Installed oracle XE following this link. http://askubuntu.com/questions/566734/how-to-install-oracle-11gr2-on-ubuntu-14-04. I managed to connect to MYSQL using vpl_run.sh to execute user queries. But the same was not possible with oracle. It always says sqlplus: command not found .

Oracle installation directory /u01/app/oracle/product/11.2.0/xe/

Jail server directory where OS like simulation is made: /home/jail/


But sqlplus command works as expected when logged in as any normal user from shell directly since i've set all oracle related path in /etc/profile. 

I got the same error even after exporting all oracle related path in vpl_run.sh. 

When i said /u01/app/oracle/product/11.2.0/xe/bin/sqlplus USERNAME/PASSWORD in vpl_run.sh instead of just sqlplus, vpl reported sqlplus file not found. So i think the jail users cannot access a directory outside of vpl directory.  Is there any way to make jail users access this /u01 directory where oracle is installed, its subfiles and oracle-xe service.

 

Thanks,

Praveen Kumar

Attachment Capture.PNG
In reply to Prakash Raju

Re: sqlplus Command not found error

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Praveen,
I think that the easy solution is to install Oracle at another directory: /bin, /usr, /lib, /lib64, and /var/lib. This directories are accessible from the jail.
Other solution is to modify the service to include the /u01 directory
see
https://github.com/jcrodriguez-dis/vpl-xmlrpc-jail/blob/master/vpl-jail-system.initd#L201

best regards,
Juan Carlos.


In reply to Juan Carlos Rodríguez-del-Pino

Test cases output parsing

by Davide Bresolin -

Hi Juan,

I have a question on the output statement in the automatic evaluation. I have a "vpl_evaluate.cases" file with  the following content:

output=
741746
851993
end

However, the behaviour of the automatic evaluation is not what I expected. A submission producing the following output passes the test:

741746
741746
851993
end

while one producing the following ouput does not:

741746
741746
851993
851993
end

I am using VPL 3.1.4.

What I have to put in "vpl_evaluate.cases" to be sure that both the above examples fail the test? (I don't want duplicated numbers in the result)

Sincerely,

Davide

In reply to Davide Bresolin

Re: Test cases output parsing

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Davide,
the output case has different types. In this case you are using text match but this type is flexible and check only the last tokens ignoring the rest.
See
http://vpl.dis.ulpgc.es/index.php/support#testcases
may be that you need to use the type "exact text".

best regards,
Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: Test cases output parsing

by Davide Bresolin -

Hi Juan Carlos,

thanks for your answer. Indeed, the relevant part of the output is the sequence of numbers. "end" is only a placeholder that marks the end of the output. So maybe only "numbers" is a better type. But in this case, non-numerical tokens are ignored, right? So there is no way to check whether the solution outputs only numbers?

Sincerely,

Davide

In reply to Davide Bresolin

Re: Test cases output parsing

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Please, remove the text "end" from the output. If the output definition contains only number (and separators) then the checker will ignore all but numbers in the program output.

e.g.:
output =
432
4234
11


best regards,

Juan Carlos.


In reply to Juan Carlos Rodríguez-del-Pino

Tárgy: New Virtual Programming Lab (VPL) module

by Daniel P. -

Dear Juan-Carlos!

I upgraded my VPL installation to 3.2.4

I very much like the new design, and the new functions.
So far, I built a lot of exercises using this awesome plugin.
Thank you very much for your effort to provide us such a great tool.

After the upgrade I discovered that the Edit part does not load if I use Internet Explorer 11 (Note, every other browser I tried works perfectly: Chrome, Firefox, Edge, Opera). I use Windows 10.
After that I tried to use your demo page, and I experienced the same.

I did not use IE regularly, so the settings are probably the default.

Do you have any idea what is happening and what to do?

Thanks in advance,
Daniel

In reply to Daniel P.

Re: Tárgy: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Daniel,
thansk for your bug report. The problem is at
https://github.com/jcrodriguez-dis/moodle-mod_vpl/blob/v3.2.4/editor/VPLIDEButton.js#L303

to resolve the problem you can use the new internal version 3.2.5
https://github.com/jcrodriguez-dis/moodle-mod_vpl/tree/v3.2.5
at this moment with this chage from 3.2.4
https://github.com/jcrodriguez-dis/moodle-mod_vpl/commit/7393e248fb6aab89b4b42c683716393badca780f

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Firewall issue with VPL

by Prakash Raju -

Hi Juan,

I have set up Moodle and jail server  in AWS with 2 separate instances. The jail server is running on port 80 same as moodle. All functionalities of VPL work normal when i connect from home or personal internet. But, run and evaluate doesn't work when connected from office network. I also experienced the same issue when trying to connect behind various firewalled networks. I even tried the demo link, but the same problem persisted. The strange thins is that, when i type <URL>/OK in browser even from office network, i get OK response but cannot connect run or evaluate

Can you explain why is this happening. Is XML-RPC the cause of problem? Because, my jail server is running in port 80 and my office allows all inbound and outbound connections to port 80 for all URL's except social sites. Is there any workaround for this issue without doing anything with the firewall? It would greatly help me if you could give me your suggestions.

I use VPL 3.2.2 with Jail server 2.2.1 and moodle 3.1.


Regards,

Praveen Kumar

Attachment errorInFirewall.PNG
In reply to Prakash Raju

Re: Firewall issue with VPL

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Praveen Kumar,
as you describe, it seems that you have a configuration problem in your office network. I guess that your office is using not only a firewall but also a proxy.
VPL uses common http to connect to the jail server from Moodle (used to get the OK reponse) but uses Websocket protocol (a http extension) to connect the browser with the jail server and is known that some old proxy servers interfere with the Websocket protocol. I think that you must review your proxy configuration to spot the problem.

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: Firewall issue with VPL

by Prakash Raju -

But Juan, I face this firewall issue in almost all the firewalled networks. I faceed similar issues with CYBEROAM and sonicwall too on two different occasions. Will switching to wss instead of ws can have any positive effects? If so, how can i configure wss? 

Also, its nearly impossible for me to convince our office network team to change any settings from proxy or firewall. Please suggest any alternative solution to mitigate this problem


Thanks,

Praveen Kumar

In reply to Prakash Raju

Re: Firewall issue with VPL

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Yes, you can try using wss, proxies don't manipulate the ciphered traffic.
Please, tell us if this solve the problem.

Best regards,
Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: Firewall issue with VPL

by Prakash Raju -

Hi Juan,

wss did solve the problem. I just Used the self signed certificate that came with jail server installation. Now, I am trying to obtain free signed certificate from https://certbot.eff.org/. But i am unable to obtain the certificate.  Any ideas ? I am not sure if the method given from above link would work for Jail server. I've used this same link for setting up https with nginx and it worked perfect.  I selected the options shown in below image for jail server and couldn't make it work

If we can make this work, it might help a lot of people for free.

Thanks

Praveen Kumar

Attachment certbot.PNG
In reply to Prakash Raju

Re: Firewall issue with VPL

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Praveen,
I have not experience using cerbot, and I have not time to get the knowledge needed to advice you on how to use the command letsencrypt. I think that it will be better to ask this question in a cerbot forum.

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Robert Harle -

Hi all,

I have a graphical Java program I'm trying to run through VPL's VNC ability.  I have created a run script that creates vpl-wexecution.sh and the GUI pops up just fine.  I have two issues however:

i) No mouse event seem to register. The pointer changes when I enter the VNC box, but clicks/drags etc have no effect on anything.  Keyboard interaction is fine so I know the program is working OK

ii) the session screen resolution is a bit low: is there anyway to bump the default up?

Thanks!

In reply to Robert Harle

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Robert,
I need more information about the first issue that you report, please include your Java code to try to reproduce it.
If you want to change the pixel resolution modify in your jail server the file /etc/vpl/vpl_vnc_launcher.sh adding the option "-depth depth" to the vnc start command.

Best regards,
Juan Carlos

https://github.com/jcrodriguez-dis/vpl-xmlrpc-jail/blob/2.2.1/vpl_vnc_launcher.sh#L54


In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Robert Harle -

Ah, great. The display size works - thanks!

With VNC, I get it whatever I run. E.g. this run script produces a window with an xterm in it.  If I type, letters appear fine.  But no mouse events register - I can't drag the window, resize, etc.

#! /bin/bash

cat > vpl_wexecution << 'EOF'

#! /bin/bash

xterm

EOF

chmod +x vpl_wexecution

In reply to Robert Harle

Re: New Virtual Programming Lab (VPL) module

by Robert Harle -

Update: the problem seems to be my preferred browser (Chrome).  It all works fine on Firefox. mixed

In reply to Robert Harle

Re: New Virtual Programming Lab (VPL) module

by Robert Harle -

Ah - solved it.  It turns out that Chrome defaults to using a touchscreen as the mouse input device over the actual mouse.  A bit irritating but I can work with that.  

In reply to Robert Harle

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Sorry Robert,
I have not say that the VNC client used by VPL has problems with touch screens. It seems that does not manage touch screen events.

Best regards,
Juan Carlos


In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Robert Harle -

Ah. I spoke too soon.  If I change the desktop geometry of the VNC session (to e.g. 1200x800) , it displays in a 800x600 window.  This is visually fine: it scales the desktop, but the mouse is then uncalibrated (i.e. the window sends pointer positions in an 800x600 spac rather than 1200x800).  The obvious fix is to have the VNC window CSS to be 1200x800, but I'm not sure this can be done without modification of the moodle-side code, can it?  (I can't edit that)

In reply to Robert Harle

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Robert.
The 800x600 resolution was the fixed VNC resolution for VPL 3.1.x. VPL 3.2 removes this limitation. VPl 3.2 uses a initial VNC window size based on the current browser window size. To resize the window use the mouse over a border (holding click and moving the mouse slowly). The resize will take effect in the next execution.
see



Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Creating time bound programming activity

by Prakash Raju -

Hi juan, 

It's it possible to specify time limit based programming activity using vpl like we do with quiz? 


For example, a student can attend the program at any time, but can spend only 20 minutes totally for a specific program

In reply to Prakash Raju

Re: Creating time bound programming activity

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Praveen,
the feature that you describe is not available in VPL at this moment. I assume that this is a feature request and I add it to the TODO list.

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: Creating time bound programming activity

by Aivar Annamaa -

I have a related feature request:

  • Please let testing script know (eg. via environment variables), how many submissions the student has done for this exercise and when was the time of last submissions. (If you also add the time of first submission and/or first opening of the exercise, then it would be a low-level solution also for Praveen's problem)

(Sorry, I don't remember if I have already presented this request or not).

Best regards
Aivar

In reply to Aivar Annamaa

Re: Creating time bound programming activity

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Aivar,

thanks for your suggestions. The number of evaluations (no replicates) will be available via environment variables in the future 3.3 version of VPL. I hope to release this new version before the summer.

Your suggestion of give the elapse time from the first submission will be considered due to be an easy solution, but this approach is unreliable if we don't add

  • A new field in the activity table to save the limit time
  • A new field in the submissions table to save the start time
  • Ask the student if she/he wants to start the activity.
  • And finally, to add a first empty submission the first time the student accesses the activity with the start time.

I think that this information may also be used to adjust the grade mark by considering the time spend doing the activity.


Best regards,

Juan Carlos.


In reply to Juan Carlos Rodríguez-del-Pino

Storing Obtained output and Expected output in 2 variables using JavaScript

by Prakash Raju -

Hi Juan,

I've been trying to store the expected output and obtained output in two different variables by using javascript for further operations. But can't achieve this. I am trying to do this for a very long time and having no success. I am very certain that it has to be done from editor/VPLIDE.js , but can't figure out a logic in doing the same. Please help me with your ideas.

Also, the solution should work even if the program has no output or input


Awaiting your response.

Thanks,

Praveen Kumar

In reply to Juan Carlos Rodríguez-del-Pino

Querying the Jail Server form outside of Moodle

by Nathan Cunningham -

Hi there, 

Apologies if this is in the wrong forum - I'm trying to find out if there is a way to send files to the jail server using curl (or similar) - basically running and evaluating files inside the jail server without using Moodle.

Any help would be appreciated!

Thanks, 
Nat

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Luis Arévalo -

Dear Juan Carlos, 

First of all, we would like to congratulate you for your amazing software. We have used it for 2 years ( and so on)  with Python and Javan and it works perfectly. 

We are trying to use it with Sqlite and, after reading some forum, there are no problems. However we want to use it with more data (3 tables with 4000 tuples) and in this case it takes a long time to evaluate, since in each execution/evaluation, the create database script runs. 

So, we are trying to include the database file (vlp.db not .sql) in the execution files ("Files to keep when running") and not to delete it since students will only execute select queries.  Is it possible?  We tried this, but in this case VPL told us "file is encrypted or is not a database". 

We enclose our vpl_run.sh file. 

Thank you very much, 

Luis

In reply to Luis Arévalo

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Luis,
it is a good news to know that you are successfully using VPL in your teaching.
To get what you want, you must consider the following:
1) if you are using VPL previous to the 3.2 version you must use base64 to send the binary database file to the execution server.
2) Save your database file in the "execution files" of the activity
3) You must mark the database file as "Files to keep when running"
4) The database binary file must be generated in the same (similar) environment and version of Sqlite of the execution server.

Best regards,
Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Luis Arévalo -

Dear Juan Carlos, 

Thank you for answering so fast!!! We are using the last release of VPL as well as the last of Moodle. 

We have connected to vpl-jail and make the vpl.db file through the sql sentences. Later, we have uploaded to moddle and as you said in your response "Save the file in the execution files of the activity and mark the database file as "Files to keep when running". 

However the result is the same "file is encrypted or not database". We have modified vpl_run.sh for not deleting vpl.db and not insert and create the database (I enclose in the previous message). What is wrong??

Thank you very much for your support, 

Luis

In reply to Luis Arévalo

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Luis,
after replaying your problem, the conclusion is:
1- VPL is mishandled your '.db' files because consider that it is a text file.
2- VPL handles as binary the files with extension gif, jpg, jpeg, png, ico, zip, jar, and pdf.
3- The workaround here is to save your binary data as e.g ".pdf" and rename it as '.db' in your script.
4. Next VPL (v3.3) will include as binary files the 'tar' and 'bin' extensions. I don't know what more binary extensions to add.

It was my fault to say that you can use '.db' extension for binary files, sorry for the inconveniences.

Best regards,
Juan Carlos.

In reply to Luis Arévalo

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Luis,
after replaying your problem, the conclusion is:
1- VPL is mishandled your '.db' files because consider that it is a text file.
2- VPL handles as binary the files with extension gif, jpg, jpeg, png, ico, zip, jar, and pdf.
3- The workaround here is to save your binary data as e.g ".pdf" and rename it as '.db' in your script.
4. Next VPL (v3.3) will include as binary files the 'tar' and 'bin' extensions. I don't know what more binary extensions to add.

It was my fault to say that you can use '.db' extension for binary files, sorry for the inconveniences.

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Luis Arévalo -

Thanks you very much Juan Carlos. Your advice works perfectly and it takes 0 second. I rename my database to vpl.pdf in the execution files and later in the vpl_run.sh it is renamed to vpl.db. 

Regards, Luis


In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Денис Вахрушев -

Hi. Is it possible to check the task with random numbers in VPL? For example: fill an array with random numbers and display their sum.

In reply to Juan Carlos Rodríguez-del-Pino

This forum post has been removed

The content of this forum post has been removed and can no longer be accessed.
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Gerrit Leder -

Hello Juan,


I like the idea of random testing input. In order to evaluate the system under test it would be useful to store a reference implementation for the excercise in VPL. Is this on your road map for a new feature in VPL?


Thanks!

Gerrit

In reply to Gerrit Leder

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hello Gerrit,
it seems to be a problem with the default execution for R in VPL 3.2.4 please replace it with the following version. This new version has been tested in VPL 3.2.4 using R version 3.2.3 (2015-12-10). Apologies for the inconveniences.
Best regards,
Juan Carlos.
-------------------------------------------
#!/bin/bash
# This file is part of VPL for Moodle - http://vpl.dis.ulpgc.es/
# Script for running R language
# Copyright (C) 2017 Juan Carlos Rodríguez-del-Pino
# License http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
# Author Juan Carlos Rodríguez-del-Pino <jcrodriguez@dis.ulpgc.es>

#load common script and check programs
. common_script.sh
check_program Rscript
if [ "$1" == "version" ] ; then
echo "#!/bin/bash" > vpl_execution
echo "R --version | head -n3" >> vpl_execution
chmod +x vpl_execution
exit
fi
get_source_files r R
#Select first file
for FILENAME in $SOURCE_FILES
do
SOURCE_FILE=$FILENAME
break
done
#compile
cat common_script.sh > vpl_wexecution
cat $SOURCE_FILE >> .Rprofile
if [ "$1" == "batch" ] ; then
echo "xterm -e R --vanilla -f $SOURCE_FILE" >>vpl_wexecution
else
echo "xterm -e R -q" >>vpl_wexecution
fi
chmod +x vpl_wexecution

In reply to Juan Carlos Rodríguez-del-Pino

Re: Evaluating for a specific function()

by Garth Brady -

Greetings,

I'm looking to evaluate my students' submissions, to check whether or not they use a 'required' function in their solution.  Does anyone have any suggestions as to how I might go about this task?  For example, let's say I want them to use the rand() function, how could I check/evaluate their code to make sure it's being used?

In reply to Juan Carlos Rodríguez-del-Pino

Evaluating output to file using VPL

by Sachini Herath -
Dear Juan,


Thank you for the great module. I have been using it in the past few months to evaluate Python programming labs of students.

We need the students to read input from text file, process it and output to a text file. I setup the lab following the tutorial by Prof. Thiebaut [1].  The output is read and displayed when evaluating as expected. However when using the 'Run' option, the displayed output is also that from the output file, which makes it harder fro the students to check their program.

How can I change the execution scripts to read from the output file when evaluating the program, but to display std. out when using 'Run' option.

Thank you 

[1] http://cs.smith.edu/dftwiki/index.php/Tutorial_Moodle_VPL_Gremlins_--_Python

In reply to Sachini Herath

Re: Evaluating output to file using VPL

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Sachini,
you can customize the vpl_run.sh script to generate a different execution when you are running or when you are evaluating. To do this you must check if the file vpl_evaluation.sh exists if "yes" then the execution is for evaluate the student's program, else the execution is to run (in interactive mode) the student's program.
E.g

#!/bin/bash
echo "#!/bin/bash" > vpl_execution
if [ -f ./vpl_evaluate.sh ] ; then
      echo "python3.4 runGremlin.py" >> vpl_execution
else
      echo "python3.4 gremlin.py" >> vpl_execution
fi
chmod +x vpl_execution


Best regards,
Juan Carlos


In reply to Juan Carlos Rodríguez-del-Pino

Re: Evaluating output to file using VPL

by Sachini Herath -
Dear Juan,


Thank you very much this is exactly what I need!

Again, our work has been made very easy due to the VPL module and we highly appreciate your effort in developing and maintaining the module.

Best Wishes 

Sachini



In reply to Juan Carlos Rodríguez-del-Pino

File system issue with evaluation on Ubuntu server

by Philip Robinson -

Good day,

So I have been using the VPL plugin extensively in the style of Prof Thiebaut and I have run into a new problem. I periodically get this error message where evaluating:

/home/p13594/vpl_evaluate.sh: line 4: cannot create temp file for here-document: No space left on device

I am running Moodle and VPL on an Ubuntu server VM under VMWare. Running df -i and df -h do not show any partitions that are even close to full. Below is the vpl_evaluate.sh script I am using and Line 4 is where the vpl_execution script is first created.

#! /bin/bash
. common_script.sh

cat > vpl_execution < #! /bin/bash

octave -q customEval.m $MOODLE_USER_NAME 

EEOOFF

chmod +x vpl_execution

I suspect there is something I am not understanding about how VPL sets up its chroot jail and there is a directory somewhere I need to clear? 

Kind Regards,
Philip Robinson

In reply to Philip Robinson

Re: File system issue with evaluation on Ubuntu server

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Philip,
thanks for your bug report. This is the first time some body report this error. I also use execution servers at VMs under VMware and I never get this type of error. The problem here is that it seems dificult to replay to spot the problem. You don't need to clean any directory the execution server must do this work for you. I gess that this type of problem may happend if a student program generate a huge number of small files. The file system may be full for a while, until the job end and the execution server removes student's files. I need to do more checks to try to replicate this case.

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: File system issue with evaluation on Ubuntu server

by Philip Robinson -

Thanks for the response. I just wanted to confirm that there wasn't any folder that might be needed to clean in the long run with a lot of student use.

If that is not the case then it might well be something about the VM I have set up incorrectly or the VM needs some other maintenance. Thank you for the response.

Regards,

Philip

In reply to Philip Robinson

Re: File system issue with evaluation on Ubuntu server

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

I do not discard a bug in the execution server. I will introduce in the future stress tests to check the server behaviour in this situations.

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

External Load balancing

by Prakash Raju -

Hi Juan,

Instead of always having more than one Jail server and keeping their IP's added to the Moodle server, can I attach a load balancer's IP in the jail server and let the load balancer do load balancing?

This could lead to interesting applications like bringing in auto scaling jail servers instead of always having more than one jail servers. It could lead to reduced cloud cost if we are using cloud infrastructure


Thanks in advance,

Praveen Kumar


In reply to Prakash Raju

Re: External Load balancing

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hello Praveen,
I am not an expert in load balancing configuration but I think that with the network architecture of VPL it may be difficult to use a "execution server" load balancer.
Notice that the execution process takes different steps and require different network connections that need to be stablished with the same server in the cluster.
For example, the evaluation process takes this steps.
1) A user launches an evaluate process. e.g. the user clicks evaluate button.
2) The browser sends a request (AJAX/JSON) to the Moodle server.
3) The Moodle server select an execution server (with retries) and send the task to an execution server (HTTP/XMLRPC). The execution server generates different security tokens as response to de request. The task start.
4) The Moodle server respond to the Browser request with information with the "execution server URL" and the security tokens.
5) The browser connects with the execution server using the URL+security token and the "WebSocket" protocol to monitor the task.
6) When the task end, the monitor sends a request (AJAX/JSON) to the Moodle server to retrieve the task report/result.
8) The Moodle server request to the "execution server" the task result (HTTP/XMLRPC) with the security token, save it and return the result to the browser.
9) The browser shows the result.

In case of interactive execution, the steps 6-9 are replaced with another WebSocket connection to the input/output of the task running in the server showing results/getting keyboard input in the browser.
If you get running the load balance system, please let we know.
Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Pelin Öztürk -

Dear Juan Carlos Rodríguez-del-Pino,

I'd like to evaluate an assignment (java project) using VPL in Moodle. Source code of this project reads a text file as an input, then writes some text in a file as an output. It does not process input/output using console.

Under Settings -> VPL administration -> Advanced settings -> Execution files: I imported my input.txt file.

Under Settings -> VPL administration -> Advanced settings -> Files to keep when running: I selected these checkboxes, vpl_evaluate.cases, input.txt.

Under Settings -> VPL administration ->Test cases: I have this test case scenario.

case=1

input=

output=

For this configuration, when I evaluate my source code, it says 1 test run/ 0 tests failed. But i couldn't figure out what to write in output part. How can I check whether the produced output matches the output.txt file that I expect?

Thanks in advance.

Kind regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Canh Khong -



I always meet this problem when install virtual programming lab plugin. It displays validating but never redirect to anywhere. please anyone help me with this :'(


va

In reply to Canh Khong

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Canh,
this validating process, as I understand, is an internal Moodle process. If this process hang may be a problem not related with VPL. Please tell as your OS, Moodle and VPL version to try to reproduce your problem.
You can also try increasing your PHP memory limit. Other possibility is to deploy the plugin by hand. See
https://docs.moodle.org/31/en/Installing_plugins#Installing_manually_at_the_server

Best regards,
Juan Carlos

In reply to Canh Khong

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Canh,
this validating process, as I understand, is an internal Moodle process. If this process hang may be a problem not related with VPL. Please tell as your OS, Moodle and VPL version to try to reproduce your problem.
You can also try increasing your PHP memory limit. Other possibility is to deploy the plugin by hand. See
https://docs.moodle.org/31/en/Installing_plugins#Installing_manually_at_the_server

Best regards,
Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by John Ryan -

I've just installed VPL and the Jail server on a local Ubuntu server and I have got most things working.

However, when I try to add a VPL activity to a course I have to be logged in as the admin for the site to see the VPL option to appear in the list of activities to add.  If I am logged in as a teacher for a course then the VPL activity does not appear in the list of available activities.  How do I enable VPL so teachers can add and amend programming exercises?


John Ryan

In reply to John Ryan

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello John,
It seems to a capabilities configuration problem. Nobody has reported this type of problem before, may be that a custom configuration of the "capabilities" of the teacher's rol has lead to this problem. Of course, it can be also a problem in the VPL capabilities.
You can see the details of the VPL capabilities by rol at
https://github.com/jcrodriguez-dis/moodle-mod_vpl/blob/v3.2.4/db/access.php

Notice that you can override this setting by going to
Site administration>Users>Permissions
and
Site administration>Users>Permissions>Define roles

Best regards,
Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by John Ryan -

Hi Juan,

Thank you for your reply.

This is strange as this is a new installation of moodle 3.3 which I have set up specifically to test VPL so it only has the default options set.

When I look at the options for a teacher role it says "allow" for all the VPL options but when I look at the permissions set for my user id (with teacher Role) it says "No" for all the options.

Something must be overriding the settings but I have no idea what.

John

In reply to Juan Carlos Rodríguez-del-Pino

Code editor disappears when submission not present in VPL_data

by Prakash Raju -

Hi Juan,

An issue is bugging me for very long time in VPL. Whenever users saves the code, due to some reason or the other, the required file is not properly saved in vpl_data directory. I also cannot simulate the issue myself as it happens very randomly to only a few people.

Also, if the file is not stored in vpl_data, the code editor just fails to open when the user clicks on edit option and a blank screen appears with compilation options alone.

Version info:

Moodle 3.1

VPL 3.2.2

Also, my Moodle setup has autoscaling web servers accessing the common moodledata directory mounted via NFS with web servers. 

Kindly suggest any ways of solving this issue.

In reply to Prakash Raju

Re: Code editor disappears when submission not present in VPL_data

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Prakash,
thanks for your bug report. The problem that you describe may be due to different reasons. For example, if you update VPL you must clear the browser's cache, if not you may have odd behaivour until the browser read the updates files. We will take into account your report, but is dificult to say more if the bug can not be replayed.
Best regards,
Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: Code editor disappears when submission not present in VPL_data

by Prakash Raju -

Hi Juan,

Thanks for your response. We have never updated VPL and been sticking with this version for a long time now.

 I just want to share a few more details which might get us closer to the solution. 

Everytime the user data fails to store into vpl_data-->vpl_id-->userdata-->user_id-->submissionid, the submissionid directory is created as usual, but the submittedfiles.lst doesn't seem to contain the appropriate user_submitted_filename like the usual scenario. Instead, it's just empty 

Also, the entire issue becomes a huge problem particularly when we have drag and drop disabled as the user just gets stuck with the problem with no other option to solve it.

In reply to Prakash Raju

Re: Code editor disappears when submission not present in VPL_data

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

I don't have how a solution for this issue, but I will add tests to the save process in the next release of VPL.
Best regards,
Juan Carlos


In reply to Juan Carlos Rodríguez-del-Pino

shm_open with VPL

by Rajesh Kedia -
Dear Juan,

I am using VPL to invoke some commercial software package on the execution server. The package uses shm_open system call. The scripts run fine when invoked directly on the execution server, but when the same script is invoked via VPL on moodle, the following error is displayed:

shm_open: Function not implemented

Do you have any idea how can I go about fixing this? Is shm_open not allowed through jail server?


In reply to Rajesh Kedia

Re: shm_open with VPL

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Rajesh Kedia,
taken into account that shm_open's manual say
"The POSIX shared memory object implementation on Linux makes use of a dedicated tmpfs(5) filesystem, which is normally mounted under /dev/shm" and that VPL jail server does not replicate this especial file, I think that you need to add this especial file to the "/jail/dev" directory. Notice that you need to modify the script that start/stop the service.
Best regards,
Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: shm_open with VPL

by Rajesh Kedia -
Thanks Juan. It worked. I created a tmpfs mount point at /dev/shm.

 However, I messed up something with the vpl jail server installation and would like to delete the existing installation and re-install. But I couldn't find any script to perform the uninstallation/re-installation. Could you please help?

--rajesh
In reply to Rajesh Kedia

Re: shm_open with VPL

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

1) You can reexecute the instalation process. It will try to keep your current configuration.
2) You can remove the current configuration by removing the /etc/vpl directory and then you can reexecute the instalation process.
3) You can execute the uninstall script uninstall-sh, available at installation directory.

Best regards,
Juan Carlos


In reply to Juan Carlos Rodríguez-del-Pino

Re: shm_open with VPL

by Rajesh Kedia -

Thanks Juan. I used 2nd option of deleting /etc/vpl and it worked.


Thanks again.

In reply to Juan Carlos Rodríguez-del-Pino

Jar files on VPL 3.2

by Jeremy Yon -

Hi Juan,

I'm new to VPL and recently its been working great for me.

I have been trying to get jar files working on VPL 3.2. I created a HelloWorld jar file that prints hello world! when i execute the jar file. I have imported the jar file and created a script in vpl_run.sh to execute the file (as shown below)

vpl_run jar


I have almost made sure to tick the necessary boxes to keep the files.

keep files

However, I am getting an error when i run the script with error "Unable to access jarfile Hello.jar". I have tried everything but i cannot seem to get it to execute the jar file.


Any help or advice is very much appreciated!

In reply to Juan Carlos Rodríguez-del-Pino

State of VPL 3.3

by Aivar Annamaa -
Hi, Juan Carlos!

Our Moodle admin plans to upgrade our Moodle tomorrow (to version 3.1). What's your recommendation -- should he upgrade VPL to 3.2.4 or already to 3.3?

We don't use VPL until September, so we have some time to include 3.3 fixes if it turns out that  current state has problems.

What are the main differences between 3.2.4 and 3.3 ?


In reply to Aivar Annamaa

Re: State of VPL 3.3

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Aivar,
Notice that the 3.3 version at github is not usable, you must use the 3.3dev instead.
We have been using the 3.3dev on 2 courses the last two months with no problem.

The main differences between 3.2.4 and 3.3dev are the following:
- Fixes many errors in 3.2.4
- Improves compatibility with the latest Moodle version and Boost theme.
- Updates the Ace editor to the 1.2.6 version
- Uses Ace as the only syntax highlighter for all source code files.
- Adds the possibility of select the Ace theme at the plugin settings.
- Adds the buttons to download the last submissions or all the submissions. The buttons has been added to the "submission list"

There are other features not fully implemented, but these features do not interfere or affect the others.

Best regards,
Juan Carlos.


In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by manoj joseph -

sir


I have installed vpl jail server and service is starting

but i cannot get daemon working.Kinldy help and how do we give link  of execution server for public access

root@test:~# service vpl-jail-system status

● vpl-jail-system.service - LSB: VPL for Moodle jail service

   Loaded: loaded (/etc/init.d/vpl-jail-system; bad; vendor preset: enabled)

   Active: active (exited) since Wed 2017-07-05 15:06:24 IST; 54s ago

     Docs: man:systemd-sysv-generator(8)

  Process: 4926 ExecStop=/etc/init.d/vpl-jail-system stop (code=exited, status=0

  Process: 5298 ExecStart=/etc/init.d/vpl-jail-system start (code=exited, status


Jul 05 15:06:14 test systemd[1]: Starting LSB: VPL for Moodle jail service..

Jul 05 15:06:23 test vpl-jail-system[14725]: bind() secure port error

Jul 05 15:06:24 test vpl-jail-system[5298]:  * Daemon not started

Jul 05 15:06:24 test systemd[1]: Started LSB: VPL for Moodle jail service.

In reply to manoj joseph

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Manoj Joseph,
the message
Jul 05 15:06:23 test vpl-jail-system[14725]: bind() secure port error
is saying that it's very possible that you already has a daemon running on the https port [443]

use "sudo netstat -tap" to see which program is using the https port.

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by manoj joseph -

Sir 

my Xampp apache running on that port

In reply to manoj joseph

Re: New Virtual Programming Lab (VPL) module

by manoj joseph -
Thank you I have changed port 443 in xampp its started working 
In reply to manoj joseph

Re: New Virtual Programming Lab (VPL) module

by manoj joseph -
Hello


My VPl is jail server is working fine in local lan.I have configured web server and routed through virtual hosts and vpl jail server working on port8080.Kindly help me to configure vpl jail server publicly..

In reply to Juan Carlos Rodríguez-del-Pino

SQL autograding

by Daniel P. -
Dear Juan Carlos!

I am using your VPL plugin for a while with complete satisfaction, I am very grateful for that.

What I would like to do now is a SQL autograding. I looked at the demo site and I found a demo, that can grade an SQL select script (select * from table) against a single, predefined database.
 - Is it possible to make the autograding against many different databases one after the other?
 - How can I autograde modification instructions like INSERT, DELETE or UPDATE?

Thanks in advance,
Daniel


In reply to Daniel P.

Re: SQL autograding

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hello Daniel,

I think that with default evaluation program of VPL 3.2 it's not possible to resolve your needs. The future VPL 3.3 will adds new evaluation features that can help to resolve your problem.
VPL 3.3 is delayed but I think that it will be released in a few weeks.

Best regards,

Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

Similarity

by Regis Smith -
Hi!  I just installed the latest VPL on a new Moodle 3.2 install.  The "Similarity" feature doesn't seem to work at all.  I get a simple message "No Results".  It worked in older installs.  Can anyone get it to work using Moodle 3.2?


In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Andrei Băutu -
Picture of Plugin developers

Hello everyone,

I'm considering using VPL in a introductory course to programming. In each week, I have a few simple programming exercises for students (between 4-8 small problems). Right now, I'm using one assignment per week (students upload multiple files). I'm considering switching to VPL, but I'm wondering if there is a way to group multiple problem statements into a single VPL activity. Some reasons for doing this are:

-  to have the problems for each week grouped into a single "unit" so that they are not all showed in the course page;

- to have one grade per week (instead of having grades for each problem).

I believe I might be able to get this done via vpl_execution script, but I'm wondering if someone did this already. Or maybe you can suggest an alternative to have the VPL assignments for each week grouped into a single "unit" (something like pages in a book resource).

Thanks.

In reply to Andrei Băutu

Re: New Virtual Programming Lab (VPL) module

by Charlie Daly -

Hi Andrei,

I realise that you have probably already resolved this issue, but it is almost exactly what I faced when I used VPL for a programming module. I changed the course view (under course settings) so that there was one topic per page. Now, I might have 20 VPL  exercises per topic but now it is more manageable as students can see just one topic. Each topic is usually split into 4 sections: lecture, quiz, lab and resources. The lecture contains notes and possibly a video. The quiz uses an activequiz module to cover lecture topics. The lab is where I store the VPL exercises and resources are just for any external resources which might be interesting.

As for grades, I use Moodle grade categories and create a category for each week and all VPL exercises go into that category so that students can see the mark for each week.

Charlie

In reply to Charlie Daly

Re: New Virtual Programming Lab (VPL) module

by Andrei Băutu -
Picture of Plugin developers

Thank you, Charlie. I'll test that approach. 

For now, what I come up with is CodeRunner. It's a quiz question type, but I use it for lab classes, too. To do that, for each lab class I create a lab "quiz" which has 5-6 fixed CodeRunner questions (they are the assignment for that week). I disable question shuffling, enable regular page blocks, and allow students to test the solutions any number of times before submitting.

I can add descriptive texts between questions with guidelines for what's next, I can mix programming assignments with other type of questions, and I can display all questions in one page, or grouped questions by categories (eg. introductory, lab work, homework), or one question per page.

The disadvantage of CodeRunner is that it has less features and allows less customizations than VPL (it doesn't allow custom evaluation scripts, doesn't have similarity test, etc). This is also an advantage, as I found it easier to setup and work with. I also like it because I can then use same tool for exams (in which case I'll use random questions and shuffling).

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Valerio Minetti -

Hi, 

 i have some concerns about security regarding vpl-jail-server, in particular about the fact that it seems that it have to expose its rest services on a public address whitout any sort of authentication. 

it would be quite easy to circumvent "URLPATH" setting, just inspecting a valid session and then trying to send malcious code directly to jail-server.

This would force me to restrict its use to campus network in order to mitigate this problem.

TASK_ONLY_FROM could do the trick but from documentation i can't understand if tasks are submitted by students browsers directly to jail-server or instead by my  moodle server, and then results are sent to student browser. could you please clarify this point?


best regards





In reply to Valerio Minetti

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hello Valerio,
the security was a key issue in the design of the network architecture of VPL 3. The browser doesn’t send request of execution directly to the jail server. The jail server accepts execution requests, retrieve results, etc. only from allowed IPs in TASK_ONLY_FROM. The browser receives tickets to monitor and interact with the authorized execution.

You can set TASK_ONLY_FROM to the Moodle server IP.

Best regards, Juan Carlos.
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Valerio Minetti -

Thank you for your explanation,

this kind of interaction could be integrated in our security policy environment. One last question: is it possible to specify in your moodle plugin  a different port for jail server ( something in a form like "jail-server.example.com:3080" )?  we are testing it in a dockerized environment and on our cluster 80 and 443 tcp are already taken by other services.

In reply to Valerio Minetti

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

The list of jail servers must be a list of URLs. These URLs can use https and specify a port different than default.
Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Robert Harle -

Hi all,

Can VPL handle PNG files being submitted and sent to the execution server?  I have tried making one of the requested file e.g. "test.png", then uploading a PNG file. The editor recognises it as an image and displays it.  However, the submitted image does not seem to make it across to the execution server (at least, it's not in the jail home directory).:

total 24K

drwx------ 2 p19797 p19797 4.0K Oct  3 09:58 .

drwx--x--x 3 root   root   4.0K Oct  3 09:58 ..

-rwx------ 1 p19797 p19797 2.1K Oct  3 09:58 common_script.sh

-rwx------ 1 p19797 p19797  434 Oct  3 09:58 vpl_environment.sh

-rwxr-xr-x 1 p19797 p19797   21 Oct  3 09:58 vpl_execution

-rwx------ 1 p19797 p19797  273 Oct  3 09:58 .vpl_launcher.sh

-rw-r--r-- 1 p19797 p19797    0 Oct  3 09:58 .vpl_set_locale_error


For context, the exercise requires students to submit an image of their choosing and some code that processes that image. Thanks for any help!

In reply to Robert Harle

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Robert,
please, tell me the version of VPL and execution server you are using. can be replicated this behavior on the demo server?
Notice that if your are using a customized script you must execute the common_script.sh to decode binary files from base64.
Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Robert Harle -

Ah, thank you!  I wasn't using the common_script.sh. Adding that in appears to have pulled in the PNG.

In reply to Juan Carlos Rodríguez-del-Pino

No execution server available Not found http request URL path not found

by erika alarcon -
Picture of Testers

Hi Juan Carlos

Your plugin is awesome, we would like to be able to implement it in our institution.

 We have Moodle 3.1 and installed VPL (vpl-jail-system-2.2.2.tar.gz) in an Ubuntu server

In the vpl-jail-system.conf   file we have:

    PORT=80

    URLPATH=/campusvirtual



In Moodle I have tried the following URLs in VPL configuration:

http://vpl.uacj.mx:80/campusvirtual

http://vpl.uacj.mx/campusvirtual

http://148.210.21.218:80/campusvirtual

http://148.210.21.218/campusvirtual

 

I have been making the recommendations in this forum:

·         http://vpl.uacj.mx/OK    returns   OK

·         In the execution server console returns 200 OK:
wget http://vpl.uacj.mx/OK

·         The 80 port is open

 

But I still have the following error:

error


I really appreciate that you can help us

thanks

In reply to erika alarcon

Re: No execution server available Not found http request URL path not found

by erika alarcon -
Picture of Testers
I found the problem. I had not noticed that there are several vpl-jail-system.conf configuration files and the one I was configuring was not the jail server uses.

Regards!

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Gary Newport -

Hi

I have installed the Jail server, and have tested it vi the OK path; both HTTP and HTTPS reported OK back.

However, when I am in Moodle it reports:

http error Not foundhttp request URL path not found

 for the HTTP address, and...

request failed: SSL: certificate subject name '*' does not match target host name '[URL]'

for HTTPS.

I am assuming the latter is due to a certificate error but am happy to use the HTTP route instead.

I have checked that our URLPATH was set to \, though it had our URL (without HTTP:\\ in front) originally. I altered this back to the default with no success.

What could I be missing?

In reply to Gary Newport

Re: New Virtual Programming Lab (VPL) module

by Andrei Băutu -
Picture of Plugin developers

You should use // not \ as in http://jailserver/....

In reply to Andrei Băutu

Re: New Virtual Programming Lab (VPL) module

by Gary Newport -

Yes, sorry. That was a posting error rather than the error I had on the server. DOH!

In reply to Gary Newport

Re: New Virtual Programming Lab (VPL) module

by Andrei Băutu -
Picture of Plugin developers

Do you get any error message when using plain HTTP? What does it say?

In reply to Gary Newport

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hello Gildredge.
Please, check that the parameter URLPATH of the /etc/vpl/vpl-jail-system.conf configuration file in your jail server is the same your are using in the URL of your execution server at the VPL plugin setting on your Mooldle server.
http://EXECUTIONSERVER[PORT]/URLPATH

Best regards,
Juan Carlos
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Gary Newport -

I think I have this all correct.

Let me explain.

Firstly, our Moodle installation is at:

Our Jail server is not publically available, but resides within the same network as the Moodle installation. This server is located at:

Though, as I say, this URL is internally available; not external.

The port is the default (80) and http://ghmjs01.gildredgehouse.org.uk/OK responds with a page that says OK.

https://ghmjs01.gildredgehouse.org.uk/OK also works, though you have to accept the irregularities of the certificate before seeing the OK page.

etc/vpl/vpl-jail-system.conf URLPATH is set to / (URLPATH=/)

The plugin in Moodle has the following set within the Execution Server section:

When testing the execution servers I get:

  • http error Not foundhttp request URL path not found

Any ideas? smile

In reply to Gary Newport

Re: New Virtual Programming Lab (VPL) module

by Andrei Băutu -
Picture of Plugin developers

When you ssh to your Moodle server, does "curl http://ghmjs01.gildredgehouse.org.uk/OK" work? 

If not, you can try to set FIREWALL=0 (instead of the default 2) in vpl-jail-system.conf

In reply to Andrei Băutu

Re: New Virtual Programming Lab (VPL) module

by Gary Newport -

I ran the curl command and got this;
<!DOCTYPE html><html><body>OK</body></html><script>setTimeout(function(){window.          close();},2000);</script>


...which I believe is correct.

I can set the firewall to 0 anyway (since there is no need; they are both behind our corporate firewall anyway), but it appears the two servers can see each other?

In reply to Gary Newport

Re: New Virtual Programming Lab (VPL) module

by Andrei Băutu -
Picture of Plugin developers

Did you get it working? If not, try to create an VPL activity, then go to it's Advanced settings menu, then click Check execution servers. What info are you seeing?

In reply to Andrei Băutu

Re: New Virtual Programming Lab (VPL) module

by Gary Newport -

No, unfortunately.

As stated in my last reply, I got the OK message through SSH to the Jail Server, and I believe I have the URLPATH correctly set but still getting the error message inside Moodle when I test the execution server. Namely, the server cannot be found.

Have had to stop for the moment, due to time constraints but would be very eager to get this resolved asap.

To recap:

Our Moodle installation is at:

Our Jail server is not publically available, but resides within the same network as the Moodle installation. This server is located at:

Though, as I say, this URL is internally available; not external.

The port is the default (80) and http://ghmjs01.gildredgehouse.org.uk/OK responds with a page that says OK.

https://ghmjs01.gildredgehouse.org.uk/OK also works, though you have to accept the irregularities of the certificate before seeing the OK page.

etc/vpl/vpl-jail-system.conf URLPATH is set to / (URLPATH=/)

The plugin in Moodle has the following set within the Execution Server section:

When testing the execution servers I get:

  • http error Not foundhttp request URL path not found


When  I I ran the curl command I got this;
<!DOCTYPE html><html><body>OK</body></html><script>setTimeout(function(){window.          close();},2000);</script>

I believe this shows it is working, but still getting the error within Moodle.

In reply to Gary Newport

Re: New Virtual Programming Lab (VPL) module

by Andrei Băutu -
Picture of Plugin developers
I browsed inside VPL jain and module code and I found out this:

- "http error" text is coming from the VPL module when it gets and error from the jail server

- "Not foundhttp request URL path not found" is the error message comming from VPL Jail server

So according to this, your Moodle can indeed communicate with the Jail server. However, the request it send to the jail server doesn't match the expected URL path.

In your /etc/vpl/vpl-jail-system.conf, set LOGLEVEL=7 (last line) and restart jail server. After that run tail -f /var/log/syslog to monitor log entries. While this command is running, try your vpl activity. You should see entries from the log, including the actual URL sent by Moodle.

Andrei

In reply to Gary Newport

Re: New Virtual Programming Lab (VPL) module

by Andrei Băutu -
Picture of Plugin developers
I browsed inside VPL jain and module code and I found out this:

- "http error" text is coming from the VPL module when it gets and error from the jail server

- "Not foundhttp request URL path not found" is the error message comming from VPL Jail server

So according to this, your Moodle can indeed communicate with the Jail server. However, the request it send to the jail server doesn't match the expected URL path.

In your /etc/vpl/vpl-jail-system.conf, set LOGLEVEL=7 (last line) and restart jail server. After that run tail -f /var/log/syslog to monitor log entries. While this command is running, try your vpl activity. You should see entries from the log, including the actual URL sent by Moodle.

Andrei

In reply to Andrei Băutu

Re: New Virtual Programming Lab (VPL) module

by Gary Newport -

Thank you, Andrei, for assisting so much; I feel as if we are near concluding this issue.

I did as you stated and got this:

  1. Nov 24 10:45:26 ghmjs01 systemd[1]: Stopped LSB: VPL for Moodle jail service.
  2. Nov 24 10:46:07 ghmjs01 systemd[1]: Starting LSB: VPL for Moodle jail service...
  3. Nov 24 10:46:19 ghmjs01 vpl-jail-server: correctFile 1 'jail' 0:0
  4. Nov 24 10:46:19 ghmjs01 vpl-jail-server: correctFile 1 'var' 0:0
  5. Nov 24 10:46:19 ghmjs01 vpl-jail-server: correctFile 1 'vpl-jail-system' 0:0
  6. Nov 24 10:46:19 ghmjs01 vpl-jail-system[20395]: Set log mask up to 7
  7. Nov 24 10:46:19 ghmjs01 vpl-jail-system[20395]: Listen at 0.0.0.0:80
  8. Nov 24 10:46:19 ghmjs01 vpl-jail-system[20395]: Listen secure port at 0.0.0.0:44                                               3
  9. Nov 24 10:46:20 ghmjs01 vpl-jail-system[14230]:  * Starting vpl-jail-system serv                                               ice:
  10. Nov 24 10:46:20 ghmjs01 systemd[1]: Started LSB: VPL for Moodle jail service.
  11. Nov 24 10:48:17 ghmjs01 vpl-jail-system[20406]: Client: 10.112.11.34
  12. Nov 24 10:48:17 ghmjs01 vpl-jail-system[20406]: Start server version 2.2.2
  13. Nov 24 10:48:17 ghmjs01 vpl-jail-system[20406]: Receiving until 8192 bytes
  14. Nov 24 10:48:17 ghmjs01 vpl-jail-system[20406]: poll return: 1
  15. Nov 24 10:48:17 ghmjs01 vpl-jail-system[20406]: Received header 151
  16. Nov 24 10:48:17 ghmjs01 vpl-jail-system[20406]: processHeaders: POST / HTTP/1.1#                                               015#012Host: ghmjs01.gildredgehouse.org.uk#015#012Accept: */*#015#012Content-typ                                               e: text/xml;charset=UTF-8#015#012User-Agent: VPL 3.2.4#015#012Content-Length: 29                                               0
  17. Nov 24 10:48:17 ghmjs01 vpl-jail-system[20406]: Request line :"POST / HTTP/1.1"
  18. Nov 24 10:48:17 ghmjs01 vpl-jail-system[20406]: method :"POST"
  19. Nov 24 10:48:17 ghmjs01 vpl-jail-system[20406]: URL :"/"
  20. Nov 24 10:48:17 ghmjs01 vpl-jail-system[20406]: version :"HTTP/1.1"
  21. Nov 24 10:48:17 ghmjs01 vpl-jail-system[20406]: Header :"Host: ghmjs01.gildredge                                               house.org.uk"
  22. Nov 24 10:48:17 ghmjs01 vpl-jail-system[20406]: Header :"Accept: */*"
  23. Nov 24 10:48:17 ghmjs01 vpl-jail-system[20406]: Header :"Content-type: text/xml;                                               charset=UTF-8"
  24. Nov 24 10:48:17 ghmjs01 vpl-jail-system[20406]: Header :"User-Agent: VPL 3.2.4"
  25. Nov 24 10:48:17 ghmjs01 vpl-jail-system[20406]: Header :"Content-Length: 290"
  26. Nov 24 10:48:17 ghmjs01 vpl-jail-system[20406]: http(s) request
  27. Nov 24 10:48:17 ghmjs01 vpl-jail-system[20406]: Receiving until 290 bytes
  28. Nov 24 10:48:17 ghmjs01 vpl-jail-system[20406]: Execute request 'available'
  29. Nov 24 10:48:17 ghmjs01 vpl-jail-system[20406]: Memory requested 10240
  30. Nov 24 10:48:17 ghmjs01 vpl-jail-system[20406]: Status: 'ready'
  31. Nov 24 10:48:17 ghmjs01 vpl-jail-system[20406]: Response Content-Length: 640
  32. Nov 24 10:48:17 ghmjs01 vpl-jail-system[20406]: Sending 769 to fd 6
  33. Nov 24 10:48:17 ghmjs01 vpl-jail-system[20406]: Send 769

Obviously, I added the numbered bullet points, to aid us in communicating.

I believe that line 19 shows that the system is indeed sending /.  Line 22 appears to be stating that it is looking for */* but is this Regex? Or am I missing something else?

In reply to Gary Newport

Re: New Virtual Programming Lab (VPL) module

by Andrei Băutu -
Picture of Plugin developers

Indeed, this looks normal, using the / path and in fact matches what I get on my server. The */* text is a HTTP header (it means the VPL client will accept any kind of response content from the server).

Based on the log, you accessed the "Check execution servers" tool under Advanced settings. Did you get an error in this case? The server reports being "ready". If you didn't get the "ready" status in Moodle, then it would be weird since the server looks find. If you did get the ready status, then you should try testing the VPL activity (add one test case, go to Test activity tab, fill in a test program and run evaluate on it).

If you want, feel free to send me a private message so that we don't spam the list while we try to figure this out.

Cheers,
Andrei

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Franklin Stennett -

How would one go and add Python 3.6 to VPL?

In reply to Juan Carlos Rodríguez-del-Pino

Name of student who submitted an assignment

by Osvaldo Carvalho -

Hola, Juan,

When I download all submissions to a VPL task, then come organized in one directory per user. Which algorithm is used to derive the directory name from the student name? Is there a way to access the student complete name, as stored on Moodle server?

Thanks a lot,

Osvaldo

In reply to Osvaldo Carvalho

Re: Name of student who submitted an assignment

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hola Osvaldo,
the algorithm used to generate the folder name is taken the first char of every word in the user name. But this algorithm will change in 3.3. In V3.3 the folder names will be the username plus the user id.

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: Name of student who submitted an assignment

by Osvaldo Carvalho -

Gracias, Juan.

Yes, but in case of collisions, e.g., "Juan Carlos", "Jose Cortez" , what do you do?

And, most important for me, how can I access the user name or user Id in a script?

Best regards,

Osvaldo

In reply to Osvaldo Carvalho

Re: Name of student who submitted an assignment

by Andrei Băutu -
Picture of Plugin developers

In case of collisions, it would just add 1, 2, 3 ... to the normal text (eg. JC, JC1, JC2). You can't find out which user they come from.

If you want the real user name, edit the mod/vpl/views/downloadallsubmissions.php file, in function vpl_selzipdirname, and change this (around line 44):

$ret = '';

with 

$ret = $name . ' ';

In reply to Andrei Băutu

Re: Name of student who submitted an assignment

by Osvaldo Carvalho -

Thank you very much, Andrei. That's what I was looking for.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

VPL 3.3 has been released, enjoy it.

https://moodle.org/plugins/mod_vpl

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Marin Aglić -

We are using a third-party moodle, so I am not sure which version of VPL it has installed, but I have a question regarding when students run a Python3 program.

When a Python3 program is run via VPL, input and print statements behave differently than on the desktop version.

For instance, 

the line: print(1, 2, 3) would print: 1, 2, 3 on desktop, but prints (1, 2, 3) on VPL.

Also, when entering something via console, it isn't treated as a String by default. 

How can I change these behaviours?


Thank you.

In reply to Marin Aglić

Re: New Virtual Programming Lab (VPL) module

by Marin Aglić -

Is it possible to achieve what I am asking by using a custom vpl_run.sh?

In reply to Marin Aglić

Re: New Virtual Programming Lab (VPL) module

by Marin Aglić -

Ok, I figured it out... I needed to add the following lines to vpl_run.sh

. common_script.sh

check_program python

cat common_script.sh > vpl_execution

echo "python3 $VPL_SUBFILE0" >>vpl_execution

chmod +x vpl_execution

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Garth Brady -

So excited to try it out!  This plugin is used widely in our Computer Science Department here in Ontario!

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Garth Brady -

Wow!  What a fabulous feature upgrade list and moving to ACE is perfect!

Feature recommendation:  

Allow users to select their own Editor theme as opposed to forcing a theme as Admin.  I think an Editor theme is a highly personalized decision and I know my students all have differing themes when working in Github's Atom smile


In reply to Garth Brady

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hello Garth,
we are planning to add settings at course level, allowing to change locally many of the plugin settings. I add "allow that users set the theme of the editor" to the TODO list.

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Vikram Jain -

hi Juan,

Is it possible to work with :

1)  SWIFT language

2 ) Android

3) KOTLIN 

using your Plugin

In reply to Vikram Jain

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Vikram Jain,
Notice that VPL is highly configurable allowing you to write your own scripts for many programming languages that run on Linux.  In any case the execution server must provide the compiler/interpreter and libraries needed to run these programs.
At this moment with VPL 3.3 and Execution Server 2.2.2 on Ubuntu you can:
1)    SWIFT language. The editor can do the syntactic highlighting of the code. To run basic Swift programs, you must install the compiler https://swift.org/download/ and write the script vpl_run.sh to compile and prepare the run of the program
2)    Android. I guess that you are referring to java, I suppose (I really don’t know) that in this case you need to install the compiler, libraries and an emulator for android that allow to run multiple instances simultaneously.
3)    KOTLIN. the next release of VPL will do the syntactic highlighting of the code. You must install the compiler and write the script vpl_run.sh to compile and prepare the run of the program for the chosen target platform.

Summarized: VPL, out of the box, can do very few with these programming languages . If you manage to resolve this issues, please share your code and experience.

Best regards,
Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Vikram Jain -

hi Juan,


While running a simple "hello World" script in R, I encounter the connection closed error. see attached image.

Any clues ?


Below my r_run.sh ...

########################

# load common script and check programs

. common_script.sh

check_program Rscript

if [ "$1" == "version" ] ; then

echo "#!/bin/bash" > vpl_execution

echo "R --version | head -n3" >> vpl_execution

chmod +x vpl_execution

exit

fi

get_source_files r R

#Select first file

for FILENAME in $SOURCE_FILES

do

SOURCE_FILE=$FILENAME

break

done

#compile

cat common_script.sh > vpl_wexecution

cat  $SOURCE_FILE >> .Rprofile

if [ "$1" == "batch" ] ; then

echo "xterm -e R --vanilla -f $SOURCE_FILE" >>vpl_wexecution

else

echo "xterm -e R -q" >>vpl_wexecution

fi

chmod +x vpl_wexecution

########################################3

Best Regards,

Vikram

Attachment conn_closed.JPG
In reply to Vikram Jain

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Vikram,
sorry for the long long delay, it seems that I lost some e-mail from Moodle.
Really I don't why when you run R code your program exit with no message. I run your code on demo site of VPL and it shows the message.
But I see two VPL problems:
1) A know problem is that sometimes the VNCclient don't show the window if you don't click on blue background.
2) The demo site of VPL shows a very slow R start up. This problem can be improved using vncaccel to reduce the start time of the GUI programs (see release of execution server 2.2.2)
Due to your post I have added “R” (uppercase) extension to the editor and language auto-detector to the next VPL release.

Best regards,
Juan Carlos.

Attachment Captura.jpg
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Vikram Jain -

hi Juan,


On running a simple swift code, the execution server is not able to locate swift (though it is correctly installed). I guess the problem is : Execution server cannot locate the installation path of swift compiler files. see attached image.

Any clues ?

I have tried to set both ENVPATH and PATH in /etc/vpl/vpl-jail-system.conf file and stop/start service but no success.

If I locally copy the swift compiler to "/usr/bin", the problem is partially resolved but further dependencies cannot be resolved.

Note - My execution OS is Ubuntu 16.04


Best Regards,

Vikram

Attachment swift_path_error.JPG
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Meindert Jorna -

Hi there,

Very interested plugin. Expect to use it in the classroom for the PHP classes in order to have students test some basic PHP scripts. Problem is my school does not have any Moodle server and does not use Moodle so I developed my own course environment in Moodle and using a shared server which does not allow me sudo root access. So I am not able to install the jail server. Is there any workaround? What would be the simplest solution in this case. Are there any public jail servers which can be used? Or is there an other solution? Thanks, hope to hear from you. Kind regards.

In reply to Meindert Jorna

Re: New Virtual Programming Lab (VPL) module

by Frank Neumann -

Hi there,

in several of my programming classes I use C#. Although I gathered the impression from your demo site (http://demovpl.dis.ulpgc.es/moodle/) that VPL supports C#, I could not find a word about it in the VPL documentation.

Could you please refer me to any piece of appropriate documentaion on this topic or describe what we will have to do, in order to use activities in C#?

Thanks + regards,

Frank

In reply to Frank Neumann

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hello Frank,
sorry for the lack of information. I need time to write a detailed description of every programming language supported out of the box.

VPL 3.3.1 support C# by using Mono on Linux. To use C#, write code in files with ".cs" extension.

You also can check all available programming languages in your VPL+jail-server combination using this hack as teacher:
1. Create a test activity
2. go to "test activity" -> "edit"
3. Create a file named a.all
4. Push button "run" and you will get a "hello world" from the programming languages available.
5. Push button "debug" and you will get a GUI "hello world" from the programming languages available.
6. Push button "evaluate" and you will get the version of the compiler/interpreter used.

If you are using more than one jail-servers, notice that he information is from the jail-server assigned. If you want information about a selected jail-server, you must choice the jail-server used with the "Local execution servers" option.

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Frank Neumann -

Hello Juan Carlos,


many thanks for your hints - it worked out perfectly: And C# is supported on our installation.


Best regards,


Frank

In reply to Frank Neumann

Re: New Virtual Programming Lab (VPL) module

by Frank Neumann -

Hi there,

in addition to using C# via Mono, I would like to employ NUnit as unit test environment for grading an assignment.

I found a very compelling example for Java and JUnit:

https://github.com/jimburton/vpl-unit-test


Does anybody have an example for NUnit available?


Best regards,

Frank

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Garth Brady -
I am confused.  Our jailserver reports (via a.all) "Hello from the C SHARP language, but when I try to Evaluate .cs files, I get the error message:

The execution server needs to install "gmcs" to run this type of program

Here is the vpl_run.sh:

#!/bin/bash
# $Id: csharp_run.sh,v 1.4 2012-09-24 15:13:21 juanca Exp $
# Default C# language run script for VPL
# Copyright (C) 2014 Juan Carlos Rodríguez-del-Pino
# License http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
# Author Juan Carlos Rodríguez-del-Pino 

#load common script and check programs
. common_script.sh
check_program gmcs
check_program mono
get_source_files cs
#compile
export MONO_ENV_OPTIONS=--gc=sgen
export MONO_GC_PARAMS=max-heap-size=64m
gmcs -pkg:dotnet -out:output.exe $SOURCE_FILES
if [ -f output.exe ] ; then
	cat common_script.sh > vpl_execution
	echo "export MONO_ENV_OPTIONS=--gc=sgen" >> vpl_execution
	echo "export MONO_GC_PARAMS=max-heap-size=64m" >> vpl_execution
	echo "mono output.exe" >> vpl_execution
	chmod +x vpl_execution
	for FILENAME in $SOURCE_FILES
	do
		grep -E "System\.Windows\.Forms" $FILENAME 2>&1 >/dev/null
		if [ "$?" -eq "0" ]	; then
			mv vpl_execution vpl_wexecution
			break
		fi
	done
fi
Can someone please explain why this might be?
In reply to Garth Brady

Re: New Virtual Programming Lab (VPL) module

by Garth Brady -

I have resolved my own problem and am reporting a bug in the default vpl_run.sh.

Both references to gmcs need to be changed (gmcs was deprecated according to Monodevlop here) to simply mcs (very minor issue).

Here is functioning code that processes c# correctly:


#!/bin/bash
# $Id: csharp_run.sh,v 1.4 2012-09-24 15:13:21 juanca Exp $
# Default C# language run script for VPL
# Copyright (C) 2014 Juan Carlos Rodríguez-del-Pino
# License http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
# Author Juan Carlos Rodríguez-del-Pino 

#load common script and check programs
. common_script.sh
check_program mcs
check_program mono
get_source_files cs
#compile
export MONO_ENV_OPTIONS=--gc=sgen
export MONO_GC_PARAMS=max-heap-size=64m
mcs -pkg:dotnet -out:output.exe $SOURCE_FILES
if [ -f output.exe ] ; then
	cat common_script.sh > vpl_execution
	echo "export MONO_ENV_OPTIONS=--gc=sgen" >> vpl_execution
	echo "export MONO_GC_PARAMS=max-heap-size=64m" >> vpl_execution
	echo "mono output.exe" >> vpl_execution
	chmod +x vpl_execution
	for FILENAME in $SOURCE_FILES
	do
		grep -E "System\.Windows\.Forms" $FILENAME 2>&1 >/dev/null
		if [ "$?" -eq "0" ]	; then
			mv vpl_execution vpl_wexecution
			break
		fi
	done
fi
In reply to Meindert Jorna

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Meindert,

sorry I don't know if exist a public jail server. I don't recommen to use the demojail server because can be stopped, restarted or updated without previous warning.
I hope some other people can give you a solution.

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Marin Aglić -

Any reason as to why evaluation would return proposed grade 10/100 even if all test cases are passed? 

In reply to Marin Aglić

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Sorry Marin, for the inconveniences.

The bug that generate this problem was introduced in V3.3. The problem was resolved in v3.3.2, please, update your VPL to v3.3.2.

Best regards,
Juan Carlos.


In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Amir Ben-amram -

Dear Juan Carlos: 

I am enthusiastic about the idea of VPL and appreciate the work you did on it.  I have already made a basic use of it, but as I wish to make better use, I have a few questions (I beg your pardon if they are already answered, as this discussion thread is very long).

1) Would there be a way to enter teacher's comments & grades other than writing in the same boxes where the automatic evaluation comments & grades are shown?  I would like to keep them separate.

2) There is a technical problem with the comments & grades page (what I reach when I click on the grade in the submission list: the url is .../mod/vpl/forms/gradesubmission.php?id=...&userid=...&inpopup=1).  The page shows a textbox which keeps expanding until it moves entirely out of the screen area.  This happens both on Chrome and IE.

3) I would appreciate an option to download all submissions, in the same way it's done with an ordinary assignment activity.

4) Is it possible to install auxiliary programs on jail server, that my run/evaluate scripts can invoke?

Thanks in advance, Amir

In reply to Amir Ben-amram

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Amir,
Yes, I know that the forum thread is long. I will open a new one with the next VPL release.

Q1) Would there be a way to enter teacher's comments & grades other than writing in the same boxes where the automatic evaluation comments & grades are shown?  I would like to keep them separate.
A1) No. At this moment the only place to write evaluation comments is with the automatic evaluation.

Q2) There is a technical problem with the comments & grades page (what I reach when I click on the grade in the submission list: the url is .../mod/vpl/forms/gradesubmission.php?id=...&userid=...&inpopup=1).  The page shows a textbox which keeps expanding until it moves entirely out of the screen area.  This happens both on Chrome and IE.
A2) I need details of your installation (versions of software) and configuration (language used etc.) to replay the situation and resolve the problem.

Q3) I would appreciate an option to download all submissions, in the same way it's done with an ordinary assignment activity.
A3) Lasts versions of VPL give you this feature. Better the last version. Go to the "submission list" and select the appropriate link/button.

Q4) Is it possible to install auxiliary programs on jail server, that my run/evaluate scripts can invoke?
A4) Yes, you can install auxiliary programs into the jail servers and use it in the evaluation process. You must customize the evaluation by modifying the vpl_evaluation.sh to use these tools.
see details at the "Advanced settings =>Execution files" help.

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Amir Ben-amram -

Dear Juan Carlos,

Thank you for your prompt answers.

Re (A1) - may I then add a 'feature request'?

Re (A2) - Moodle 3.3+ (Build: 20170629), Hebrew/English installation, and I'm using Chrome Version 64.0.3282.167 (32-bit). Does this help?

Re (A3) - the "download all submissions" option appears, strangely enough, only after I click "Similarity".  Perhaps this is version-dependent, then ignore it.

Re (A4) - does it mean that all auxiliary programs have to be included via the "execution files" interface?  I have read in an earlier post that this only allows for printable files, so one should use uuencode or something like that in order to install program.  Installing complex programs with several files seems difficult that way.

Regards,

Amir


In reply to Amir Ben-amram

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Amir,

A1) I take note of your requested feature.

A2) Notice that if I don't replay the environment I may don't spot the problem.

I also take a note to test VPL with rtl languages. Please let me know of possible errors with this type of languages.

A3) Your information about where is the "download all submissions" link tell me that you are not using the last VPL version.

A4) No "execution files" may be useful if you don't have access to the jail server. Notice that new versions of VPL support binary files out of the box.

For installing complex tools, like new programming languages the correct way is to install it directly into the jail server. But any way you need to add/modify the script (vpl_run.sh, vpl_debug.sh and vpl_evaluate.sh) that launch this tools to run its.

 

Best regards,

Juan Carlos.


In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Nijesh W -

Hi Juan,

I have built an application using vpl and its running successfully, developed in laravel 5.4.

Now i'm switching to nodejs, run works well, while evaluating i'm getting error . Can you please help me.

"vpl_evaluate.cpp:354:12: warning: multi-character character constant [-Wmultichar]↵vpl_evaluate.cpp:356:14: warning: multi-character character constant [-Wmultichar]↵vpl_evaluate.cpp:365:13: warning: multi-character character constant [-Wmultichar]↵vpl_evaluate.cpp:375:18: warning: multi-character character constant [-Wmultichar]↵vpl_evaluate.cpp:386:27: warning: multi-character character constant [-Wmultichar]↵vpl_evaluate.cpp:1058:9: warning: multi-character character constant [-Wmultichar]↵vpl_evaluate.cpp:1164:6: error: stray ‘\’ in program↵vpl_evaluate.cpp:1164:6: error: stray ‘\’ in program↵vpl_evaluate.cpp:1228:41: warning: multi-character character constant [-Wmultichar]↵vpl_evaluate.cpp:1327:22: warning: multi-character character constant [-Wmultichar]↵vpl_evaluate.cpp:1335:23: warning: multi-character character constant [-Wmultichar]↵vpl_evaluate.cpp: In static member function ‘static std::string Tools::caseFormat(std::string)’:↵vpl_evaluate.cpp:386:27: error: no match for ‘operator+’ in ‘std::operator+(const _CharT*, const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]((*(const std::basic_string<char>*)lines.std::vector<_Tp, _Alloc>::operator[] [with _Tp = std::basic_string<char>, _Alloc = std::allocator<std::basic_string<char> >, std::vector<_Tp, _Alloc>::reference = std::basic_string<char>&, std::vector<_Tp, _Alloc>::size_type = long unsigned int](((long unsigned int)i)))) + 23662’↵vpl_evaluate.cpp:386:27: note: candidates are:↵/usr/include/c++/4.6/bits/stl_iterator.h:327:5: note: template<class _Iterator> std::reverse_iterator<_Iterator> std::operator+(typename std::reverse_iterator<_Iterator>::difference_type, const std::reverse_iterator<_Iterator>&)↵/usr/include/c++/4.6/bits/basic_string.h:2306:5: note: template<class _CharT, class _Traits, class _Alloc> std::basic_string<_CharT, _Traits, _Alloc> std::operator+(const std::basic_string<_CharT, _Traits, _Alloc>&, const std::basic_string<_CharT, _Traits, _Alloc>&)↵/usr/include/c++/4.6/bits/basic_string.tcc:694:5: note: template<class _CharT, class _Traits, class _Alloc> std::basic_string<_CharT, _Traits, _Alloc> std::operator+(const _CharT*, const std::basic_string<_CharT, _Traits, _Alloc>&)↵/usr/include/c++/4.6/bits/basic_string.tcc:710:5: note: template<class _CharT, class _Traits, class _Alloc> std::basic_string<_CharT, _Traits, _Alloc> std::operator+(_CharT, const std::basic_string<_CharT, _Traits, _Alloc>&)↵/usr/include/c++/4.6/bits/basic_string.h:2343:5: note: template<class _CharT, class _Traits, class _Alloc> std::basic_string<_CharT, _Traits, _Alloc> std::operator+(const std::basic_string<_CharT, _Traits, _Alloc>&, const _CharT*)↵/usr/include/c++/4.6/bits/basic_string.h:2359:5: note: template<class _CharT, class _Traits, class _Alloc> std::basic_string<_CharT, _Traits, _Alloc> std::operator+(const std::basic_string<_CharT, _Traits, _Alloc>&, _CharT)↵/usr/include/c++/4.6/bits/stl_bvector.h:266:3: note: std::_Bit_iterator std::operator+(std::ptrdiff_t, const std::_Bit_iterator&)↵/usr/include/c++/4.6/bits/stl_bvector.h:266:3: note: no known conversion for argument 1 from ‘std::basic_string<char>’ to ‘std::ptrdiff_t {aka long int}’↵/usr/include/c++/4.6/bits/stl_bvector.h:352:3: note: std::_Bit_const_iterator std::operator+(std::ptrdiff_t, const std::_Bit_const_iterator&)↵/usr/include/c++/4.6/bits/stl_bvector.h:352:3: note: no known conversion for argument 1 from ‘std::basic_string<char>’ to ‘std::ptrdiff_t {aka long int}’↵/usr/include/c++/4.6/bits/stl_iterator.h:896:5: note: template<class _Iterator, class _Container> __gnu_cxx::__normal_iterator<_Iterator, _Container> __gnu_cxx::operator+(typename __gnu_cxx::__normal_iterator<_Iterator, _Container>::difference_type, const __gnu_cxx::__normal_iterator<_Iterator, _Container>&)↵vpl_evaluate.cpp: In member function ‘std::string TestCase::getCommentTitle(bool)’:↵vpl_evaluate.cpp:1058:9: warning: overflow in implicit constant conversion [-Woverflow]↵vpl_evaluate.cpp: In member function ‘void TestCase::runTest(time_t)’:↵vpl_evaluate.cpp:1164:37: error: ‘s’ was not declared in this scope↵vpl_evaluate.cpp: In member function ‘void Evaluation::loadTestCases(std::string)’:↵vpl_evaluate.cpp:1327:22: error: no match for ‘operator+’ in ‘value + 23662’↵vpl_evaluate.cpp:1327:22: note: candidates are:↵/usr/include/c++/4.6/bits/stl_iterator.h:327:5: note: template<class _Iterator> std::reverse_iterator<_Iterator> std::operator+(typename std::reverse_iterator<_Iterator>::difference_type, const std::reverse_iterator<_Iterator>&)↵/usr/include/c++/4.6/bits/basic_string.h:2306:5: note: template<class _CharT, class _Traits, class _Alloc> std::basic_string<_CharT, _Traits, _Alloc> std::operator+(const std::basic_string<_CharT, _Traits, _Alloc>&, const std::basic_string<_CharT, _Traits, _Alloc>&)↵/usr/include/c++/4.6/bits/basic_string.tcc:694:5: note: template<class _CharT, class _Traits, class _Alloc> std::basic_string<_CharT, _Traits, _Alloc> std::operator+(const _CharT*, const std::basic_string<_CharT, _Traits, _Alloc>&)↵/usr/include/c++/4.6/bits/basic_string.tcc:710:5: note: template<class _CharT, class _Traits, class _Alloc> std::basic_string<_CharT, _Traits, _Alloc> std::operator+(_CharT, const std::basic_string<_CharT, _Traits, _Alloc>&)↵/usr/include/c++/4.6/bits/basic_string.h:2343:5: note: template<class _CharT, class _Traits, class _Alloc> std::basic_string<_CharT, _Traits, _Alloc> std::operator+(const std::basic_string<_CharT, _Traits, _Alloc>&, const _CharT*)↵/usr/include/c++/4.6/bits/basic_string.h:2359:5: note: template<class _CharT, class _Traits, class _Alloc> std::basic_string<_CharT, _Traits, _Alloc> std::operator+(const std::basic_string<_CharT, _Traits, _Alloc>&, _CharT)↵/usr/include/c++/4.6/bits/stl_bvector.h:266:3: note: std::_Bit_iterator std::operator+(std::ptrdiff_t, const std::_Bit_iterator&)↵/usr/include/c++/4.6/bits/stl_bvector.h:266:3: note: no known conversion for argument 1 from ‘std::string {aka std::basic_string<char>}’ to ‘std::ptrdiff_t {aka long int}’↵/usr/include/c++/4.6/bits/stl_bvector.h:352:3: note: std::_Bit_const_iterator std::operator+(std::ptrdiff_t, const std::_Bit_const_iterator&)↵/usr/include/c++/4.6/bits/stl_bvector.h:352:3: note: no known conversion for argument 1 from ‘std::string {aka std::basic_string<char>}’ to ‘std::ptrdiff_t {aka long int}’↵/usr/include/c++/4.6/bits/stl_iterator.h:896:5: note: template<class _Iterator, class _Container> __gnu_cxx::__normal_iterator<_Iterator, _Container> __gnu_cxx::operator+(typename __gnu_cxx::__normal_iterator<_Iterator, _Container>::difference_type, const __gnu_cxx::__normal_iterator<_Iterator, _Container>&)↵vpl_evaluate.cpp:1335:23: error: no match for ‘operator+’ in ‘value + 23662’↵vpl_evaluate.cpp:1335:23: note: candidates are:↵/usr/include/c++/4.6/bits/stl_iterator.h:327:5: note: template<class _Iterator> std::reverse_iterator<_Iterator> std::operator+(typename std::reverse_iterator<_Iterator>::difference_type, const std::reverse_iterator<_Iterator>&)↵/usr/include/c++/4.6/bits/basic_string.h:2306:5: note: template<class _CharT, class _Traits, class _Alloc> std::basic_string<_CharT, _Traits, _Alloc> std::operator+(const std::basic_string<_CharT, _Traits, _Alloc>&, const std::basic_string<_CharT, _Traits, _Alloc>&)↵/usr/include/c++/4.6/bits/basic_string.tcc:694:5: note: template<class _CharT, class _Traits, class _Alloc> std::basic_string<_CharT, _Traits, _Alloc> std::operator+(const _CharT*, const std::basic_string<_CharT, _Traits, _Alloc>&)↵/usr/include/c++/4.6/bits/basic_string.tcc:710:5: note: template<class _CharT, class _Traits, class _Alloc> std::basic_string<_CharT, _Traits, _Alloc> std::operator+(_CharT, const std::basic_string<_CharT, _Traits, _Alloc>&)↵/usr/include/c++/4.6/bits/basic_string.h:2343:5: note: template<class _CharT, class _Traits, class _Alloc> std::basic_string<_CharT, _Traits, _Alloc> std::operator+(const std::basic_string<_CharT, _Traits, _Alloc>&, const _CharT*)↵/usr/include/c++/4.6/bits/basic_string.h:2359:5: note: template<class _CharT, class _Traits, class _Alloc> std::basic_string<_CharT, _Traits, _Alloc> std::operator+(const std::basic_string<_CharT, _Traits, _Alloc>&, _CharT)↵/usr/include/c++/4.6/bits/stl_bvector.h:266:3: note: std::_Bit_iterator std::operator+(std::ptrdiff_t, const std::_Bit_iterator&)↵/usr/include/c++/4.6/bits/stl_bvector.h:266:3: note: no known conversion for argument 1 from ‘std::string {aka std::basic_string<char>}’ to ‘std::ptrdiff_t {aka long int}’↵/usr/include/c++/4.6/bits/stl_bvector.h:352:3: note: std::_Bit_const_iterator std::operator+(std::ptrdiff_t, const std::_Bit_const_iterator&)↵/usr/include/c++/4.6/bits/stl_bvector.h:352:3: note: no known conversion for argument 1 from ‘std::string {aka std::basic_string<char>}’ to ‘std::ptrdiff_t {aka long int}’↵/usr/include/c++/4.6/bits/stl_iterator.h:896:5: note: template<class _Iterator, class _Container> __gnu_cxx::__normal_iterator<_Iterator, _Container> __gnu_cxx::operator+(typename __gnu_cxx::__normal_iterator<_Iterator, _Container>::difference_type, const __gnu_cxx::__normal_iterator<_Iterator, _Container>&)↵Error compiling evaluation program"


In reply to Nijesh W

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Nijesh,
congratulation for your succed with running Larabel and nodejs within VPL. If you wish, you can share your experience with us.
About the problem you report, the message is saying that evaluation program can not be compiled. The first messages seem to show a problem with the character encoding of vpl_evaluate.cpp, but this file is ASCII. are you using a system character encoding not ASCII compatible.
If this is the problem you can add the switch "-finput-charset=UTF-8" to the vpl_evaluate.cpp compilation instruction in the "default_evaluate.sh".
In any case, this is a guess based on few information. If you show me all details of how to reproduce your problem then I will spot it better.

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Nijesh W -

Hi Juan,

I think you mis understood, what I'm trying to say is I'm developing entire vpl system in node js.

June now I'm getting the following error, can you please help me

  1. g++: internal compiler error: File size limit exceeded (program cc1plus)↵Please submit a full bug report,↵with preprocessed source if appropriate.
  2. See <file:///usr/share/doc/gcc-4.6/README.Bugs> for instructions.
  3. Error compiling evaluation program"

I have attached requested xml data
In reply to Nijesh W

Re: New Virtual Programming Lab (VPL) module

by Nijesh W -

Hi Juan,

I have fixed the above issue, now I'm strucked with another error, can you please help me.

Error is : terminate called after throwing an instance of 'std::logic_error'↵ what(): basic_string::_S_construct null not valid

In reply to Nijesh W

Re: New Virtual Programming Lab (VPL) module

by Nijesh W -

I'm getting the below error while Evaluvate the program.

  1. "terminate called after throwing an instance of 'std::logic_error'↵ what(): basic_string::_M_construct null not valid↵/home/p11225/.vpl_launcher.sh: line 11: 11451 Aborted (core dumped) ./vpl_execution"

In reply to Nijesh W

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Nijesh,
with the information you show I cannot guess a clear reason. Notice that the only thing I see is that a string constructor is returning null. May be you are running out of memory.
best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Nijesh W -

Hi Juan,

I found the issues, all the execution files has extra "\" generated inside /jail/home/instance_id.

Example : for "\n" getting "\\n" same as for "\\r" getting "\\r"

here is the link for execution files which I have backup http://13.126.25.39/home_b/home/p10561/

Can you please help me to fix this issue.

In reply to Nijesh W

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Nijesh,
please, be more specific, say the file and line with the issue or tell how you detect this problem, I don't found the extra backslash that you report in the files I have reviewed.

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Nijesh W -

Hi Juan,

This is the file name http://13.126.25.39/home_b/home/p10561/vpl_evaluate.cpp and the line number is 354 , 356, 365, 375 and so on. Can you please check it.

This is the file which is generated inside jail server during evaluate.

In reply to Nijesh W

Re: New Virtual Programming Lab (VPL) module

by Nijesh W -

Hi Juan,

I have fixed the issue, the issue is due to headers in post request.

Thanks for your good support.

In reply to Nijesh W

Re: New Virtual Programming Lab (VPL) module

by m k -

Hi Nijesh, 


could you elaborate on what the issue exactly is and how you fixed it? It would be a lifesaver. 

It looks like I have the same problem, the browsers keep returning with this on evaluate:

g++: internal compiler error: File size limit exceeded (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-5/README.Bugs> for instructions.


...Even for a hello_world.py program at 128MB memory limit set. There don't seem to be any logs appearing either at LOGLEVEL=8.

It's running in a small ubuntu VM but there should be enough memory.

In reply to m k

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello m k,
the program that test students' programs is written in C++ and is compiled and runned in each evaluation. It's seems that your are setting a low "file size limit".
Please try increasing the "file size limit" at "Advanced settings =>  Maximum execution resources limits".

Best regards.


Attachment Captura.JPG
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by m k -

It was set to the same amount as when I tried it on the demo jail server, and it worked there. 

Is it realistic that the compiling is using over the 128MiB treshold? I'm only trying to run a hello_world.py file. I changed it to 128/192MiB and it is the same error


Attachment vpl_settings.png
In reply to m k

Re: New Virtual Programming Lab (VPL) module

by m k -

The exact error I am getting now after uncommenting MAXMEMORY in the .conf file:

error message

if I comment out MAXMEMORY again, I get a Timeout after "8seg" (sec countdown?)

vpl-jail-system.conf file:

#
#vpl-jail-system config file
#
#Format VAR=VALUE #no space before and after "="
#JAILPATH set the jail path
JAILPATH=/jail
#MIN_PRISONER_UGID set start first user id for prisoners
MIN_PRISONER_UGID=10000
#MIN_PRISONER_UGID set the last user id for prisoners
MAX_PRISONER_UGID=20000
#MAXTIME set the maximum time for a request in seconds
MAXTIME=16
#Maximum file size in bytes
MAXFILESIZE=4096
#Maximum memory size in bytes
MAXMEMORY=2000000
#Maximum number of process
MAXPROCESSES=30
#Path to control directory. the system save here information of request in progress
CONTROLPATH="/var/vpl-jail-system"
#Limit the servers from we accept request
#IP or net (type A, B and C) separate with espaces
#Format IP: full dot notation. Example: 128.122.11.22
#Format net: dot notation ending with dot. Example: 10.1.
#TASK_ONLY_FROM=192.1168.57.1
#To serve only to one interface of your system
#INTERFACE=128.1.1.1
#Socket port number to listen for connections (http: and ws:)
#default 80
#PORT=80
#Socket port number to listen for secure connections (https: and wss:)
#default 443
#SECURE_PORT=443
#URL path for task request
#act as a password, if no matches with the path of the request then it's rejected 
URLPATH=/a6amkt
#FIREWALL=0|1|2|3|4
#0: No firewall
#1: VPL service+DNS+internet access
#2: VPL service+DNS+Limit internet to port 80 (super user unlimited)
#3: VPL service+No external access (super user unlimited)
#4: VPL service+No external access
#Note: In level 4 stop vpl-jail-system service to update/upgrade the system
#default level 0
#FIREWALL=2
#ENVPATH is enviroment PATH var set when running tasks
#IMPORTANT: If you are using RedHat or derived OSes you must set this parameter to the
#PATH environment variable of common users (not root) example
#ENVPATH=/usr/bin:/bin
#LOGLEVEL is the log level of the program
#From 0 to 8. 0 minimum log to 8 maximum log and don't removes prisoners home dir.
#IMPORTANT: Do not uses high loglevel in production servers, you will get pour performance
#default level 0
LOGLEVEL=0

Moodle config below:

Attachment vpl_settings.png
Attachment vpl_settings2.png
In reply to m k

Re: New Virtual Programming Lab (VPL) module

by m k -

One more further finding: "Run" works and runs the hello_world.py program in the interactive terminal, but "Evaluate" does not work. It is still giving various errors, most commonly the g++ one.

In reply to m k

Re: New Virtual Programming Lab (VPL) module

by m k -
Looks to be resolved by changing 

MAXFILESIZE=4096
to

MAXFILESIZE=4096000
in the jail server's config file. This parameter does not look like one that can be set from the Moodle UI (the file size settings there had no effect on this). 

Either that, or this config file value is the actual absolute maximum that is preferred over the one sent by Moodle in requests.


Looking at the source code it seems to be the latter:

executionLimits.maxfilesize=min(parsedata["maxfilesize"]->getInt(),executionLimits.maxfilesize);

I think this deserves a change in the setup (or at least a mention in the docs), because the default jail-server-side config value at 4KB is unnecessarily tiny (overrides Moodle settings), and g++ compiled executables are on the scale of at least 400KB. 

In reply to m k

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Yes, the documentation need a rewrite and reorganization.

The default value for the "MAXFILESIZE" parameter is 64MB, but can be easily changed to a very low value and may generated a problem difficult to find.

https://github.com/jcrodriguez-dis/vpl-xmlrpc-jail/blob/2bd9f0363f8c654e883010cb76a64ef93c0d89be/src/configuration.cpp#L50
https://github.com/jcrodriguez-dis/vpl-xmlrpc-jail/blob/2bd9f0363f8c654e883010cb76a64ef93c0d89be/vpl-jail-system.conf#L19

I recommend to use the resource limits with caution because a very low resource may generate unexpected problems.

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Garth Brady -

Greetings,

I am finding that when I create an execution file with the following code (vpl_evaluate.sh):

php << "END_OF_PHP" > evaluate.cases

the students must use php to solve the problem.  Other compilers (C#, CPP, Python) won't execute in their compilers.  Instead, VPL prints out the actual code that the student has submitted.  Is there a way to set VPL to be language independent such that a student could solve the problem in any language? 

In reply to Garth Brady

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hi Garth,
notice that the VPL compilation phase is controlled by (in order of priority):
1) vpl_run.sh. If you write contents into this configuration file, the system will use this script to prepare the execution phase. vpl_run.sh must generate the vpl_execution file that will be run in the next phase.
2) If vpl_run.sh is empty, from VPL 3.2 you can chose the programming language to use (go to "execution options" to set this option).
3) If you are using VPL 3.2 or higher and has selected "Autodetect" at "execution options" (default option) or you are using a lower version the system will select the programming language based in the filenames extensions.

To use the "Autodetect" feature you must remove the vpl_run.sh content and set "execution options=> Run script" to "Autodetect" if available.

If you need to customize the compilation phase but still use the "autodetect" feature, there is an undocumented feature that can help you. If you write a "pre_vpl_run.sh" file at "execution files", this file will be executed into the "vpl_run.sh" selected by "Autodetect".

Best regards,
Juan Carlos.

Attachment Captura.JPG
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Garth Brady -

"If you need to customize the compilation phase but still use the "autodetect" feature, there is an undocumented feature that can help you. If you write a "pre_vpl_run.sh" file at "execution files", this file will be executed into the "vpl_run.sh" selected by "Autodetect"."

This is fantastic and exactly what I'm after.  Thanks so much!

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Gary Newport -

Hi - we are really enjoying using VPL and are looking into developing the use of GUIs with our students. I've worked out how to get tkinter with Python working but am having problems working out how to incorporate images. I've put the image into the execution files - its a gif (I know tkinter doesn't like many image file types!) but I keep getting an error that the image cannot be found. 

Any help would be appreciated.

Kind regards

Estelle

In reply to Gary Newport

Re: New Virtual Programming Lab (VPL) module

by m k -

Here's what I found out about customizing the jail server.


When it gets a valid request from moodle, it:


  • forks a new process (still running as root)
  • uses "chroot" on the configured JAILPATH (usually /jail)
  • creates a new user & their HOME in the chrooted environment
  • uses "su" to switch execution mode to that user
  • creates the files it got in the request (submission and things like vpl_evaluate.sh) inside the new user's HOME
  • runs by default either "vpl_run.sh" or "vpl_evaluate.sh"
  • then runs "vpl_execution" that the previous steps should create
  • cleanup, etc.


From this flow, the important step for you is the "chroot" & "su" one. If you want to make extra files visible to the execution environment, you need to put them in either:


  • JAILPATH and make them world readable(/executable); that way, each execution will see the file "$JAILPATH/myfile" inside the execution env. as "/myfile" due to chroot, and will have read permissions
  • or in "/bin" or "/sbin", as these are mounted as read/execute-only inside JAILPATH, so things in them will naturally be visible (and also be in PATH)
  • the submission files themselves, but this is annoying and unnecessary


In either case, it would help to customize the vpl_run.sh for your specific type of task, so it symlinks or copies the "/myfile" to "$HOME/myfile" (will be cleaned up with the whole HOME) for the time of the execution if it is necessary to have it in the same directory or to be able to write it as well.


You can do that by putting your own "${your_language_with_dashes}_run.sh" (eg. "python-with-tkinter_run.sh") file in this folder on moodle: "$MOODLEPATH/mod/vpl/jail/default_scripts" (repo examples). 


Then you will get your own flavor of python from the "Run script" dropdown in "Execution options" in a moodle VPL activity.

In reply to Gary Newport

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi, Gildredge

Notice that by security reason all "execution files" are removed after compilation phase and before the execution phase. If you want to change this behavior go to "Files to keep when running" and select the image files.

Best regards.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Gary Newport -

Hi Juan


I have done that - I have also adapted the run script to make it run as an X-windows application, everything works fine with the tkinter code until I try to include an image an then I get the error that the image cannot be found. I have tested the code in IDLE and it works fine so it isn't an issue with the code itself.


I really appreciate the help.


Estelle

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Garth Brady -

FYI, this has been happening all day:  

This site can’t be reached

vpl.dis.ulpgc.es took too long to respond.

ERR_CONNECTION_TIMED_OUT
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Garth Brady -
Sqlite is not accessible via php on your demo server (nor is it available on our jailserver).  When running phpinfo() inside a VPL activity, it seems php7.1 is not accessing a config file:


"Configuration File (php.ini) Path => /etc/php/7.1/cli
Loaded Configuration File => (none)"

Why is it that php is compiled so that it does not load a php.ini file for server configuration?

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Garth Brady -

This is just a quick note to say that I've been mucking about with the VPL jailserver in a VirtualBox and had great difficulty determining why Chrome/FF/Edge were returning 'Error: Connection Refused'.  I could ping the server without issue.  I eventually determined that during install, if you don't issue a Self-Signed certificate, all browsers refuse the connection and the jailserver can't be reached at all.

Juan - perhaps the install script should force the install of a self-signed cert to avoid this issue.

In reply to Garth Brady

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Thanks very much Garth,
I add this problem to the TODO list for the next releases of VPL execution server.

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Amir Ben-amram -

Hello Juan,

I have begun using VPL in my courses this year, and I like it very much, but I don't think I'm making the best use of it yet.

I have two questions:

(1) As far as I could see, I can set a submission deadline, but unlike the ordinary moodle assignment activity, I have not seen how to grant extensions to particular students.   Is it possible?  (If not yet, could I make a feature request here?)

(2) Regarding the "plagiarism/similarity detector", I understand that its function is to generate a similarity report to the teacher.  I have been hesitating about turning this on because I wanted to be sure that results would not be visible to students.  I understand that your intention is that the tool will not "denounce fraud" by itself, but I wanted to be sure.  Can you confirm this?   It would be nice to have a little guide to this feature somewhere (not the theory - just usage, what the teacher sees, what the student sees).

Best regards and thanks for creating and maintaining this tool

Amir

In reply to Amir Ben-amram

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hello Amir,
I will try to answer your questions.
A1) No, it is not possible to grant extensions to a particular student. I have log this as a feature request.
A2) Yes, I confirm that this feature is predefined to be used by teachers and the students don't see anything about this report. The standard Moodle archetypes that by default are allowed to use this feature are: 'teacher', 'editingteacher', 'coursecreator' and 'manager'. But notice that a user with enough privileges can grant this capability to any user or archetype.

I think that the use of the similarity feature must follows this advices:
1) The similarity report is NOT criteria to assure that a copy was happened.
2) The only trustable report about the possibility of a prohibited copy is the generated by a teacher, based in his own criteria.
3) The similarity report can help the teacher to select what pair of submissions must be compared in detail. Notice that the report can give "false positives".
4) The report orders the output from more to less similar. After the ordered pairs, the report shows clusters of similar submissions.
5) The system tries to help the teacher to compare pairs of files by showing it side by side and adding blank lines to try to align similar lines of code. You must click in the similarity rate of a pair of files to get this feature.
6) A common way to study the report is review the pairs from most to less similar and stop reviewing when you found three of four adjacent "false positives".

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

How can I testing multiple test cases?

by Jonghwa Park -

I'm using hustoj (https://github.com/zhblue/hustoj) judge server with moodle but these system run separately at same Server.

In hustoj test cases exist 1.in 1.out 2.in 2.out... etc.

How can I integrate these test cases with vpl system using vpl_evaluate.sh?

I want to use c++ language below file is my testing script. But the result is  

TEST 1

Your output is incorrect.
Your program tested with:
cat: /1.in: there is no such file or directories.


#! /bin/bash

# D. Thiebaut

# Smith College

# vpl_evaluate.sh script looping through several tests, each test with

# its own input file and its own expected output file.  The output of the

# student program is tested against the expected output file.

cat > vpl_execution <<EEOOFF

# --- program tested (no extension) ---

prog1=main

gcc -o \${prog1} \${prog1}.cpp

grade=100

CWD="$(pwd)"


for i in 1 2 ; 

do

   echo "Comment :=>>-TEST \${i}"

   echo "$pwd"

   

   # ==============================================

   # TEST i

   # ==============================================

   #--- run program, capture output, display to student ---

   ./${prog1} < ./\${i}.in &> user.out

   cp user.out user.out.org


   #--- remove non numbers and non minus---

   cat user.out | sed 's/[^0-9\ -]*//g' > dummy.out

   mv dummy.out user.out


   #--- remove multiple spaces ---

   cat user.out | sed 's/  */ /g' > dummy.out

   mv dummy.out user.out


   #--- remove blank lines ---

   cat user.out | sed '/^\s*$/d' > dummy.out

   mv dummy.out user.out


   #--- compute difference ---

   diff -y -w --ignore-all-space user.out ${i}.out > diff.out

   #echo "----- diff.out ------"

   #cat diff.out

   #echo "---------------------"

   diff -y -w --ignore-all-space user.out ${i}.out > diff.out


   #--- reject if different ---

   if ((\$? > 0)); then

      echo "Comment :=>>- Your output is incorrect."


      #--- display test file ---

      echo "Comment :=>>- Your program tested with:"

      echo "<|--"

      cat ./\${i}.in

      echo "--|>"


      echo "Comment :=>> ---------------"

      echo "Comment :=>>- Your output:"

      echo "Comment :=>> ---------------"

      echo "<|--"

      cat user.out.org

      echo "--|>"

      echo ""

      echo "Comment :=>> ---------------"

      echo "Comment :=>>- Expected output (only the numbers): "

      echo "Comment :=>> ---------------"

      echo "<|--"

      cat \${i}.out

      echo "--|>"


      #--- consolation grade ---

      grade=\$((grade+10))


      # --------------------- REWARD IF CORRECT OUTPUT -----------------

   else

      #--- good output ---

      echo "Comment :=>>- Congrats, your output is correct."

      echo "Comment :=>> --------------------------------."

      echo "<|--"

      cat user.out.org

      echo "--|>"

      grade=\$((grade+100/i))

   fi

done

if (( grade > 100 )); then

   grade=100

fi

echo "Grade :=>> \$grade"


EEOOFF

chmod +x vpl_execution


---

Attachment file is current situation.

Thanks a lot.




Attachment 9999.jpg
In reply to Jonghwa Park

Re: How can I testing multiple test cases?

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Jong Hwa Park,
It seems that you forget to add the files "*.in" and "*.out" to the "Advanced settings => Files to keep when running" list. Notice, that for security reasons, all the "Execution files" are removed before running vpl_execution.
If you are using a variable number of tests files I recommend to use other extension and copy/rename it in the preparation script. If the system doesn’t find the execution file then cannot remove it, avoiding the use of "Advanced settings => Files to keep when running".

Best regards,
Juan Carlos.


In reply to Juan Carlos Rodríguez-del-Pino

Re: How can I testing multiple test cases?

by Jonghwa Park -

Thanks a lot your reply.

I don't know exact procedure using many test case with file.

May be our student use c++ so I want using c++ support script and I'm checking "Files to keep when running".

The judge result sometimes wrong and error. I don't know what is wrong.

Is there plan support test case with external files ?


Plz see my sh file.

vpl_run.sh

#!/bin/bash

#load common script and check programs

. common_script.sh

check_program g++

get_source_files cpp c


#compile

g++ -std=c++11 -o vpl_execution $SOURCE_FILES -lm -lutil



vpl_evaluate.sh

#! /bin/bash

# D. Thiebaut

# Smith College

# vpl_evaluate.sh script looping through several tests, each test with

# its own input file and its own expected output file.  The output of the

# student program is tested against the expected output file.

cat > vpl_execution <<EEOOFF

# --- program tested (no extension) ---

prog1=main

#gcc -o \${prog1} \${prog1}.cpp

g++ -o main main.cpp


grade=100

CWD="$(pwd)"


for i in {1..18} ; 

do

   echo "Comment :=>>-TEST \${i}"


   # ==============================================

   # TEST i

   # ==============================================

   #--- run program, capture output, display to student ---

   \${CWD}/\${prog1} < \${CWD}/\${i}.in &> \${CWD}/user.out

   cp user.out user.out.org


   #--- remove non numbers and non minus---

   cat user.out | sed 's/[^0-9\ -]*//g' > dummy.out

   mv dummy.out user.out


   #--- remove multiple spaces ---

   cat user.out | sed 's/  */ /g' > dummy.out

   mv dummy.out user.out


   #--- remove blank lines ---

   cat user.out | sed '/^\s*$/d' > dummy.out

   mv dummy.out user.out


   #--- compute difference ---

   diff -y -w --ignore-all-space user.out ./\${i}.out > diff.out

   echo "----- diff.out ------"

   cat diff.out

   echo "---------------------"

   diff -y -w --ignore-all-space user.out ./\${i}.out > diff.out


   #--- reject if different ---

   if ((\$? > 0)); then

      echo "Comment :=>>- Your output is incorrect."


      #--- display test file ---

      echo "Comment :=>>- Your program tested with:"

      echo "<|--"

      cat \${CWD}/\${i}.in

      echo "--|>"


      echo "Comment :=>> ---------------"

      echo "Comment :=>>- Your output:"

      echo "Comment :=>> ---------------"

      echo "<|--"

      cat user.out.org

      echo "--|>"

      echo ""

      echo "Comment :=>> ---------------"

      echo "Comment :=>>- Expected output (only the numbers): "

      echo "Comment :=>> ---------------"

      echo "<|--"

      cat \${i}.out

      echo "--|>"


      #--- consolation grade ---

      grade=\$((grade+10))


      # --------------------- REWARD IF CORRECT OUTPUT -----------------

   else

      #--- good output ---

      echo "Comment :=>>- Congrats, your output is correct."

      echo "Comment :=>> --------------------------------."

      echo "<|--"

      cat user.out.org

      echo "--|>"

      grade=\$((grade+100/i))

   fi

done

if (( grade > 100 )); then

   grade=100

fi

#echo "Grade :=>> \$grade"


EEOOFF

chmod +x vpl_execution

In reply to Jonghwa Park

Re: How can I testing multiple test cases?

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Jonghwa Park,
At this moment we are not planning to support files as input and/or output.
have you give a chance to the default test program of VPL?
I don't know the detailed format of the test case of Hustoj.
Each pair of files is a test case or is a set of test case for a problem?
I guess that the reason to use files as input of test case are:
1) The size/number of the files is too large to use one common file of cases.
2) The files have a binary content
3) Your test cases are legacy and has this format

Notice that VPL was not intended as a judge system. It (the execution system) does not collect information about the resources used by the tested program. In the future VPL might collect this information to be used as grade source.
If Each pair of files is a test case, the way to adapt the format from Hustoj data is generating a vpl_evaluate.cases with exact match test (double quote output definition) and this content
--------------------
Case = 1
input=content of the 1.in file, don't use quotes as in output

output="content of the 1.out file in double quotes
"
Case = 2
input =content of the 2.in file, don't use quotes as in output

output= "content of the 2.out file in double quotes
"
Case = 3
input =content of the 3.in file, don't use quotes as in output

output= "content of the 3.out file in double quotes
"
--------------------

Notice that the generation of the vpl_evaluate.cases file from the “*.in” and “*.out” files may be automated.

Best regards,
Juan Carlos.


In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Nijesh W -

Hi Juan,

I'm getting New state 'failed', was 'normal'. Msg: Server disconnected (code: 1005) error while running html files.
I have set Maximum memory used and Default maximum memory used to 1GB but not working.
Please see the attached screenshot.

Attachment Screen Shot 2018-07-02 at 1.12.png
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Rohith Chaganti -
Is there any way to Load Balance different VPL jail servers so that i get to use a single load balanced ip
In reply to Rohith Chaganti

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

See 12 May 2017 post

https://moodle.org/mod/forum/discuss.php?d=154988#p1421592


Best regards,

Juan Carlos.


In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Brian Sea -

Hi Juan:

I'm in the midst of testing out VPL for my upcoming classes, and I wanted to point out a small inconsistency.

vpl_get_max_post_size() in locallib.php doesn't take into account that post_max_size in the php.ini could be zero -- as in "no limit."  As a result, VPL doesn't allow for the setting of a max file size.  This might be expected behavior, but I couldn't find any notice of it in the documentation.  

Thanks for working on the software!

-- Brian

P.S. Is there somewhere else besides these forums that can submit bug/etc if I find them?

In reply to Brian Sea

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Brian,
Yes, this might be expected behavior, but it's a bug.
I have added this bug to the VPL issues at GitHub
https://github.com/jcrodriguez-dis/moodle-mod_vpl/issues/74

There is a simple workaround by setting post_max_size to a non zero value, but not all user can change this value. The next VPL release will resolve the problem.

Thanks for your bug report.

Best regards,
Juan Carlos.

P.S.: VPL bug tracker at https://github.com/jcrodriguez-dis/moodle-mod_vpl/issues

In reply to Juan Carlos Rodríguez-del-Pino

MOODLE 3.5 Upgrade for VPL Jail server

by Daniel Creed -

I am having trouble with my Jail-server for a client. They recently upgraded their moodle to 3.5 and the jail server has failed to work again. The plugin works correctly. I get to this page. I am using ubuntu 17.10. 


It used to work before the upgrade. I spent two days on this issue. I recreated the certificate. When I click on the link it doesn't ask me to accept a certificate. 


Also I dont get an OK page when I go to the server[port]/ok. It just displays the page took too long to respond


Please assist



Attachment Image from Server.PNG
In reply to Daniel Creed

Re: MOODLE 3.5 Upgrade for VPL Jail server

by Garth Brady -

We are experiencing what I believe is the very same problem.  Basically, the connecting window takes forever to load, then after a long wait the 'Click on the following links (server #) and accept the offered certificate' window appears.  When a user clicks on the server link (Server 10), there is an error that says the server took too long to respond.

This only happened after an upgrade to the latest Moodle 3.5.

In reply to Garth Brady

Re: MOODLE 3.5 Upgrade for VPL Jail server

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Daniel and Garth,
I need the versions of Moodle, VPL, the O.S. running the jail server and the jail server to try to spot the problem reported.

Daniel reported that he can not get an OK page from the jail server. I guess that he has updated the O.S. of the jail server and this may be the problem. Please try setting the FIREWALL parameter of the jail server to 0. I have not tested the jail server with Ubuntu 17.10.

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: MOODLE 3.5 Upgrade for VPL Jail server

by Daniel Creed -

Hey Juan Carlos 


Thanks for the response 

Far as I know this was we have

Moodle 3.5.1

VPL 3.3.4

Ubuntu 17.10 with the latest jail-system. Which I recently reinstalled


I don't believe the OS was upgraded and it was working before the moodle got upgraded. 

The firewall parameter is set to 0 already. 


Thanks

Daniel


In reply to Juan Carlos Rodríguez-del-Pino

Re: MOODLE 3.5 Upgrade for VPL Jail server

by Daniel Creed -

The good news I figured the issue. It was the hosting provider had a firewall on top of the servers firewall. All is working now. 

Confused me a little as it was upgraded nothing should of changed. 

Thanks

Daniel

In reply to Daniel Creed

Re: MOODLE 3.5 Upgrade for VPL Jail server

by Garth Brady -

Thanks - interesting that this was our issue as well.  Sorry for the trouble!

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Geraldo Zimbrao -

Hey Juan Carlos,

Is there any default extension for C++ programs? The plagiarism tool is not working when the file extension is ".cc", for example, main.cc

However it is working for java programs.

Thanks in advance,

Geraldo. 

In reply to Geraldo Zimbrao

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hey Geraldo,
I have added 'cc' to the valid C++ extensions for similarity check.
see
https://github.com/jcrodriguez-dis/moodle-mod_vpl/commit/08713e2894d9cd42cd2da61b21895ae82506006a

Best regards,
Juan Carlos.


In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Ljubisa Punosevac -

Hi everbody,

Does anyone knows how the default file container height can be increased? 
Maybe it is just me, but it would be great if size of the screen where you should write your code can be slightly bigger. 
I know there is full screen option, but I am trying to do something in between, since I have plenty of empty space around.

Best,
Ljubisa.

screenshot


In reply to Ljubisa Punosevac

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Ljubisa,
The current height of the file container is calculated dynamically with a minimum value. The height is calculated to show completely the file container in the view area of the page (with no scroll).
Sorry, but there is no setting to change this behaviour.
You can change the minimum height (150 pixels) by changing the code at
https://github.com/jcrodriguez-dis/moodle-mod_vpl/blob/08713e2894d9cd42cd2da61b21895ae82506006a/editor/VPLIDE.js#L776
and the next line.

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Ljubisa Punosevac -

Hi Juan-Carlos,

Thank you for your quick response. I will try to do something in Appearance/Additional HTML section. Maybe I can adjust the size there. So far I tried but without success, since your JavaScript overrides my smile.

Not a big deal though.

Best,
Ljubisa

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Garth Brady -

Greetings all,

We have very high praise for this plugin.

We would like to extend a deadline for a particular set of users, however, VPL does not provide this option.  It is a common moodle setting in moodle 3.5+ for quizzes and assignments.  Why is this not possible in VPL?

In reply to Garth Brady

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hello Garth,
This feature has been already requested and is in the TODO list of VPL. I don't know if it will be ready for the next release.

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

New Virtual Programming Lab (VPL) module

by Сергей Ардуинов -

How to solve this problem? Antivirus is disabled https://screencast-o-matic.com/watch/cF6VQzYQIn

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Garth Brady -

Greetings all,

We've discovered a small bug where a student writes a php file and if this filename has spaces in it (example: 'this Is My Filename.php') the jailserver hangs as though there were an infinite loop.

In reply to Garth Brady

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hello Garth,

Thank you very much for your contributions reporting bugs.

A fix for this bug will be included with the release of 3.4. The problem affects many of the supported programming languages. The fix is already coded, but still, need to be more tested.

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: No Administration Options in VPL Admin Block and Activity

by JOSE LUIS ANTA GONZALEZ -

Hello, Juan.

I have installed VPL Plugin in my moodle platform and the same with vpl-jail execution server running OK at this moment. My problems are two: on the one hand, in moodle server, I have not or don´t see VPL Administration options like Edit Settings, Test Cases, etc. Here two images of my enviroment, one of them a test activity:


Finally, the next problem is that when I run the code in the second image, the execution server connect, but spears in compilation the next error message: cc1: error: unrecognized command line option "-fno-diagnostics-color", thus I hope you can help me.

Best regards and thanks a lot.

Attachment ActivityNoAdminOptions.PNG
Attachment AdminOptionsBlock.PNG
In reply to JOSE LUIS ANTA GONZALEZ

Re: No Administration Options in VPL Admin Block and Activity

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello José Luis,
I assume that you have resolved your previous problem installing the plugin on Moodle.

- The answer to the first question
Based on your screenshot, I guess you are using the Clean theme. This theme shows a side administration menu.

The VPL administration options at the site level are the one at the first part of the screenshot you show. A site administrator can use these options.

When a user with teachediting privileges selects a VPL activity, the options at activity level appear at the administration menu.

If you use the Boost theme the administration options at activity level will appear at the top-right corner as a gear icon. The current public version of VPL has a bug that makes this action menu disappears at some conditions e.g when you select an advanced menu option. This bug has not been resolved for VPL 3.3.x due to the existence of a simple workaround: selecting again the activity at the breadcrumbs. Nevertheless, this problem has already been resolved for the next VPL 3.4 version.


- The answer to the second question
This message is saying that you are using an old GCC version < 4.9. You have different options to resolve this problem:
1) Upgrade your GCC to a version >= 4.9
2) Upgrade your O.S. to a Linux distribution with a default GCC version >= 4.9
3) Modify vpl/mod/jail/default_scripts/cpp_run.sh removing the option.
4) Other ways: Se the discussion about a similar problem at https://moodle.org/mod/forum/discuss.php?d=154988&parent=1269705

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: No Administration Options in VPL Admin Block and Activity

by JOSE LUIS ANTA GONZALEZ -

Hello Juan Carlos,

First, sorry, I have already realized where VPL activity options are situated: I was not able to see them at all!

Second, the thing are a little more: my server are mounted over CENTOS 6, which has gcc/g++ 4.4 by default and unfortunatelly it is not possible to upgrade them, but nevertheless, I have installed a partial solution and effective:

First I installed the repository of CERN:Second I installed the gcc and g++ devtool 3:
  • yum -y --nogpgcheck install devtoolset-3-gcc devtoolset-3-gcc-c++
By last, this install the 4.9 gcc/g++ version, but it don´t work, as it is necessary launch a new shell with:
  • scl enable devtoolset-3 bash

After this, server running and gcc/g++ 4.9 version working, I probe a simple Python activity following the D. Thiebaut tutorial here and it works well both as a teacher and as a student.

Now, my intention is to use this tool with my high school students.

Thank you very much for your attention and clever comments and I sincerely apologize for my silly image format mistakes in my first message.


Best regards,

José Luis.

In reply to JOSE LUIS ANTA GONZALEZ

Re: No Administration Options in VPL Admin Block and Activity

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello José Luis,
thank you very much for sharing your problems and solutions, I am sure this will helps others.

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi Juan Carlos

This is amazing! I added the plug-to a Moodle 3.5 in my laptop - running https://distrowatch.com/bunsenlabs, which is a flavour of Debian Stretch. The plug-in worked as advertised, connecting to your jail server. Then I installed a minimum Debian Stretch on VirtualBox and got the jail server compiled without trouble. It needed very few developer tools. The installation also went smoothly, but this time a ton of Debian packages were downloaed in the process. Altogether a surprisingly simple affair. And this is something I was searching for.

Few beginner's questions though (I was not too inclined to peruse the 1+ kPosts above):
- Can the students too run their programs within the VPL, like what teachers do when they correct the programs?

- Rather than uploading source files, can the students type the program into the VPL and run them, like working in an IDE?
In reply to Visvanath Ratnaweera

Re: New Virtual Programming Lab (VPL) module

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Already the next question: I know, that this is not a secure thing. But can I have the jail server and the (Moodle) webserver on the same machine? In a classroom (LAN) application where the student devices may not have the development environment, having everything in one server is very convenient.
In reply to Visvanath Ratnaweera

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Viswanath Ratnaweera
Yes, you can install the jail server and Moodle on the same machine, but you must consider the security and performance vs convenience.

The jail service seems to be secure, but nothing is fully secure.

If you finally decide to install a jail server and Moodle on the same machine I recommend you to install the jail server on a virtual machine. You will lose some performance but get security and control of resources.

Important: notice that you must use a different network port for the jail server because the common port 80/443 will be used by the web server for Moodle.

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi Juan Carlos

Thanks responding so fast, even not considering that it is Friday evening!

Yes, I am aware of the security and performance implications. Won't go production that way. Right now I am just experimenting. The localhost one worked with the jail in a VM. The next exercise is to see how it performs in a small separate server, both Moodle and jail in the same physical machine - no virtualization.

So how do you get the jail to answer in a non-standard port? Just uncomment the line "#PORT=80", change 80 to say 8080 in vpl-jail-system.conf after ./configure and then run 'make'?
In reply to Visvanath Ratnaweera

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Viswanath,
the configuration at "vpl-jail-system.conf" is loaded at every daemon start. You don't need to recompile de daemon.

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
That is very convenient! Edited the /etc/vpl/vpl-jail-system.conf introducing the line 'PORT=8080'. But when I start the jail server '/etc/init.d/vpl-jail-system start' it shows ok in green and I can see that it is listening at port 8080. But it breaks the Nginx which was running. It was serving HTTP at port 80. Now it is gone, and there is HTTPS at port 443. But this HTTPS does not deliver my old site. Once I stop the jail server, '/etc/init.d/vpl-jail-system stop' all is back to normal, i.e. Nginx at port 80, nothing at port 443.

Is it possible to run the jail server without breaking the Nginx already running?

About the Linux system: It is MoodleBox moodlebox.net 2.5.1. Which is Raspbian Lite based on Debian 9 (stretch) latest.

P.S. I am aware of the security risks and the underpowered micro computer. I have an academic application in mind, which will run inside a labortory network not facing the Internet.
In reply to Visvanath Ratnaweera

Re: New Virtual Programming Lab (VPL) module [MOVED]

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Moved to "Can I get a jail server to run headless?" https://moodle.org/mod/forum/discuss.php?d=154988#p1525397.
In reply to Visvanath Ratnaweera

Re: New Virtual Programming Lab (VPL) module [MOVED]

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Apologize for the delayed answer.

Your problem with Nginx is that the system use a default firewall setting. Please, set "Firewall=0" at /etc/vpl/vpl-jail-system.conf. With this configuration VPL will not affect other network services.

The VPL execution service (jail) can run on a headless system.

Best regards

Juan Carlos

In reply to Visvanath Ratnaweera

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Viswanath Ratnaweera
Yes, the students can edit, run, debug (some languages) and evaluate their programs.
These features are under the control of the teacher. To allow the students to run, debug or evaluate their programs, the teacher must go to the VPL activity => execution options (action menu) and switch the desired options.
The  menu option "edit" might be renamed to IDE.

Best regards,
Juan Carlos.

Attachment Captura.JPG
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi Juan Carlos

Found that one in the documentation. I knew it must be there.

Sorry for troubling you.
In reply to Juan Carlos Rodríguez-del-Pino

Can I get a jail server to run headless?

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi Juan Carlos

This is a follow-up to my previous post https://moodle.org/mod/forum/discuss.php?d=154988&parent=1525316. I think the topic changed warranting a new discussion.

I experienced that the jail server completely changes the network behaviour of the box. Breaking Nginx mentioned in the other post is just one example. I realized that even SSH server gets blocked locking me out of the headless box. Interestingly if I had a SSH connection open when I start the jail server that connection remains. That is why I didn't notice it earlier.

The setup is Raspbian latest (2018-10-09). The installation script runs through any hiccup whatsoever. The only noticeable thing is the long time it needs to get a full collection of Debian packages downloaded.

So the question is: Can I get a jail server to run headless?
In reply to Visvanath Ratnaweera

Re: Can I get a jail server to run headless? [SOLVE]

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi Juan Carlos

Got it, as you wrote in the other sub-tread: https://moodle.org/mod/forum/discuss.php?d=154988#p1525398. I should have read the config file completely.

So the summary of my various posts last week is,
- in Debian 9, Raspbian or MoodleBox, the installation is as simple as running 'install-vpl.sh' as root.

- Start, stop, restart the service with the usual 'systemctl start|stop|restart vpl-jail-system'

Points to be careful:
- if you want the jail server to use a different port than 80 add "PORT=portnr" to /etc/vpl/vpl-jail-system.conf.

- if you don't want the firewall, add FIREWALL=0 to vpl-jail-system.conf.

This is only a proof-of-concept. I have no idea how a Raspberry Pi will behave under multiple or big compilations.

Thanks for the great work and unbelievably fast support! Imagine contacting a big commercial company for user support.
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Pham Ngoc Thanh -

Hello,I'm using VPL for some tests with total line of case is above the 2.240.000 (10 cases in 1 file)
Assume the case file works, how can I  hide the test file on Description tab? (admin's view) because it's larger than 22MB :D

Thanks

In reply to Pham Ngoc Thanh

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello,
It seems that you are using the default test program in a way that  I did not expect.  But nevertheless, it is below the limits of the program.

Limits are:
- Maximum number of "test fails" to report => 20
- Maximum number of chars in the title of  a "test fails" => 1024
- Maximum number of chars in the details of  a "test fails" => 100*1024
- Maximum output size => 256 * 1024

Notice that if one of that big test fails, you will get a trimmed output.

At this moment there is no option to hide or trim this huge text file.

There are ways to manage the tests case file: save it compressed and uncompress it before been used.

1. Save your test cases file  ('vpl_evaluate.cases') inside a zip file (tc.zip) and inside other zip file. The second zip file is needed to introduce the first into the editor (the editor uncompress the external one)
2. Drop the zip file into the "executions files".
3. Write a "pre_vpl_run.sh" script at "execution files" that uncompress the test case (tc.zip).

#!/bin/bash
unzip tc.zp

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Can a Moodle + VPL plug-in + jail server box reached by port-forwarding?

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi Juan Carlos

I have Moodle with VPL plug-in serving port 80 and the jail server serving port 8080 on the same box. It works perfectly in the LAN which is on a private IP address range. My question is whether I can reach it from WAN by through a port-forwarding router?

I have set the router so that requests on ports 1-8080 coming from WAN to be forwarded to the same ports of the (internal) IP of the Moodle + VPL + jail server box. I can reach Moodle from the WAN. My problem is, what will be the jail server address for the VPL plug-in? It can't be http://privateip:8080 because the WAN also needs to reach the box. But if I give http://externalip:8080 the initial connection from Moodle does not find the jail server (which is itself).

Do you know a solution to this?
In reply to Visvanath Ratnaweera

Re: Can a Moodle + VPL plug-in + jail server box reached by port-forwarding? [SOLUTION FOUND]

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi Juan Carlos

I found a solution. Here are the full details, if anybody else tries the same.

- I gave the WAN IP of my router a domain name (could be dynamic DNS, I gave a static one in a domain I own)

- set the router so that requests on ports 1-8080 coming from WAN to be forwarded to the same ports of the Moodle + VPL box.

- set $CFG->wwwroot=http://domain above

- set mod_vpl | jail_servers to http://domain:8080

- overridden the DNS in the Moodle+VPL box by adding a line "internal-ip domain" to /etc/hosts

That was it. I was missing the last step earlier.

The problem is solved, unless somebody has a better solution.
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Michael Backus -

Thank you for making this plugin available. I've got a few questions:

  1. I've been looking for a forum for this plugin, but can't seem to find it. Is this it?
  2. For my first assignment, I would like to present my students with a large number of randomly chosen small/easy questions - basically the same program but with different errors that the student has to fix. Is that possible within a single VPL activity?
  3. I'm teaching my students to program with Arduinos. What is the best way to make everything appear exactly as it would in the Arduino IDE? I'm looking for something similar to what Richard Lobb suggests for his CodeRunner plugin: https://coderunner.org.nz/mod/forum/discuss.php?d=155

Again, thanks for making this software available.

In reply to Michael Backus

Re: New Virtual Programming Lab (VPL) module

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi Juan Carlos

1. An own forum for VPL and VPL plug-in for Moodle
Yes, it is time. This 1100-post discussion has become heavy.
;-(

2. "the same program but with different errors that the student has to fix"
I am interested too.
In reply to Michael Backus

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Michael.
A1. No, we don't have a specific forum and I think we need it.
A2. No. VPL is a plugin of type "activity". This type of plugin does not have this feature/behaviour. The way to get this is to develop a quiz question type that supports this feature.
A3. VPL is open and customizable. I am not an expert on Arduino but it seems that you need:
1) To install the Arduino CLI tools and libs in the jail-system to compile properly your C code with Arduino.
2) Customize the vpl_run.sh. You can start with c_run.sh
3) I don't know if it is there an Arduino emulator to run your code.

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Garth Brady -

Greetings all,

I've been using VPL for quite some time and thought it was time to give back.  I recently held a workshop for CS teachers and thought I would share the presentation with you.  In the presentation are instructions on how to create your very first VPL activity, and how to create advanced problem sets with randomized output (to guard against cheating).  Click the slide below to see the full presentation.

To accompany this workshop, I created a git for users interested in how to get started in creating randomized problem sets in VPL.  You can view the git here and read the instructions on to to implement this strategy.  Thanks to Juan Carlos for his guidance here!


In reply to Garth Brady

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello, Garth.
Thank you very much for sharing your approach to the generation of randomized tests.
I also want to give you thanks for being a good VPL evangelist.

Best regards,
Juan Carlos.


In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Garth Brady -

Hi Juan,

I've updated the slideshow and removed the pre 3.x server workflow slide.  Thanks for the heads up!

In reply to Juan Carlos Rodríguez-del-Pino

Re: User Overrides

by Garth Brady -

Greetings,

I thought I'd seen this somewhere before, but is there a reason VPL does not make use of the user override function in Moodle?  This functionality exists for quizzes and other activities, but not for VPL sad

In reply to Garth Brady

Re: User Overrides

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Garth,
the only reason because VPL do not support the override user /group feature is that it requires a non trivial development efforts, it requiere to manage a new DB Table and modify the code that check if a student has rigths to access/save a submission.

I have added tis feature to the TODO list.

Best regards,
Juan Carlos.


In reply to Juan Carlos Rodríguez-del-Pino

Teacher and Student notifications on VPL submission

by Chris Yust -

Hello,

Regular Moodle assignments have some useful message options for notification to teachers and students when things happen (e.g. the assignment is submitted).  In particular, if you edit the assignment settings, you will see things like "Notifications -> Notify graders about submissions".

Those notifications are guided by the default site settings (Site Admin->Plugins->Message Outputs->Default Message Outputs->"Assignment Notifications").  Messages can go to "web", "email", "online/offline", etc depending on the system configuration.  Individual users can then further customize those default preferences in their own notification area.

When editing the settings of a VPL activity, the entire "Notifications" configuration cluster is absent, and there does not appear to be any way to configure any type of notifications.  Perhaps I missed it, can anyone provide guidance?  I see an "emailteachers" column in the _vpl table but not certain if/how that is used.

Usage-wise, it is important that at least teachers get notifications when students submit VPL activities.  Depending on the VPL activity settings, those assignments may or may not be auto-graded, so there is a concrete step teachers may need to take after submission to approve the proposed grade and store it in the gradebook.  Without notifications, it seems that teachers are stuck manually clicking on every VPL activity in the course every day to scan for new submissions.  Hopefully, that is not the desired usage pattern?

It would be great if VPL just participated in the existing assignment-notification scheme (using the existing global "Assignment Notification" flags and individual user overrides).  Can anyone comment on if this is possible, or the level of difficulty involved with making it happen?

I am willing to make some VPL code changes and share the results, if someone can nudge me in the right direction.





In reply to Chris Yust

Re: Teacher and Student notifications on VPL submission

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Cris,
This feature is not developed in VPL. VPL was originally developed as a blended learning tool. The possibility of asynchronous submission was not taken into account. This feature is in the TODO list but at this moment is not planned for the next release.

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: Try/Catch Custom Evaluate with Test Cases

by Garth Brady -
Greetings,


I have been looking for a way to prevent my students from using particular functions to solve problems...  I stumbled upon E. Mendelowitz's approach, but am having some difficulty...  How can I use a customEvaluate script and still make use of the traditional VPL Case = , Input =, Output = structure?  At this point, there is no Input data provided to the student.  Here is my code:

try {
    if(!function_exists(randomInt)) {
        throw new Exception("randomInt() is not defined. Have you created the randomInt() function?");
	} else {
	 //create Case, Input and Output but this is not executed when the student script is run
  	   echo 'Case = 1' . PHP_EOL;
	   echo 'Input = 3' . PHP_EOL;
	   echo 'Output = 2';
	}
} catch(Throwable $e) {
    comment($e->getMessage());
    grade(0);
    exit();
}
In reply to Garth Brady

Re: Try/Catch Custom Evaluate with Test Cases

by Garth Brady -

After further thought, based on what I just wrote above, what I really want to do is the following:

- Check if the student file contains a particular function (read in the student file, check for function name)

- if function does exist then halt, give a comment (you can't use that function here) and a grade of 0, else { create the test cases with input and output }


In reply to Garth Brady

Re: Try/Catch Custom Evaluate with Test Cases

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Garth,
a possible solution is as follow:
1) Create a  script "checkFunction.sh" to check if a function name is in a file.

#!/bin/bash
# $1 => function name, $2 => file name
egrep "(^|\s|;|,)$1(,|;|\s|$|\()" $2
if [ "$?" == "0" ] ; then
    echo "FOUND"
else
    echo "OK"
fi

Rememer to mark "checkFunction.sh" as "file to keep when running". To have the script available at testing time.

2) Add to the start of the vpl_evaluate.cases file the following case. Notice that the case must be the first for avoiding cheating.

Case = Test if using function
Grade reduction = 100%
Fail message = Your are using a not allowed function
Program to run = ./checkFunction.sh
Program arguments = functionName fileName
output = "OK"


Change functionName and fileName to the function name and file name to check.

With this solution, the VPL default test case system and the shell script do the work. The problem here is that other cases will be also checked.

Notice that this type of checks can give false positives.

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: Try/Catch Custom Evaluate with Test Cases

by Garth Brady -

Thanks very much for your solution, Juan, and it works perfectly.  We are, however, programmatically creating our test cases (as you helped us to do a few years ago - see here).  I've played around with inserting variants of the code you just provided and can't seem to combine the two approaches (where we (1) check for illegal functions and (2) programmatically create randomized test case data.  Do you have a suggestion as to where we might insert the 'illegal checks' in the code you previously provided?

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Prakash Raju -

Hello Juan,

We have been using VPL for a long time teaching programming skills for new recruits in our office. With updated security policies, the program execution part of the VPL plugin no longer works. Digging a bit deep, I found that our office security team has blocked all socket connections. Hence, client browser & Jail server communication which happens through WSS ( In our case ) failed. As a result, all programming executions stop with a connection error.

I tried convincing my office security team to allow socket connection with no success. I just want to know if there is any possibility of VPL working without a web socket connection ( I read that the earlier versions of VPL did not user web socket.). If yes, what are the changes that would be needed to make it happen? 

I've been working with Moodle and PHP for a few years now. Hence I have a fair understanding of how things work internally in Moodle. Please suggest the approaches to be taken in VPL and Jail server to accomplish program execution without the need for web socket connections.


Adding below my Server details just in case.

  • Moodle 3.4 hosted in AWS ( No option of hosting in local servers )
  • VPL 3.3 
  • Jail 3.2.2 hosted in AWS
  • DB - PostgreSQL 9.6 hosted in AWS RDS
  • Communication between the web server, client and jail server all happens using valid CA signed SSL certificates.

Hoping to hear from you soon.


Cheers,

Prakash

In reply to Prakash Raju

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Prakash Raju,
I understand that the current risk internet situation may tends to overprotect the systems. But protects the systems by removing functionalities when secure alternatives exists seems to not be a good polity.
If you are using in all communications point to point secure connections with valid CA-signed SSL certificates, I think (I am not an expert) the communications cannot be filtered stopping only WebSocket connections.
Please, check that the configuration of the VPL plugin is properly set to use secure connections:
1. All URL to jail servers must be https://...
2. Configure the plugin to use always WSS (WebSocket Secure).
3. Use standards ports (https 443). Others port may be closed.

Some time ago our institution installed a "smart" firewall.  This "smart" firewall started complaining about VPL communications, it thought that the code that goes inside the connection was some type of attack. The easy solution was to switch to secure connections.

Please, let us know if do you manage to resolve the problem.

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Gary Newport -

I am trying to test some SQL using a large data field. I have tested sections and found everything is okay, and yet when I test the whole block I get errors. It also reports that "This output has been cut to 32Kb, its original size was 34Kb"

Is there a limit?

I have attached the SQL instructions and results.


In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Gary Newport -

According to the documentation there should be an option to enable "Only deliveries welcome from the restricted editor", but I cannot locate this anywhere.

When a student opens the VPL activity they are shown the Description tab, with a [download] link at the top. I wondered if there was an option to remove this, since I do not want, nor do they need, to download the file at all. The file is the single blank file that they then use to code within using the Edit tab.

In reply to Juan Carlos Rodríguez-del-Pino

jial server error

by daniel fu -
hi Juan:

  thank your plug,i like it very much.Last year I used this plug to teach my students.It run very well.

   but today,when I run/debug a program,the jail server return the message look like the following picture.

    it looks like jail server has some problem.

   jail pic


but I use "Check execution servers",it return "ready“。why?

could you please help me

In reply to daniel fu

Re: jial server error

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Daniel,
please check if your jail server is using loglevel=8. This configuration does not remove the users home directory and lead to this problem, please use loglevel=0.
In other case, some thing is wrong. As a workaround stop de jail service and remove the dirs under /jail/home.
sudo service vpl-jail-system stop
sudo rm -R /jail/home/*
sudo service vpl-jail-system start

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

回复: Re: jial server error

by daniel fu -

Hi Juan,

Thank you for your answer,I have reinstalled a new jail server to solver this problem.

Another question is, if I have 100+ students to compile & run programs simultaneously,it respose very slow.

I have used two jail servers to reduce load,but it seems no effect.

I used  virtualbox to install jail server in two diffirent machines which allocated 8 cpus and 16GB memory.

sudo vboxmanage showvminfo JailServer2
Name:            JailServer2
Groups:          /
Guest OS:        Ubuntu (64-bit)
UUID:            f68cdb4c-03fc-4185-8afa-c2d85416b303
Config file:     /root/VirtualBox VMs/JailServer2/JailServer2.vbox
Snapshot folder: /root/VirtualBox VMs/JailServer2/Snapshots
Log folder:      /root/VirtualBox VMs/JailServer2/Logs
Hardware UUID:   f68cdb4c-03fc-4185-8afa-c2d85416b303
Memory size:     8192MB
Page Fusion:     off
VRAM size:       16MB
CPU exec cap:    100%
HPET:            off
Chipset:         ich9
Firmware:        BIOS
Number of CPUs:  8

How can I optimise these jail servers to improve speed.


And I have checked both machines the "loglevel",it used the default value 0.

#LOGLEVEL is the log level of the program
#From 0 to 8. 0 minimum log to 8 maximum log and don't removes prisoners home dir.
#IMPORTANT: Do not uses high loglevel in production servers, you will get pour performance
#default level 0
LOGLEVEL=0

Best regards,

daniel fu

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Garth Brady -

I realize many of us are closing out the year, and I just wanted to say thank you to Juan for sharing this fabulous plugin that makes teaching CS so great for students and teachers alike.  We are grateful for your community efforts here and continue to teach high school students of all ages the intricacies of CS as a result of this fabulous tool.  Thanks so much, Juan!

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Technical Services Office ADDU -
Hi.

We tried installing the new VPL Jail system (vpl-jail-system-2.3.1.0 -- clean install -- used install-vpl-sh) and it ends with "Error mountig jail dir" -- the service does not run. Attempts to restart the service all end with the aforementioned error. When checking the /jail directory, it is empty.

We reverted to an older version (2.2.2 -- clean install) and that runs fine. When checking the /jail directory, we see that it has several directories (and files) in it such as bin, dev, etc, home, lib, lib64, proc, tmp, usr, and var.

Did we miss something when trying to install version 2.3.1.0--What should we do so that we can make the version 2.3.1.0 work?
In reply to Technical Services Office ADDU

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi,
thanks for your bug report.
To try to spot the problem we need more information.
We need to know your Linux version and the content of the installation.log file generated at the vpl-jail-system-2.3.1.0 directory.

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Technical Services Office ADDU -
We're currently using CentOS 6.10 (2.6.32-754.15.3.el6.x86_64).

With regards to the installation.log file, I hope I was successfull in attaching the file.

BTW, we tried installing version 2.3.1.0 a number of times
In reply to Technical Services Office ADDU

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Thanks for your information, I think we found the problem.
The 2.3 VPL-Jail-System uses/requires OverlayFS to replicate the root file system and CentOS/RedHat 6 does not support OverlayFS. Notice that OverlayFS is available from kernel 3.18 (2014).

I think that you have two main options:
- Keep using VPL-Jail-System 2.2.x and do not install 2.3.1
- Upgrade your system to CentOS 7 (or, I think better, Debian 9 or Ubuntu 18.04)

If you really really need VPL-Jail-System 2.3.1 on CentOS 6 you can take the "vpl-jail-system.initd" file from 2.2.3 and replace it at 2.3.1 and reinstall 2.3.1

Apologies for the inconveniences.

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Technical Services Office ADDU -
Thank you very much for the information you have provided.

On my end, I will ask the faculty using the system if they would like to have the server running the vpl-jail-system upgraded to the latest version.

Again, thank you very much.
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Vardhan W -

Hello Juan,

Thanks for your great plugin. We are using it in our office to have programming tests and practice, and its been running well till now. We noticed that the /jail/home mounted directory got full soon enough (we have around 250+ members submitting). From the config, it seems like by default the tmpfs is used for this mount, and the /jail/home uses 30% of the system memory (which is 4 GB). My questions are: 1. since currently there are many temporary directories created in /jail/home, is it Ok to just clear them? Will it impact any previous or in progress submissions by the users? i.e. are these directories all temporary and can be cleared periodically (the older ones) 2.if we change the config to not use tmpfs and restart the service, will it impact anything?

Am asking this as it is a live system and users should not be impacted.

thanks for your time.

-Vardhan

In reply to Vardhan W

Re: New Virtual Programming Lab (VPL) module

by Vardhan W -

On vpl-jail-system service restart the /jail/home is cleared. Does this mean that it is a good practice to restart this service once in a while? For normal operation where the submissions are staggered (no fixed time) we have made the USETMPFS flag as false for now and will reset it to true in case of any performance issues e.g. when we host a timed course/competition. Hope this is the right approach.

In reply to Vardhan W

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hi Vardhan,

We have released the version 2.4 of the vpl-jail-system that with other improbes resolve partially this bug. We are working to full resolve the problem.

If you have problem with the use of tmpfs you can configure the system changing the size if the home dir with HOMESIZE=10% or remove the use of tmpfs with USETMPFS=false.

Best regards.


In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Technical Services Office ADDU -
Hello Juan Carlos.

We would just like to clarify on the OS requirements for vpl-jail-system version 2.4. For Ubuntu 18.04, do we need to use the desktop version, with the GUI, or will the server version, without the GUI, suffice?
In reply to Technical Services Office ADDU

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Vpl-jail-system does not need Ubuntu 18.04 with the GUI, the server version, without the GUI, is suffice.
If you are running a vpl-jail-system dedicated machine do not install the standard desktop software, the vpl-jail-system installer will install the need packages to support GUI programming running on VNC. The idea is not to install unneeded packages. The Vpl-jail-system also runs on  O.S. with standard desktop installed.

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Technical Services Office ADDU -
Hello Juan Carlos.

We have upgraded to vpl-jail-system version 2.4. on a server running Ubuntu 18.04 (server version). The VPL plugin version in our Moodle server is 3.3.4 and our Moodle server version is 3.7.1.  We used the self-signed certificate option.

We're experiencing intermittent problems with running and/or evaluating (or batch evaluating) student submissions.  In particular, we quite often do not get the prompt to accept the self-signed certificates when running or evaluating student submissions.  Please see attached screenshots.

What/where could we check to try to fix this problem?
Attachment firefox-no-prompt-to-accept-certificate.png
Attachment firefox-prompt-to-accept-certificate.png
In reply to Technical Services Office ADDU

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Try increasing the jail execution server log level and reviewing the messages.

I will try to reproduce the problem.

Best regards Juan Carlos
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Technical Services Office ADDU -
I have set LOGLEVEL to 5. Is this enough?

I will also have to wait for the faculty (and students) to use the VPL system so that I can get the logs after the LOGLEVEL setting was changed. I hope to get log data tomorrow.
In reply to Technical Services Office ADDU

Re: New Virtual Programming Lab (VPL) module

by Technical Services Office ADDU -
I got the following from /var/log/syslog this morning

Aug 30 08:15:30 vpl vpl-jail-system[6092]: Error in SSL accept SSL_ERROR_SSL error:14094412:SSL routines:ssl3_read_bytes:sslv3 alert bad certificate
Aug 30 08:15:31 vpl vpl-jail-system[6143]: Error in SSL accept SSL_ERROR_SSL error:14094412:SSL routines:ssl3_read_bytes:sslv3 alert bad certificate
Aug 30 08:15:31 vpl vpl-jail-system[6144]: Error in SSL accept SSL_ERROR_SSL error:14094412:SSL routines:ssl3_read_bytes:sslv3 alert bad certificate
In reply to Technical Services Office ADDU

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
After googling the message, I think that if the system works for some clients and not for other may be that some of your clients have a date that lets it think that the server certificate is invalid. If the problem happens on all the clients review your server certificate. If you are using a self-signed certificate, please remove it and lets the VPL installer create a new one.

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Technical Services Office ADDU -
All our computers are configured to use the same NTP server. I did not see dates that could be the cause of such problem.

BTW, is it possible to use wildcard certificate from trusted certificate authority (f.ex.: GoDaddy, Verisign) for the vpl-jail-server?
In reply to Technical Services Office ADDU

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Are you using a self-signed certificate or one signed by a certificate authority? Notice that new versions of vpl-jail-server require SSL keys with a minimum size of 2048. If you are using self-signed certificate please create a new one.

Yes, you can use certificates with a wildcard.

Best regards,
Juan Carlos.

In reply to Technical Services Office ADDU

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

We have found and fixes an important bug that may be causing your problem.

It is recommended that all users with versions 2.3.1 and higher update the jail server software to the new 2.4.2 version.


https://vpl.dis.ulpgc.es/index.php/home/download


Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Yassine Abid -

Hello Juan Carlos,

We installed vpl-jail-system version 2.4.2 on our server running on Ubuntu 16.04 and we have an issue that it shows site can't be reached when many users are trying to connect simultaneously as you can see in the screenshot below, but it works fine when it's one or two users.



Even after the upgrade from version 2.4.1 to 2.4.2 didn't help.
We're using the self-signed certificate option provided by vpl-jail-system but it doesn't work 
I checked the "Accept self-signed certificates" from the moodle site configuration. 

we are running it on Moodle 3.7.1, and PHP 7.1.
Here is my vpl-jail-system.config file :  

#JAILPATH set the jail path

JAILPATH=/jail

#MIN_PRISONER_UGID set start first user id for prisoners

MIN_PRISONER_UGID=10000

#MIN_PRISONER_UGID set the last user id for prisoners

MAX_PRISONER_UGID=20000


#MAXTIME set the maximum time for a request in seconds

MAXTIME=18000


#Maximum file size in bytes

#MAXFILESIZE=64000000


#Maximum memory size in bytes

#MAXMEMORY=200000000

#Maximum number of process

#MAXPROCESSES=1000

#Path to control directory. the system save here information of request in progress

#CONTROLPATH="/var/vpl-jail-system"

#Limit the servers from we accept a request

#IP or net (type A, B and C) separate with spaces

#Format IP: full dot notation. Example: 128.122.11.22

#Format net: dot notation ending with dot. Example: 10.1.

#TASK_ONLY_FROM=10.10.3.

#To serve only to one interface of your system

#INTERFACE=128.1.1.1

#Socket port number to listen for connections (http: and wssmile

#default 80

PORT=80

#Socket port number to listen for secure connections (https: and wsssmile

#default 443

SECURE_PORT=443


#URL path for task request

#act as a password, if no matches with the path of the request then it's rejected

URLPATH=/vpl

#FIREWALL=0|1|2|3|4

#0: No firewall

#1: VPL service+DNS+internet access

#2: VPL service+DNS+Limit Internet to port 80 (super user unlimited)

#3: VPL service+No external access (super user unlimited)

#4: VPL service+No external access

#Note: In level 4 stop vpl-jail-system service to update/upgrade the system

#Note: Don not use in CentOS

#default level 0

FIREWALL=0

#ENVPATH is environment PATH var set when running tasks

#IMPORTANT: If you are using RedHat or derived OSes you must set this parameter to the

#PATH environment variable of common users (not root) example

#ENVPATH=/usr/bin:/bin


#LOGLEVEL is the log level of the program

#From 0 to 8. 0 minimum log to 8 maximum log and don't removes prisoners home dir.

#IMPORTANT: Do not use high loglevel in production servers, you will get pour performance

#default level 3

LOGLEVEL=3


#USETMPFS This switch allows the use of the tmpfs for "/home" and the "/dev/shm" directories

#Changes this switch to "false" can degrade the performance of the jail system .

#To deactivate set USETMPFS=false

#USETMPFS=true


#HOMESIZE The size of the "/home" directory the default value is 30% of the system memory

#This option is applicable if using tmpfs file system for the "/home" directory

#HOMESIZE=30%


#SHMSIZE The size of the "/dev/shm" directory he default value is 30% of the system memory

#This option is applicable if using tmpfs file system for the "/dev/shm" directory

#SHMSIZE=30%

#ALLOWSUID This switch allows the execution of programs with a suid bit inside the jail.

#This may be a security threat, use at your own risk. To activate set ALLOWSUID=true

#ALLOWSUID=false

In reply to Vardhan W

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hi Vardhan,
- The number of directories under home directory must no be larger than the number of users in your Moodle. For each new task of a user, the plugin ask to remove the previos one if any.

- Stopping the service will affect the tasks/executions in process.
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Garth Brady -

Greetings Juan,

Is VPL Moodle 3.7 compatible?  Would we download directly from github?

In reply to Garth Brady

Re: New Virtual Programming Lab (VPL) module

by Garth Brady -
I'm seeing a full-screen display bug with Moodle's default Boost theme in moodle 3.7. Once a user clicks fullscreen, they can't minimize... See attached.
Attachment vpl-fullscreen-bug.png
In reply to Garth Brady

Re: New Virtual Programming Lab (VPL) module

by Garth Brady -
My mistake... I downloaded the Git Master, not 3.3.5. All is well, sorry for the trouble!
In reply to Juan Carlos Rodríguez-del-Pino

Re: [BUG] in Activity Completion

by Garth Brady -
Situation:
VPL Activity is set to:
  • Grade Setting: No
  • Evaluate: Yes
  • Activity completion: Student must receive a grade to complete the activity

So, what I'd like is that a student automatically receives a checkmark in Activity Completion when a student has clicked 'Evaluate'.  However, I understand that Moodle's Activity Completion is looking for a grade, when no grade is required.  Perhaps an additional setting where Activity Completion is like a Quiz where a student must receive a passing grade in order to have it marked auto-complete.

Regardless, when using the settings above, the following error returns when clicking 'Save and Display' in the VPL activity settings.


Attachment vpl-ActivityCompletion-Error.PNG
Attachment vpl-activityCompletion.PNG
In reply to Garth Brady

Url path not found

by Phil Saunders -
Hi,

I have installed vpl-jail-system-2.5.0 on a local Debian VM to try it out. When I test it by visiting http://IP_ADDRESS:PORT/OK in my web browser, it works OK, but when I visit http://IP_ADDRESS:PORT/VPL (URLPATH=/VPL in /etc/vpl/vpl-jail-system.conf) it fails with the error:

Not found. Url path not found '/VPL'

Do I need to create the 'VPL' directory somewhere?

Does anyone have any suggestions please?
In reply to Phil Saunders

Re: Url path not found

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Phil.
It seems that your system is installed and running. You don't need to create any directory. The URLPATH parameter acts as a password to your server. If your server receives a task request without the correct URLPATH, the request is rejected. The server expects an HTTP POST method with the correct URLPATH and containing an XML-RPC request. In this case, your request with the browser is an HTTP GET method and the server responds with an HTTP 404 not found.

Notice that the URL (http://IP_ADDRESS:PORT/VPL) is to be used in your VPL plugin general configuration at your Moodle (as admin).

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: Url path not found

by Phil Saunders -
Hi Juan,

I had assumed I should get a response when testing this URL in the browser in the same way as I do when I test http://IP_ADDRESS:PORT/OK. I hadn't realised it only worked with the HTTP POST method. I have now got it working with the Moodle plugin.

Thanks for your help.
In reply to Juan Carlos Rodríguez-del-Pino

Issue with files updating properly

by Stewart Carswell -

Hello,

I have a VPL activity set up in Moodle, and I'm adding the scripts to assess and grade the assignments on a separate server. However, when I copy updated scripts to the server (using rsync or scp), I'm not seeing the files within Moodle. 

If I add "ls -l /my/example/assessment" to vpl_evaluate.sh and evaluate it, I get a different output compared with when I ssh to the server and run ls -l /my/example/assessment.

Also, when I installed a new package on the server, it was not seen from the VPL activity in Moodle. I restarted the server and I could then see the updated files and packages from Moodle, but I don't want to be restarting the server each time I make a change.

Can you help me diagnose the problem? Is there some caching issue going on somewhere?

In reply to Stewart Carswell

Re: Issue with files updating properly

by Stewart Carswell -
I'm using vpl jail system 2.3.1. I've done some digging into this, and the issue may be with overlayfs not updating the files in /jail. Is there a way to force it to update them?
In reply to Stewart Carswell

Re: Issue with files updating properly

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hi Stewart,

I will try to answer your questions.

About your first question: I don't know from where to where are you transferring the scripts and the cause of the problem you describe. Notice that Moodle and VPL information is based on a DB. In any case, If you want to transfer files (scripts or other types) from an external source to VPL the easy way is going to the execution files and drop it there.

If you are working with scripts notice that you may need the use of "files to keep when running" option.

If you are working with multiple VPL activities that use common scripts or other files the use of the "based on" at "Execution options" can easily your work.


About your second question: I think that you are referring to the installation of packages on your execution server (jail-server). From version 2.3 of the Vpl-jail-system, it is not strictly necessary to restart the service after installing or updating any packages, but in some case, it may be needed to restart the vpl-jail-system to update the change into the jail. In any case, you don't need to restart the machine.

systemctl restart vpl-jail-system

Best regards,
Juan Carlos.
In reply to Juan Carlos Rodríguez-del-Pino

Re: Issue with files updating properly

by Stewart Carswell -

Hi Juan Carlos, thanks for getting back to me.

The first question is about the vpl-jail server as well. The issue is with copying files onto the vpl jail server from a local machine. For example, assessment scripts, to be called by vpl_evaluate.sh from Moodle. We save these on the execution server in the directory /usr/share/vplscripts. However, if a file is edited locally and then copied onto the server again, the change does not propagate into /jail/usr/share/vplscripts unless the system is restarted. Is there a way to get overlayfs to update the files in /jail automatically, or whenever it detects a change, or periodically?

The second question is similar, we are not seeing new packages added under /jail after they are installed. You said in your reply "but in some case, it may be needed to restart the vpl-jail-system to update the change into the jail." Can you elaborate on which cases it may be necessary please?

Many thanks, Stewart

In reply to Stewart Carswell

Re: Issue with files updating properly

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

It seems that overlayFS (or the kernel, not clear for me), caches access to the underlying filesystem (lowerdir). This behaviour affects especially to the content of the files and internally to the permissions of files.
The tests show that if the content or the access mode of a file in the underlying file system change after been accessed by the overlayFS, overlayFS still show the previous content. This behaviour seems to no effect on new files.

The problem can be resolved without restarting the server or the service, but paying a temporal performance cost. The solution is using the file /proc/sys/vm/drop_caches.

After changing files in the underlying file system (installing/updating packages or modifying files), as root, you may use the following command to do the overlyFS be aware of the changes

sync; echo 7 > /proc/sys/vm/drop_caches

This will do the kernel to drop the caches. For a while, the file system will be slower until the system recaches common used data.
For more details see https://www.kernel.org/doc/Documentation/sysctl/vm.txt.

About the effect on the jail of installing packages in the host and with this tested behaviour, I must change my previous affirmation saying that always is better to restart the service or drop caches.

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Frank Neumann -
Hi Juan Carlos,

today I realized that our students do not see the "Execution" window with the useful output from the unit tests in their "Edit" environment. Is there a setting to make the "Execution" window available to them as it is today available for teachers?

Many thanks,

Frank (HTW Berlin)

P.S.: I held two workshops on VPL for other professors here at HTW Berlin. Overall the feedback is very good: Our collegues use it now for C, C#, Java, Python and Mathlab. Many thanks from all of us for your great work!
In reply to Frank Neumann

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hi Frank,
I guess that you are using a custom evaluation script (If my guess is wrong, let me know). The "execution" tab is the raw output of the evaluation. This output is shown to the teachers to check the output processing. There is no switch to show this output to the students. If you want to show it to the students you must adjust the raw output to be processed properly. If you want to show all the output content to the students you must add start and end output marks to the evaluation script. E.g.
echo "<|--"
Your current script.
echo "\n--|>"
The output will be shown in the "comments" tab.
Best regards,
Juan Carlos

P.S.: You are welcome. It is good to know that our effort is valued.



In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Frank Neumann -

Hi Juan Carlos,

I added the suggested statements to my script, but no comments tab is showing up.

Here the screenshot:


And my script:

#!/bin/bash
# This file is part of VPL for Moodle - http://vpl.dis.ulpgc.es/
# Script for running C# language
# Copyright (C) 2014 Juan Carlos Rodríguez-del-Pino
# License http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
# Author Juan Carlos Rodríguez-del-Pino <jcrodriguez@dis.ulpgc.es>

# @vpl_script_description Using csc
# load common script and check programs
. common_script.sh
check_program csc
check_program mono
if [ "$1" == "version" ] ; then
    echo "#!/bin/bash" > vpl_execution
    echo "csc --version" >> vpl_execution
    chmod +x vpl_execution
    exit
fi
get_source_files cs
# compile
export MONO_ENV_OPTIONS=--gc=sgen
csc -target:library -out:output.dll -lib:/usr/lib/mono -r:/usr/share/NUnit.3.10.1/lib/net45/nunit.framework.dll $SOURCE_FILES
# make sure to copy the nunit.framework.dll to the same directory as output.dll
cp -f /usr/share/NUnit.3.10.1/lib/net45/nunit.framework.dll .
if [ -f output.dll ] ; then
    cat common_script.sh > vpl_execution
    # use the nunit console runner to determine the test results
    export NUNIT_OUTPUT=$(mono /usr/share/NUnit.ConsoleRunner.3.8.0/tools/nunit3-console.exe output.dll -noresult --framework:mono-4.0 --noheader)
    echo "echo '$NUNIT_OUTPUT'" >> vpl_execution
    # show the nunit results in the comment tab
    echo "Comment :=>> NUnit results:"
    echo "<|--"
    echo "$NUNIT_OUTPUT"
    echo "--|>"
    # use gawk to parse the nunit test results
    test_count=$(echo $NUNIT_OUTPUT | gawk 'match($0,/Test Count: ([0-9]*)/, a) {print a[1]}')
    passed_count=$(echo $NUNIT_OUTPUT | gawk 'match($0,/Passed: ([0-9]*)/, a) {print a[1]}')
    # calculate the grading
    if [ $test_count -gt 0 ] ; then
        export GRADE=$(awk "BEGIN {printf \"%.2f\",$VPL_GRADEMAX*$passed_count/$test_count"})
        echo "echo 'Grade :=>>$GRADE'" >> vpl_execution
    else
        echo "echo 'Grade :=>>$VPL_GRADEMIN'" >> vpl_execution
    fi
    chmod +x vpl_execution
fi

Do you have any suggestions?

Regards,

Frank

In reply to Frank Neumann

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hi Frank,

the problem is that the code must be at your vpl execution script also your script is doing the evaluation in the compilation stage. I think it is better to move the evaluation to the execution stage.

Please check this new version of your code. I don't have your NUnit version then the code is not fully tested.
Please, let me know if this does not solve your problem.

#!/bin/bash
# This file is part of VPL for Moodle - http://vpl.dis.ulpgc.es/
# Script for running C# language
# Copyright (C) 2014 Juan Carlos Rodríguez-del-Pino
# License http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
# Author Juan Carlos Rodríguez-del-Pino <jcrodriguez@dis.ulpgc.es>

# load common script and check programs
. common_script.sh
check_program mono
check_program csc mcs
get_source_files cs
# compile
export MONO_ENV_OPTIONS=--gc=sgen
$PROGRAM -target:library -out:output.dll -lib:/usr/lib/mono -r:/usr/share/NUnit.3.10.1/lib/net45/nunit.framework.dll $SOURCE_FILES
# make sure to copy the nunit.framework.dll to the same directory as output.dll
cp -f /usr/share/NUnit.3.10.1/lib/net45/nunit.framework.dll .
if [ -f output.dll ] ; then
    cat common_script.sh > vpl_execution
    cat >> vpl_execution <<'END_OF_SCRIPT'
# use the nunit console runner to determine the test results
export NUNIT_OUTPUT=$(mono /usr/share/NUnit.ConsoleRunner.3.8.0/tools/nunit3-console.exe output.dll -noresult --framework:mono-4.0 --noheader)
# show the nunit results in the comment tab
echo "<|--"
echo "-NUnit results" echo "$NUNIT_OUTPUT"
echo
echo "--|>"
# use gawk to parse the nunit test results
test_count=$(echo $NUNIT_OUTPUT | gawk 'match($0,/Test Count: ([0-9]*)/, a) {print a[1]}')
passed_count=$(echo $NUNIT_OUTPUT | gawk 'match($0,/Passed: ([0-9]*)/, a) {print a[1]}')
# calculate the grading
if [ $test_count -gt 0 ] ; then
   export GRADE=$(awk "BEGIN {printf \"%.2f\",$VPL_GRADEMAX*$passed_count/$test_count"})
   echo "Grade :=>>$GRADE"
else
   echo "Grade :=>>$VPL_GRADEMIN"
fi
END_OF_SCRIPT
   chmod +x vpl_execution
fi
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Frank Neumann -

Hi Juan Carlos,

many thanks - that works perfectly.

Regards,

Frank

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Анна Красногорская -

Good evening. Thank you very much for the program. Is it possible to hide test data from students when testing programs automatically?

In reply to Анна Красногорская

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Анна,
To avoid showing the tested values and the student's program output, you must add a "Fail message". If the case fails only the "fail message" is shown. It is recommended to use cases that "showing" and "not showing" values used for each "equivalence class" of the tests.

Best regards,
Juan Carlos.

Attachment Captura.JPG
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Axel Hinek -
Hello Juan Carlos,

I´m a teacher in a professional school in germany and want you to thank for the amazing VPL! My first steps are done but now i need some help because of a problem running the VPL-Jail-Server with apache as a virtual host. My first approach was running the VPL-Jail-Server with port-forwarding (ports 81 and 444) and it was working fine but because of restrictions of the firewall rules in my school, i need to run the Jail-Server with the standard ports 80 and 443. So i decided to run the VPL-Jail-Server as a virtual host.

The URL of the VPL-Jail-Server is "hnk-code.dynv6.net" and the browser tests are working properly (http://hnk-code.dynv6.net:80/ok and https://hnk-code.dynv6.net:443/ok).
I configured the Jail-Server in the VPL-Plugin and i think´ve done it right (https://hnk-code.dynv6.net:443/the-secret).

But when running a programm there appears this error message:
"You are using an encrypted connection.
To use an encrypted connection with the execution servers it is required you accept its certificates.
If you have problems with this process, you can try to use a http (unencrypted) connection or other browser.
Please, click on the following links (server #) and accept the offered certificate.
Server 10"

The certificate for the domain "hnk-code.dynv6.net" are on both machines (the moodle-machine with apache and the VPL-Jail-machine). Do you know how i can make it run?

Here ist the apache config for port 80
ServerName hnk-code.dynv6.net

ProxyPass / http://192.168.0.214/
ProxyPassReverse / http://192.168.0.214/

And this is the apache config for port 443
ServerName hnk-code.dynv6.net

SSLProxyEngine On

ProxyPass / http://192.168.0.214/
ProxyPassReverse / https://192.168.0.214/

SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/hnk-code.dynv6.net/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/hnk-code.dynv6.net/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
Thank you very much and best regards,
Axel
In reply to Axel Hinek

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Axel,
I must say that I am not an expert in the apache2 configuration.
After googling, it seems that your problem is related to WebSocket and you need the following:
1. Activate the Apache Module mod_proxy_wstunnel.
2. Rewrite the URL when the connection is WebSocket.

The rewrite must be based on HTTP headers

  RewriteEngine on
  RewriteCond ${HTTP:Upgrade} websocket [NC]
  RewriteCond ${HTTP:Connection} upgrade [NC]
  RewriteRule .* "ws://192.168.0.214/$1" [P,L]

As you are using a local connexion I think you don't need to proxy to a secure (SSL) connection (https/Wss). Then your jail-server don't need to have a real Certificate.

Notice: I must say I haven't tested this configuration.

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Axel Hinek -
Hi Juan Carlos,

thank you for your reply and the advice of configurating the websocket protocol.

After a few attempts i got it working with:

ProxyPass "/ws/" "ws://192.168.0.214:80/"
ProxyPassReverse "/ws/" "ws://192.168.0.214:80/"
ProxyPass "/" "http://192.168.0.214:80/"
ProxyPassReverse "/" "http://192.168.0.214:80/"


Thank you very much and best regards,
Axel
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Андрей Никулеско -

Hello, we are creating a vpl activity for students. How can we install and configure our own vpl-jail-server 3.x? Thank you for attention!

In reply to Андрей Никулеско

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hi Андрей,
You need to install the vpl-jail-server, the last version is the v2.5.2.
Download from https://vpl.dis.ulpgc.es/releases/vpl-jail-system-2.5.2.tar.gz

For installation see
https://vpl.dis.ulpgc.es/index.php/home/news/83-release-of-vpljail2-5-2

For details about the configuration, see
https://vpl.dis.ulpgc.es/index.php/support/2014-09-27-15-06-22/66-execution-server-configuration

Best regards,
Juan Carlos.
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Sebastian H. -
Picture of Testers

Hello Juan Carlos,

thank you for contributing this plugin which is used by a growing number of professors at our university.

There is one issue a professor asked for assistance - comments that are returned to students are not displayed in the comments area when containing new lines \n in the "edit submission" view.

Is there a workaround? Everything's fine in the execution window, but that's not shown to students.

Any help is appreciated.

Best regards

Sebastian

In reply to Sebastian H.

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Sebastian.

How can I reproduce the problem?

Please, show me more detailed (screenshots, etc.) information about the problem to search for a solution.

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Vardhan W -
Hi,

I am facing an issue since the past few days which I am unable to resolve. My configuration: Moodle 3.7, VPL 2.3.1.
When evaluating a submission there is often a server error saying that there was a problem in creating prisoner directory in /tmp. I suspected disk full, but / is at 67% (see the df output below). I usually restart the vpl-jail-system service and it seems to work.

However I noticed the following: in /var/vpl-jail-system a lot of temporary user directories (p*) are being created at a time. I have configured MIN/MAX_PRISONER_UGID to 10000 and 20000, and I see that almost 10000 temporary directories are created in short duration, most of (all?) which are empty. (Note: earlier I had set the loglevel to 8 but I read that with loglevel 8 the temporary directories may not be deleted (ever?) so I reset it to level 6 now. Also I have set USETMPFS to false as we have only 4 GB RAM.) I created a cron job to just delete all temporary directories (p*) periodically, but the issue seems to persist. I don't understand where the problem of creating a sub-directory in /tmp comes up. Are there other locations where VPL may be creating such excess resources which we need to monitor?

Our system is being used by not more than 30-40 students each day.

Can you please help in this as I could not get a ready answer from google or on this forum.

$ df -k
Filesystem 1K-blocks Used Available Use% Mounted on
udev 8210656 0 8210656 0% /dev
tmpfs 1643224 160924 1482300 10% /run
/dev/sda2 6103168 3820396 1953048 67% /
tmpfs 8216104 0 8216104 0% /dev/shm
tmpfs 5120 0 5120 0% /run/lock
tmpfs 8216104 0 8216104 0% /sys/fs/cgroup
/dev/sda1 236876 28219 192120 13% /boot
/dev/sda3 14100300 1287736 12073452 10% /var
overlay 14100300 1287736 12073452 10% /jail
tmpfs 1643224 0 1643224 0% /run/user/0

thanks,
In reply to Vardhan W

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Vardhan,
This is a known problem of the v2.3.X versions.  You can resolve the issue by installing a higher version.
https://vpl.dis.ulpgc.es/index.php/home/download
See releases notes at the end of the article announcing the 2.5 version:
https://vpl.dis.ulpgc.es/index.php/home/news/83-release-of-vpljail2-5-2

If you are using a VPL log level greater than 3, the logs may be a waste of disk space.

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by babu M -

Dear juan Carlos Rodriguez-del-Pino,

I got a problem when i was installed VPL ...

Once my VPL installation completed i tried to start vpl jail system using this command

sudo service vpl-jail-system start

But

I could not start vpl-jail-system properly...

I got this problem

Job for vpl-jail-system.service failed because the control process exited with error code.
See "systemctl status vpl-jail-system.service" and "journalctl -xe" for details.

I tried many times vpl-jail-system to install...

Same problem will come..

Help me to move on...

Also I cant Uninstall VPL properly....

What is the steps to follow to UNINSTALL VPL to ReInstall VPL....


Thanks & Regards,

M.Babu




Attachment Screenshot from 2019-11-22 10-36-51.png
In reply to babu M

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Mabu,
I guess you are installing vpl-jail-system 2.5.2.
Please, use "sudo systemctl start vpl-jail-system" to start the service
To see the log and try to spot a problem use
"sudo systemctl status vpl-jail-system" or
"sudo cat /var/log/syslog | grep vpl" or
"sudo less /etc/vpl/vpl-jail-service.log" to see the start/stop log

To fully remove vpl-jail-system, use as root

systemctl stop vpl-jail-system
systemctl disable vpl-jail-system
rm /etc/systemd/system/vpl-jail-system*
systemctl daemon-reload
systemctl reset-failed
rm -Rf /etc/vpl
rm -Rf /vpl/vpl-jail-system
rm -Rf /jail
#If exists
rm /etc/init.d/vpl-jail-system*


Best regards,
Juan Carlos

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by babu M -
Thank you .... I got it ... Thanks for your timing help....



Thanks & Regards

M.Babu



On Nov 22, 2019 7:36 PM, "Juan Carlos Rodríguez-del-Pino (via Moodle.org)" <
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Vardhan W -
Hi Juan,

I upgraded to the latest 2.5.2 jail version. But after a day I am facing the same issue. When I submit for evaluation I get an error saying: "Server execution error http error internal server errorI can't create prisoner home dir". 
The other settings are the same as above and I have reduced the log level to 3 (default).
I don't see many directories in /var/vpl-jail-system now.

vpl error screenshot

Any ideas?
In reply to Vardhan W

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hi Vardhan,
It seems that you have a problem that has not been reported before.
The error message is generic and may be caused by different reasons.
I 'll add to the TODO list to show the specific error.

have you checked why the jail-system can not create a new directory at /jail/home?
This information will help to spot the problem.
As you report in previous messages you have a range of 10000 users and 40 users a day, what type of task are the users doing?

Best regards,
Juan Carlos.
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Vardhan W -
Hi Juan,
As I mentioned the plugin seems to create a lot of temporary user files in /var/vpl-jail-system after which I get these errors (another error than above is that it is unable to create files under /tmp). If I manually delete these files and restart the service, it seems to be back up for some time before regressing. I have attached a text log of the list of directories created. All of these are empty and are being created in bulk at a time. My config file has only these settings:
JAILPATH=/jail
MIN_PRISONER_UGID=10000
MAX_PRISONER_UGID=20000
MAXTIME=1800
URLPATH=/
FIREWALL=0
LOGLEVEL=3

> have you checked why the jail-system can not create a new directory at /jail/home?
This happens only sometimes when the above issue (multiple directories) happens (I think). How do you suggest I check for the issue? If I am able to create a temporary directory in /jail/home as root while the issue is there, is that good information?

thanks,
-Vardhan
In reply to Vardhan W

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Vardhan,
The content of vpl-issue.txt indicate that:
- At Nov 26 08:20 the vpl-jail-system created 965 home dirs, more than 16 per second
- At Nov 26 08:22 the vpl-jail-system created 1698 home dirs, more than 28 per second
- At Nov 26 08:54 the vpl-jail-system created 714 home dirs, more than 11 per second
These symptoms give two possibilities:
- We are facing a race condition (bug) that make the system create so many home dirs without need.
- You are suffering some kind of DoS attack.

To address the first problem and help to spot better what is happening. We are improving and adding messages to the logic that creates the home dirs. Please check the version https://vpl.dis.ulpgc.es/releases/vpl-jail-system-2.5.3.beta.tar.gz
To address the possible DoS attack, you can review the logs to see if you have received so many requests. In that case, use the parameters TASK_ONLY_FROM, JAILPATH, and FAIL2BAN to protect your server adequately.

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Vardhan W -
Hi,

Thanks for the new beta, I will test it out. I notice the following in the current log for each time it is creating many directories e.g.:
2019-12-03 11:05:58 jailz01 vpl-jail-system[9588]: err: Exists home dir without control dir
2019-12-03 11:05:58 jailz01 vpl-jail-system[9588]: err: message repeated 888 times: [Exists home dir without control dir]
2019-12-03 11:05:58 jailz01 vpl-jail-system[9588]: err: 10.1.6.79:I can't create prisoner home dir

Also, the time that is happens seems to coincide with some activities (submission, evaluation) by the users.
There doesn't seem to be any DDOS kind of possibility - it is running on an internal network.

thanks,
-Vardhan
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Frank Neumann -
Hi Juan Carlos,

for a VPL activity in C# I need the following JSON parser as external component: Newtonsoft.Json.dll (this is a .NET assembly)

I added this one under "Execution files" and marked it as to be kept when running.

Unfortuantely the compiler gives me the following error:

error CS0009: Metadata file '/home/p14491/Newtonsoft.Json.dll' could not be opened -- PE image doesn't contain managed metadata.

I assume that VPL is not treating the Dll as binary data, i.e. that the Dll is somehow modified by VPL.
I had a similar case in Java where the JAR file was added the same way, but the compilation worked perfectly.

What is your recommendation for my use case?

Best regards,

Frank
In reply to Frank Neumann

Re: New Virtual Programming Lab (VPL) module

by Frank Neumann -

...I figured it out: When I use Base64 Encoding through the b64 extension it works fine.

JAR seems to be a special case.

Regards,

Frank

In reply to Frank Neumann

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hi Frank,
I have added "dll" extension to the list of extensions of binary files. For other extensions not in the list, the correct solution is to convert it to base64.

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Naveendurai K -

Hi 

Is there any way to add numpy and pandas  module for python course in vpl.


In reply to Naveendurai K

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi, Naveendurai.
You must install the proper packages in your jail servers.
For Ubuntu, you can use the following commands:

sudo apt-get install python3-numpy python3-pandas
sudo systemctl restart vpl-jail-system


These commands will install the Python 3 version of Numpy and pandas. If you want the Python 2, remove the "3" from the package names.


I have added

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Naveendurai K -
thank you juan .Is there any way to run a JDBC program .how to add JDBC jar

files and make it work



On Tue, Dec 17, 2019 at 4:02 PM Juan Carlos Rodríguez-del-Pino (via
In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Frank Neumann -

Hi Juan Carlos,

thank you.

Best regards,

Frank

In reply to Juan Carlos Rodríguez-del-Pino

cancelprocess and its importance

by Prakash Raju -

Hi Juan,

Greetings from India.

We've been using VPL with moodle for almost 3 years now in our college. College students take up the programming assessments using VPL. Once the assessments are over, we will change the test cases, go to submissions tab and evaluate all the submissions. 

Now the problem is that,  while we evaluate the assessment programs, students can simultaneously work other practice programs. Hence when any user evaluates his program at the same time we evaluate his submission, either one of the evaluation stops midway. Many times this had lead to confusions in assessment grades too..

We tried to dig the code and it looks like the function cancelprocess() gets invoked which cancels the previously executing program of a user. We thought we will comment run() function invoking cancelprocess(), but we do not know the implications of it.

I would like to understand the best way to handle this scenario. Can we remove invocation of cancelprocess() in run() method and have a reasonable max execution time limit at the jail server? Or is there any better approaches..? Please help

Regards,

Prakash Raju

In reply to Prakash Raju

Re: cancelprocess and its importance

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Prakash Raju,
After reviewing the issue, it is tagged as a bug.
The removal of the cancelProcess() method will not resolve the issue, it will make the problem worse.
We will try to resolve the issue as soon as possible.

Best regards,
Juan Carlos.


In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Erick Purwanto -
Hi Juan Carlos,

Is there a way put restrictions on student's code submission?
(not just based on test cases correctness)

For example, on Java Recursion questions,
where we want to reject/penalize student's code that uses loops?


Thank you!
Best regards,
Erick
In reply to Erick Purwanto

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Erick,
VPL does not has this feature. But if you have a way to detect this situation (the use of loops or the lack of recursion) you can integrate it with the input/output test by usign the instruction  "program to run =" and "program argumenes=".

Best regards,
Juan Carlos.

In reply to Juan Carlos Rodríguez-del-Pino

Re: New Virtual Programming Lab (VPL) module

by Davide Gavagnin -

Dear Sir,

I'm a moodle manager/mainteiner, I've received the request to compile source code from VPL activities in c++ v11. I've read a topic about this in problem in the forum, the solution proposed is to modify cpp_run.sh from the plugin source files, or add an hidden activity with a script attacched.

Well, the problems are: 

any mod to the cpp_run.sh file will be overwritten by each plugin upgrade. 
when I tell to teacher to create the activity with the script attacched, He answers me that, with that script, all programs submitted will be compiled by c++ despite the file extension.

I've also see that in the jail/default_scripts there's some additional scripts like cpp-11_run.sh ... how can I use this configuration? rename it to cpp_run.sh is the only way?

How can I manage this mod?

thanks.

In reply to Davide Gavagnin

Re: New Virtual Programming Lab (VPL) module

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Dear Davide,
form VPL 3.3.2 you can select the use of different versions of C++. To do so, go to the "Execution options" and change the option "Run script" from "Autodetect" to "CPP-11: Using g++ C++11 ISO ..".
Notice also that:
1) You need a proper C++ compiler (g++) at the execution server.
2) The default C++ script uses the default compiler version of C++.
3) The full implementation of the C++11 ISO standard using GNU-g++ is from GCC 4.8.1.

Best regards,
Juan Carlos.
Attachment capture.png
In reply to Juan Carlos Rodríguez-del-Pino

Re: Archived posts, use them to search

by Alaukik Kotecha -

root@ip-172-31-32-82:/home/ubuntu# sudo wget http://vpl.dis.ulpgc.es/releases/vpl_jail_system-2.5.3.tar.gz

--2020-05-29 03:06:08--  http://vpl.dis.ulpgc.es/releases/vpl_jail_system-2.5.3.tar.gz

Resolving vpl.dis.ulpgc.es (vpl.dis.ulpgc.es)... 193.145.147.130

Connecting to vpl.dis.ulpgc.es (vpl.dis.ulpgc.es)|193.145.147.130|:80... connected.

HTTP request sent, awaiting response... 404 Not Found

2020-05-29 03:06:08 ERROR 404: Not Found.




please help me what to do

In reply to Alaukik Kotecha

Re: Archived posts, use them to search

by Juan Carlos Rodríguez-del-Pino -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Dear Alukik Kotecha,
the correct URL is
https://vpl.dis.ulpgc.es/releases/vpl-jail-system-2.5.3.tar.gz

Notice that we use "-" (minus sign, hyphen) and not "_" (spacing underscore, low line, horizontal bar)

Please, tell me where you found this incorrect URL to try to fix then.

Best regards,
Juan Carlos.
P.D. Please don't use this thread to post new questions. Please, post new questions at https://moodle.org/mod/forum/view.php?f=1288
In reply to Juan Carlos Rodríguez-del-Pino

Re: Archived posts, use them to search

by Naveendurai K -
Hai Juan
We need suggestions for the following:
1.while accessing moodle VPL from mobile ,we are not able to get the input to the console window ,as mobile keypad is not allowed to type in the console(We tried using virtual keypad in console window of VPL).plz suggest on it for mobile users
2.We tried to use Spring core,JDBC.Any ways to add jar files
3.Any plans of adding multi language drop downs for selection in VPL editor
4.How to autoevaluate Web programs like javascript,html,css,Servlets and jsp
5.So far we are running SQL courses using SQLite.But we prefer using Mysql/oracle how to test it ?
In reply to Juan Carlos Rodríguez-del-Pino

Re: Archived posts, use them to search

by Amita Chitroda -

I am unable to type in the answer area of the VPL Question, providing an error as enclosed

Moodle version is Moodle 3.8.4+ (Build: 20200717) Version 2019111804.02