#' only read in students' functions written above the "ignore_rest" comment
#' @param source_code_lines are codes written by students
drop_after_ignore_rest <- function(source_code_lines) {
# ignore_rest
index <- 1
for (line in source_code_lines) {
if (startsWith(line, "# ignore_rest")) {
break
}
index <- index + 1
}
return(source_code_lines[1:index])
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.