Skip to content

Fixes opening an answer by hash

tgassmann requested to merge fix-open-answer-by-hash into master

This was already solved in !360 (merged), however merge commit dadc6430 seems to have reverted it.

Currently there seems to be a bug in comsol when the URL specifies an answer to be opened initally. To reproduce, open any exam with an answer id in the hash (e.g. https://exams.vis.ethz.ch/exams/er7x3wls.pdf#9axetb0hf32pi60j). When trying to hide this answer again afterwards, the answer will collapse and open again, instead of staying closed. I'm not entirely sure why the expandedSections and sections were added to the hook dependencies, but since they are not needed in the hook and we only want to run this effect once when the page initializes (or when the hash changes), I think we can safely remove them.

Merge request reports