Can I restrict access to module functions?

Hi, I am trying to develop a set of automated workshops for students to follow (similar to the ones you access in Coursera or similar). I was wondering if I can (by design, something similar to oop) mask or restrict access to the implementation of the module running behind (tests and utility functions) to the students so they cannot just go and see the implementation of the solution, or if that must be handled by other means. Thank you.

Within a Julia process there is no way of hiding stuff. You could always use @less and the like to view code that is loaded.

So what need to do is likely something like Pluto.jl, where you have a “master” Julia process, that spawns a worker to run the code in. Then code in the master process cannot be accessed from the worker. Then you need a mechanism for the worker to tell the master to check some result.
This setup makes it harder to locate the code that checks the solution, but as long as the students run the software locally, they still have that code somewhere… So to ensure that they cannot access it, you’d need to run the master process on some server for the students to log in. Or use sysimages that runs the server locally on the students computer but is otherwise inaccessible.

This all seems like a lot of effort tbh. I think the best way would be to trust the students not to cheat with their assignments or have some exam at the end of the course where this simple cheating is not possible to test their knowlegde.

I’m a bit confused. I read this with the assumption that the students’ work is to write a program to compute a solution to a problem. In my experience, unrestricted reflection (different from OOP access modifiers btw) isn’t a cheating vulnerability because the solution program is never given to the students. The teacher generally doesn’t have time to vet the algorithms and just tests the students’ program over a variety of inputs, which can be compared to precomputed outputs in a solutions file. More often than not we would submit arbitrary scripts so we aren’t the ones running the tests ourselves, which seems risky to the teacher but I assume there were measures to curb malware.


Maybe you could write a bit more about how you want students to “check their answers”?

Question 1: is the class synchronous, and you grade the homeworks? Or asynchronous: ou want to set it up so that students can check answers automatically, without a teacher.

Question 2: do students submit homeworks via email to you, through an online upload system like turnitin/piazza/blackboard, or do you want students to grade and test their homeworks on their own computer by running a script?


Ideally it would be an automatic grading. I am trying to implement an on site running code server so the student can write the code and just have it checked.

Couldn’t be another approach to consider to arrange the code you want to hide in a package, use package compile on it and provide the students with the precompiled sysimage?

You could try

1 Like