R/drop_after_ignore_rest.R

Defines functions drop_after_ignore_rest

Documented in drop_after_ignore_rest

#' 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])
}
emse-p4a-gwu/p4aGrader documentation built on May 16, 2020, 1:43 a.m.