jcrodriguez-dis / moodle-mod_vpl

Virtual Programming Lab for Moodle (Module)
GNU General Public License v3.0
100 stars 87 forks source link

Add test program for student #151

Open MickyOver opened 1 year ago

MickyOver commented 1 year ago

Coming from Student program test inside VPL questions:

"Currently, what I do with my students is assign them a task along with a brief description of the type of program I want them to code. Additionally, I provide them with an executable (.exe) file since we program in C/C++, which allows them to run the program and freely interact with it. Afterward, they attempt to replicate the program based on their interaction. I adopt this approach because there are many nuances that are easier to understand and observe through the executable program rather than through a description alone.

That's why I was wondering if there is a way for students to have an additional button, let's say a "Run" button, that executes my solution code (which would not be visible to them) and enables them to test the program as I mentioned earlier. The "Run" button was just an example; I would be open to any solution that achieves a similar result."

I would like to suggest incorporating the teacher's corrected code, which could be executed by the students to test the program.

Thank you for your attention and assistance."

jcrodriguez-dis commented 7 months ago

Dear MickyOver,

Thank you for sharing your approach and suggestion. Incorporating a feature that allows students to interact with an executable version of the solution code, without directly accessing the code itself, may be a valuable enhancement. As a workaround, I propose the use of the VPL activity type "Example."

Here's a simplified step-by-step guide to implement this solution:

  1. Create a VPL Activity: This activity will serve as a platform to run the solution code.
  2. Configure activity settings: in the "Submission Restrictions" section, enable the option “This activity acts as an example.”
  3. Prepare Requested Files: In the "Requested files" option, put at least one file of the type of the submission code (e.g. for Python “main.py”) but that do not contain the solution code; for example, they may contain comments with an explanation.
  4. Set Up Execution Files: Place the solution code files in the "Execution files" section. The solution files must use the same name than the “Requested files” (e.g. main.py). These files will never be shown to students but will be the executed code.
  5. For interpreted languages like Python, use the “Files to keep when running” option to avoid removing source files before the running stage. Note that in this case, code files may be reveal by the running program, Additionally, if the execution uses a GUI interface, the window manager can allow other programs to run, e.g., a file explorer.

Best regards, Juan Carlos.