Checks if a code chunk was specified. If not, generates a feedback message. If yes, zooms in on the code chunk so you can use functions like check_function as for any regular R exercise.

check_chunk(state, index = 1, not_found_msg = NULL, append = TRUE)

Arguments

state

the state to start from. This state can be produced by check_rmd, but can also follow on check_header to look for a chunk in a specific header section.

index

number that specifies which code chunk to check in the student and solution code that is zoomed in on.

not_found_msg

If specified, this overrides the automatically generated message in case no index'th chunk was found.

append

Whether or not to append the feedback to feedback built in previous states.

Value

A state that zooms in on the code chunk.