Archived posts, use them to search

Re: Selecting correct execution script

by Aivar Annamaa -
Number of replies: 1

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