Add exercise version hash - #163
Open
reppuli92 wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Adds an exercise “version” hash to the exercise configuration and exposes it to the frontend so downstream systems (A-plus) can detect exercise edits and trigger questionnaire resets when the version changes.
Changes:
- Compute and store a SHA-256 hash (
content_hash) for each exercise when loading/parsing exercise configs. - Expose the hash to clients via a new
<meta name="x-aplus-exercise-version" ...>tag in the exercise head template.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| access/config.py | Computes and attaches content_hash to exercise configuration data during exercise load. |
| access/templates/access/exercise_head.html | Adds a meta tag exposing the computed hash to the client when available. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
What?
Add a hashcode to store exercise version numbers
Why?
This is done to support questionnaire reset if the has differs to refresh updated questionnaires (the reset is on a separate PR on a-plus)
How?
The hash is computed whenever an exercise is edited.
Part of apluslms/a-plus#494
Testing
Remember to add or update unit tests for new features and changes.
What type of test did you run?
I tested the actual reset functionality, which works. I did not test the hashes specifically
Did you test the changes in
Think of what is affected by these changes and could become broken
Translation
Programming style
Have you updated the README or other relevant documentation?
Is it Done?
Clean up your git commit history before submitting the pull request!