rstudio / learnr

Interactive Tutorials with R Markdown
https://pkgs.rstudio.com/learnr
Apache License 2.0
705 stars 236 forks source link

Fix issue with unevaluated `exercise` chunk option in learnr's knitr hooks #758

Closed gadenbuie closed 1 year ago

gadenbuie commented 1 year ago

Fixes #757

If symbols – like T or a variable – are used in the exercise chunk option, this would cause an error in the checks that run to validate the exercise chunk by comparing with the source chunk because the source chunk options aren't yet evaluated.

This PR evaluates the source chunk option before comparing it with our exercise chunk.