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

Include the problem source hash in the problemUUID passed to PG. #2283

Merged

Conversation

drgrice1
Copy link
Member

If a problem is rendered using any of the source hash parameters (problemSource, rawProblemSource, or uriEncodedProblemSource), then an MD5 hex of the utf8 encoded source is added tot he problemUUID that is passed to PG.

This means that if a problem is rendered by source and the source changes, then dynamically generated images will be regenerated. The PG problem editor uses the rawProblemSource, so this means that if the code for a problem changes in the code mirror window, then dynamic images will be regenerated.

This replaces #2277 and openwebwork/pg#983. This is better as it reliably detects code changes, and it does not need a change to PG. Thanks @drdrew42 for pointing this out.

@drgrice1
Copy link
Member Author

By the way, another advantage of this is that is avoids a potential browser caching issue with the approach in #2277. Since the problemUUID changes, the alias also changes (i.e., the link is to a completely different file).

@drgrice1 drgrice1 force-pushed the problem-uuid-includes-source-hash branch 2 times, most recently from 7685a47 to ff514e2 Compare December 12, 2023 14:57
Copy link
Contributor

@Alex-Jordan Alex-Jordan left a comment

Choose a reason for hiding this comment

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

This looks good

@drgrice1 drgrice1 force-pushed the problem-uuid-includes-source-hash branch from ff514e2 to c5ac981 Compare December 17, 2023 00:54
@drgrice1 drgrice1 force-pushed the problem-uuid-includes-source-hash branch from c5ac981 to ce4be2a Compare January 6, 2024 17:23
@drgrice1 drgrice1 force-pushed the problem-uuid-includes-source-hash branch from ce4be2a to 3f33fc6 Compare January 16, 2024 14:45
If a problem is rendered using any of the source hash parameters
(`problemSource`, `rawProblemSource`, or `uriEncodedProblemSource`),
then an MD5 hex of the utf8 encoded source is added tot he problemUUID
that is passed to PG.

This means that if a problem is rendered by source and the source
changes, then dynamically generated images will be regenerated.  The PG
problem editor uses the rawProblemSource, so this means that if the code
for a problem changes in the code mirror window, then dynamic images
will be regenerated.

This replaces openwebwork#2277 and openwebwork/pg#983. This
is better as it reliably detects code changes, and it does not need a
change to PG.  Thanks @drdrew42 for pointing this out.
@drgrice1 drgrice1 force-pushed the problem-uuid-includes-source-hash branch from 3f33fc6 to 2b6600a Compare January 16, 2024 22:36
@pstaabp pstaabp merged commit 6cc3cf8 into openwebwork:develop Jan 24, 2024
1 check passed
@drgrice1 drgrice1 deleted the problem-uuid-includes-source-hash branch January 24, 2024 22:35
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.

3 participants