Moodle VPL Tutorials

From dftwiki3
Revision as of 10:58, 19 September 2014 by Thiebaut (talk | contribs)
Jump to: navigation, search

--D. Thiebaut (talk) 11:51, 19 September 2014 (EDT)




The tutorials below are intended for instructors teaching programming languages, and interested in setting up Moodle VPL modules to automatically test student programs.
The modules are listed in chronological order, most recent at the end. Because VPL is a complex system to master, the early tutorials may not be built using the best approach, but provide functionality. The later modules use more sophisticated features of VPL.
Feel freel to send your own modules or discoveries to me, at dthiebaut@smith.edu, and I will be happy to include them here.



Moodle Virtual-Programming-Lab (VPL)

MoodleVPLLogo.png
Tutorial Language Description

Moodle/VPL Server Setup

 

This tutorial provides rough directions for setting up two virtual servers that will host Moodle on one of them, and the VPL jail server on the other. This setup is used by the tutorials below on the use of VPL to test student programs.

Moodle VPL Example 1: Hello World!

Python

This tutorial illustrates how to setup VPL to test a simple Python 3 program that prints the string "Hello World!" to the console.

Moodle VPL Example 2: Min of 3 Numbers

Python

This tutorial illustrates how to setup VPL to test a simple Python 3 program that receives 3 numbers from the console and prints the smallest of the 3. The program is tested 3 times, with 3 different sets of input numbers.

Moodle VPL Example 3: Rock-Paper-Scissors

Python

This tutorial shows the settings for a VPL activity that would test a Python program that plays the game of Rock-Paper-Scissors. The program tested is expected to get its input as pairs of letters (PP, RS, PS, etc), indicates the winner of each round, and stops when one player is 3 points above the other.

Moodle VPL Example 4: Gremlins in my File!

Python

This tutorial illustrates how to setup a VPL activity that tests a student program that reads a text file, modifies it, and stores the new content back in the original file. This requires an additional python program that sets up the environment for the first one to run, provides it the information it needs, and captures its output.

Moodle VPL Example 5: Print a 2D chessboard

Python

This tutorial illustrates how to setup a VPL activity that tests a student program that asks the user for an integer and then prints a 2D chessboard (alternating black & white cells) with that dimension. The size of a cell is a 3x3 character on the screen.

Moodle VPL Example 6: Display a rectangle of stars

Assembly
Nasm

This tutorial illustrates the setup of a VPL activity to test an assembly language program that displays a fixed string (rectangle of stars).

Moodle VPL Example 7: Assign a grade inversely proportional to the size of the executable

Assembly
Nasm

This tutorial illustrates how to setup a VPL activity that will test the size of the executable version of an assembly language program. This can easily be adapted to other languages.

Moodle VPL Example 8: A Hello World Program in Java

Java

This tutorial illustrates how to setup a VPL activity to test a simple Hello World program in Java.

Moodle VPL Example 9: A Multi-File Java Program with A Data File

Java

This tutorial illustrates the setting of a VPL activity that evaluates a 2-class Java project that gets its input from a data file. The project is tested with 4 different data files; one provided by the students, 3 provided by the instructor.

Moodle VPL Example 10: Evaluation Using A Custom Python Program

Python

This tutorial illustrates how to evaluate student work using a custom Python program. Such evaluation allows for more complex testing than enabled by the VPL .cases file.

Moodle VPL Example 11: Testing a Java Class Using another Class as Tester.

Java

This tutorial sets up an environment to test different methods of a Java class provided by the students, and uses a derived class provided by the instructor to activate the student classes.

Moodle VPL Example 12: Using a Java Tester for testing Student Java Program.

Java

This tutorial shows how to setup a more sophisticated testing environment for evaluating and grading Java program.

Tips & Tricks

 

A collection of notes, recommendations, tips, tricks, and modifications.