store_new_submissions: Store new submission files.
Description
store_new_submissions
copies new files from the subdirectories of submissions_dir
to the respective subdirectories of hist_dir
.
Each team has a subdirectory.
The copied files in hist_dir
are prefixed with the last modification date for uniqueness.
A file is considered new if its name and last modification time is new, i.e not present
in hist_dir
.
The files must match pattern
regular expression and must not
throw errors or warnings when given to the valid_fun
function.
Usage
store_new_submissions(submissions_dir = "submissions", hist_dir = "history", deadline, pattern = ".*\\.csv$", valid_fun)
Arguments
submissions_dir
string. directory of the submissions. contains one subdirectory per team
hist_dir
string. directory where to store the history of the submissions. contains one subdirectory per team
deadline
POSIXct. deadline time for submissions. The files with last modification date after
the deadline are skipped.
pattern
string. regular expression that new submission files must match (with ignore.case=TRUE
)
valid_fun
function that reads a submission file and throws errors or warnings if
it is not valid.
Value
store_new_submissions
returns a named list of errors or warnings catched during the process.
Members named after the team names are lists with members named after the file
that throws an error which contain the error object.