openwebwork / webwork2

Course management front end for WeBWorK
http://webwork.maa.org/wiki/Main_Page
Other
145 stars 165 forks source link

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

Closed drgrice1 closed 8 months ago

drgrice1 commented 10 months ago

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 https://github.com/openwebwork/pg/pull/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 commented 10 months ago

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).