TL;DR See the worked example in the Rlogo.Rmd
exercises provided within the package: exams2html("Rlogo.Rmd")
and http://www.R-exams.org/templates/Rlogo/
Details: The exams
package (more specifically the xexams()
workhorse function) do all the handling of the temporary directories. The exercises templates (.Rmd
or .Rnw
) are copied to a temporary directory, weaved/knitted there, read into R, and then the output file(s) are produced in some output directory. That's why some strategies from knitr
don't work for .Rmd
exams - or they just work in certain situations, e.g., when specifying full paths (rather than relative paths).
Solution: To make exams
recognize a certain existing file (not necessarily just graphics) as a supplement to a certain exercise, the .Rmd
file should simply copy that file to the current directory when the file is weaved/knitted. The convenience function include_supplement()
does exactly that and additionally searches certain directories (specifically edir
, if specified) for the files. Subsequently, the copied file "foo.ext"
needs to be included in the exercise, e.g., via 
for a graphic or [foo.ext](foo.ext)
for a hyperlink.