Skip to content

Add exercise version hash - #163

Open
reppuli92 wants to merge 1 commit into
apluslms:masterfrom
reppuli92:master
Open

Add exercise version hash#163
reppuli92 wants to merge 1 commit into
apluslms:masterfrom
reppuli92:master

Conversation

@reppuli92

@reppuli92 reppuli92 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

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?

  • Accessibility test using the WAVE extension.
  • Django unit tests.
  • Playwright tests.
  • Other test. (Add a description below)
  • Manual testing.

I tested the actual reset functionality, which works. I did not test the hashes specifically

Did you test the changes in

  • Chrome
  • Firefox
  • This pull request cannot be tested in the browser.

Think of what is affected by these changes and could become broken

Translation

Programming style

  • Did you follow our style guides?
  • Did you use Python type hinting in all functions that you added or edited? (type hints for function parameters and return values)

Have you updated the README or other relevant documentation?

  • documents inside the doc directory.
  • README.md.
  • Aplus Manual.
  • Other documentation (mention below which documentation).

Is it Done?

  • Reviewer has finished the code review
  • After the review, the developer has made changes accordingly
  • Customer/Teacher has accepted the implementation of the feature

Clean up your git commit history before submitting the pull request!

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread access/config.py Outdated
Comment thread access/config.py Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Comment thread access/config.py Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Comment thread access/config.py
@ihalaij1 ihalaij1 moved this from Todo to Under review in A+ sprints Jul 10, 2026
@ihalaij1
ihalaij1 requested a review from murhum1 July 10, 2026 12:55

@ihalaij1 ihalaij1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

I tested this a bunch, found and fixed some bugs with the help of AI, but I would still want @murhum1 to go through this PR to increase the confidence that this doesn't cause any issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Under review

Development

Successfully merging this pull request may close these issues.

4 participants