How can I make VPL evaluations interactive with guessed wrong answers?

How can I make VPL evaluations interactive with guessed wrong answers?

by Visvanath Ratnaweera -
Number of replies: 4
Picture of Particularly helpful Moodlers Picture of Translators

How can I make VPL evaluations interactive with guessed wrong answers?

Here is a minimal example to explain what I mean:

- The students are supposed to write the ubiquitous helloworld.

- The expected output string is "Hello, World!"

- They are allowed to evaluate the answer  any number of times.

- During the evaluation I want to catch typical wrong outputs like "Hello World!", "Hello, world!", etc. and give them corresponding feedback, "Comma missing", "'World' should be written in uppercase", etc.

How can I achieve that? My first thought was the vpl_evaluate.cases file, but it is a list of correct cases, I found out.

First time user. Apologies if this is a FAQ. I did a forum search though, they are bewildering for a beginner. ;(

Edit: Is the VPL Question type the answer? That would be a vertical learning curve, since I want to put this to test the coming week!

Average of ratings: -
In reply to Visvanath Ratnaweera

Re: How can I make VPL evaluations interactive with guessed wrong answers?

by Astor Bizard -
Picture of Particularly helpful Moodlers Picture of Plugin developers
This should be achievable via execution files and advanced evaluation mechanisms.
VPL Questions act only as an interface between VPL activities and Quizzes, and use the same evaluation logic than VPL activities.
In reply to Astor Bizard

Re: How can I make VPL evaluations interactive with guessed wrong answers?

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi

That is what I expected.

Could you be more specific? Do you have pointers to tutorials, example, etc.?
In reply to Visvanath Ratnaweera

Re: How can I make VPL evaluations interactive with guessed wrong answers?

by Astor Bizard -
Picture of Particularly helpful Moodlers Picture of Plugin developers
I cannot find a detailed, public documentation for this...
So, here is a short explaination of what I know :D

The files that you will edit are the ones in Execution Files: vpl_run.sh (for Run action), vpl_debug.sh (for Debug action), vpl_evaluate.sh (for Evaluate action). It is possible to only edit some of them.

In your case, you only need to edit vpl_evaluate.sh
This script will be executed on any evaluation of this VPL activity.
Its goal is to generate an executable file named vpl_execution that will then be executed itself.
All files submitted by the user are available in the environment.

The vpl_execution file should write on standard output all information regarding the evaluation of the submitted code.
All files submitted by the user are still available in the environment.
There are several line formattings you should know about:
- A line starting with Grade :=>> followed by a grade will set the grade of this evaluation.
- A line starting with Comment :=>> will output a comment visible by the user.
- <|-- and --|> can be used to display multi-line comments.
- Within multiline comments, lines starting with - will be displayed as headings, lines starting with > will be displayed as pre-formatted text.

Dummy example for vpl_evaluate.sh contents:

  echo "echo Grade :=>> 100" > vpl_execution
  echo "echo Comment :=>> \"Well done!\"" >> vpl_execution
  chmod +x vpl_execution
  
Average of ratings: Useful (1)