Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grade caching code merged into development branch #205

Merged
merged 19 commits into from
Mar 9, 2024

Conversation

mckeownp
Copy link
Collaborator

@mckeownp mckeownp commented Mar 8, 2024

Hi,

I've merged the grade caching code into the development branch post fixes to the behat testing.

The cache uses an md5 of the serialized $runspec as the key and the serialized outcome as the value. If a job has the same $runspec then the outcome from the cache will be used.

Note: If any JobeServer settings are changed, eg, installing a new version of Python or a new module then the Coderunner cache should be purged as run results may now be different.

There are a few other minor fixes and style tweaks (eg, to keep php8.2+ happy).

Note, this code is for testing on a real server and isn't ready for full release, eg, it doesn't have anything in settings.php (turning cache reading/writing on/off is done in jobesandbox.php via constants - so we can revert to an older commit without version complications).

Cheers,
Paul

Uses a Moolde file cache to store results of checked questions.
The key is made up of the question id, template id, random seed, student answser
and attachements (if any).
Mainly replacing calls to grade_response to grade_response($response, false, false)
instead of grade_response($response, usecache:false)
May still need to change behat_coderunner.php to make it more general.
That is make it possible to change the jobeserver address in different
situations, eg, when running in docker locally or docker in CI tests
on github.
…ents.

Removed unneccesary Given jobe sandbox enabled lines.
Removed the hack in jobesandbox.php in prep for merging with branch
that has fixed the problem of reverting back to coderunner's default
jobe2 server (jobe2.cosc.canterbury.ac.nz) during bhat tests.
…ents.

Removed unneccesary Given jobe sandbox enabled lines.
Removed the hack in jobesandbox.php in prep for merging with branch
that has fixed the problem of reverting back to coderunner's default
jobe2 server (jobe2.cosc.canterbury.ac.nz) during bhat tests.
…come class

to adhere to new PHP8.2 standard.
Also fixed minor bug caused by missed merge conflict
…still use the cached outcome.

That is, something has to change in the actual job being run to force a real regrade.
@trampgeek trampgeek merged commit 0bb30b6 into trampgeek:development Mar 9, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants