Question Authors' Forum

Passing information "over" a CHECK click

Re: Passing information "over" a CHECK click

by Richard Lobb -
Number of replies: 0
Interesting ideas. Thanks for raising the issue. I'll put this in my todo list for the next push, which will hopefully be around the end of this month.

Yes, you can't write a file to remember grading info, as the Jobe server is stateless. It does have a file cache to save repeated uploads of the same support file or attachment but otherwise each run should leave the server in the same state as before the run.

That said, you can easily circumvent this if you have admin access to the Jobe server. Just create a directory somewhere that has write access for the various Jobe helpers - jobe0 through jobe. But in doing this you immediately open a security hole - any student job has access to the same directory, if it knows about it. A more secure way of providing state is to install and turn on mysql on Jobe, and set up an account with credentials only you know about. Then your template could record state info in that database, although keeping the credentials hidden from prying student eyes is a bit problematic still. Our in-house Python question types prevent student jobs opening 'our' files, but the standard question types all allow students to read the code in the working directory. That includes the file that is currently being run, i.e. the template code.

If you wanted to explore these options, you could set up a docker jobe server of your own on any server that the Moodle server can access, assuming it's not too locked down. There's a rarely used feature under advanced configuration that lets you set, in the Sandbox parameters field, the URI of the Jobe server to use for that question. Click the '?' help button for the Sandbox fields under Advanced customisation for details. It should still work, though I haven't used it recently and it's not tested by the standard test suite.